diff options
author | Niklas Haas <git@nand.wakku.to> | 2015-02-28 01:39:31 +0100 |
---|---|---|
committer | Niklas Haas <git@nand.wakku.to> | 2015-02-28 01:39:31 +0100 |
commit | 653b0dd5295453d9661f673b4ebd02c5ceacf645 (patch) | |
tree | 469f28b70997ae072ed0426bd6246f24c9a42a1d | |
parent | 729c8b3f641e633474be612e66388c131a1b5c92 (diff) | |
download | mpv-653b0dd5295453d9661f673b4ebd02c5ceacf645.tar.bz2 mpv-653b0dd5295453d9661f673b4ebd02c5ceacf645.tar.xz |
screenshots: check for AVFrame csp support
Apparently, libav stable is old enough to not have these fields.
-rwxr-xr-x | old-configure | 6 | ||||
-rw-r--r-- | video/image_writer.c | 2 | ||||
-rw-r--r-- | wscript | 7 |
3 files changed, 15 insertions, 0 deletions
diff --git a/old-configure b/old-configure index 2558985b03..6bdfc4413b 100755 --- a/old-configure +++ b/old-configure @@ -814,6 +814,12 @@ api_statement_check \ 'av_frame_get_metadata(NULL)' api_statement_check \ + "libavutil AVFrame colorspace information" \ + HAVE_AVFRAME_CSP \ + libavutil/frame.h \ + 'AVFrame frame; frame.color_primaries = frame.color_trc = 0;' + +api_statement_check \ "libavutil AVFrame skip samples metadata" \ HAVE_AVFRAME_SKIP_SAMPLES \ libavutil/frame.h \ diff --git a/video/image_writer.c b/video/image_writer.c index ab00b5bb01..700e1c4284 100644 --- a/video/image_writer.c +++ b/video/image_writer.c @@ -133,10 +133,12 @@ static int write_lavc(struct image_writer_ctx *ctx, mp_image_t *image, FILE *fp) pic->format = avctx->pix_fmt; pic->width = avctx->width; pic->height = avctx->height; +#if HAVE_AVFRAME_CSP if (ctx->opts->tag_csp) { pic->color_primaries = mp_csp_prim_to_avcol_pri(image->params.primaries); pic->color_trc = mp_csp_trc_to_avcol_trc(image->params.gamma); } +#endif int ret = avcodec_encode_video2(avctx, &pkt, pic, &got_output); if (ret < 0) goto error_exit; @@ -462,6 +462,13 @@ Libav libraries ({0}). Aborting.".format(" ".join(libav_pkg_config_checks)) 'func': check_statement('libavutil/frame.h', 'enum AVFrameSideDataType type = AV_FRAME_DATA_SKIP_SAMPLES', use='libav') + }, { + 'name': 'avframe-csp', + 'desc': 'libavutil AVFrame colorspace information', + 'func': check_statement('libavutil/frame.h', + 'AVFrame frame;' + 'frame.color_primaries = frame.color_trc = 0;', + use='libav') } ] |