]> git.sesse.net Git - ffmpeg/blobdiff - fftools/ffmpeg_videotoolbox.c
Merge commit '0cf949a01193dcf6f83fd95d46792dd94479b4e4'
[ffmpeg] / fftools / ffmpeg_videotoolbox.c
index e9039654b93de84cfb1fe4c1387dc036fa777249..b820aec017f7dec26a402e7a7f9fe26353664731 100644 (file)
 #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;
     }