diff mbox series

[FFmpeg-devel,11/16] lavc/videotoolbox: call VTRegisterSupplementalVideoDecoderIfAvailable

Message ID 20211122205330.43546-11-rcombs@rcombs.me
State New
Headers show
Series [FFmpeg-devel,01/16] ffmpeg: remove ffmpeg_videotoolbox
Related show

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

rcombs Nov. 22, 2021, 8:53 p.m. UTC
This is required for VP9 to work.
---
 libavcodec/videotoolbox.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
index 3022cd1cbf..a11d494915 100644
--- a/libavcodec/videotoolbox.c
+++ b/libavcodec/videotoolbox.c
@@ -32,6 +32,7 @@ 
 #include "h264dec.h"
 #include "hevcdec.h"
 #include "mpegvideo.h"
+#include <Availability.h>
 #include <TargetConditionals.h>
 
 #ifndef kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder
@@ -866,6 +867,12 @@  static int videotoolbox_start(AVCodecContext *avctx)
         break;
     }
 
+#ifdef __MAC_10_11
+    if (__builtin_available(macOS 10.11, *)) {
+        VTRegisterSupplementalVideoDecoderIfAvailable(videotoolbox->cm_codec_type);
+    }
+#endif
+
     decoder_spec = videotoolbox_decoder_config_create(videotoolbox->cm_codec_type, avctx);
 
     if (!decoder_spec) {