From 2b320318273b74df6e1b712fb33544d6a1b26be1 Mon Sep 17 00:00:00 2001 From: Clément Bœsch Date: Tue, 5 Sep 2017 15:58:13 +0200 Subject: lavc: drop VDA Deprecated (aka removed) in OSX 10.11, and we have a replacement for it (VideoToolbox). --- fftools/ffmpeg_videotoolbox.c | 45 ++++--------------------------------------- 1 file changed, 4 insertions(+), 41 deletions(-) (limited to 'fftools/ffmpeg_videotoolbox.c') diff --git a/fftools/ffmpeg_videotoolbox.c b/fftools/ffmpeg_videotoolbox.c index e9039654b9..b820aec017 100644 --- a/fftools/ffmpeg_videotoolbox.c +++ b/fftools/ffmpeg_videotoolbox.c @@ -23,12 +23,7 @@ #endif #include "libavcodec/avcodec.h" -#if CONFIG_VDA -# include "libavcodec/vda.h" -#endif -#if CONFIG_VIDEOTOOLBOX -# include "libavcodec/videotoolbox.h" -#endif +#include "libavcodec/videotoolbox.h" #include "libavutil/imgutils.h" #include "ffmpeg.h" @@ -114,15 +109,7 @@ static void videotoolbox_uninit(AVCodecContext *s) av_frame_free(&vt->tmp_frame); - if (ist->hwaccel_id == HWACCEL_VIDEOTOOLBOX) { -#if CONFIG_VIDEOTOOLBOX - av_videotoolbox_default_free(s); -#endif - } else { -#if CONFIG_VDA - av_vda_default_free(s); -#endif - } + av_videotoolbox_default_free(s); av_freep(&ist->hwaccel_ctx); } @@ -147,8 +134,7 @@ int videotoolbox_init(AVCodecContext *s) goto fail; } - if (ist->hwaccel_id == HWACCEL_VIDEOTOOLBOX) { -#if CONFIG_VIDEOTOOLBOX + // TODO: reindent if (!videotoolbox_pixfmt) { ret = av_videotoolbox_default_init(s); } else { @@ -166,31 +152,8 @@ int videotoolbox_init(AVCodecContext *s) ret = av_videotoolbox_default_init2(s, vtctx); CFRelease(pixfmt_str); } -#endif - } else { -#if CONFIG_VDA - if (!videotoolbox_pixfmt) { - ret = av_vda_default_init(s); - } else { - AVVDAContext *vdactx = av_vda_alloc_context(); - CFStringRef pixfmt_str = CFStringCreateWithCString(kCFAllocatorDefault, - videotoolbox_pixfmt, - kCFStringEncodingUTF8); -#if HAVE_UTGETOSTYPEFROMSTRING - vdactx->cv_pix_fmt_type = UTGetOSTypeFromString(pixfmt_str); -#else - av_log(s, loglevel, "UTGetOSTypeFromString() is not available " - "on this platform, %s pixel format can not be honored from " - "the command line\n", videotoolbox_pixfmt); -#endif - ret = av_vda_default_init2(s, vdactx); - CFRelease(pixfmt_str); - } -#endif - } if (ret < 0) { - av_log(NULL, loglevel, - "Error creating %s decoder.\n", ist->hwaccel_id == HWACCEL_VIDEOTOOLBOX ? "Videotoolbox" : "VDA"); + av_log(NULL, loglevel, "Error creating Videotoolbox decoder.\n"); goto fail; } -- cgit v1.2.3