summaryrefslogtreecommitdiff
path: root/fftools/ffmpeg_videotoolbox.c
diff options
context:
space:
mode:
authorClément Bœsch <cboesch@gopro.com>2017-09-05 15:58:13 +0200
committerClément Bœsch <cboesch@gopro.com>2017-10-23 11:56:15 +0200
commit2b320318273b74df6e1b712fb33544d6a1b26be1 (patch)
tree0cc5c6a275835ef0d56d5b94a26c2287fd347fc0 /fftools/ffmpeg_videotoolbox.c
parent3605b312f65c4a009301d2d165e2db8d68063acb (diff)
lavc: drop VDA
Deprecated (aka removed) in OSX 10.11, and we have a replacement for it (VideoToolbox).
Diffstat (limited to 'fftools/ffmpeg_videotoolbox.c')
-rw-r--r--fftools/ffmpeg_videotoolbox.c45
1 files changed, 4 insertions, 41 deletions
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;
}