]> git.sesse.net Git - ffmpeg/commitdiff
videotoolbox: require hardware acceleration
authorStefano Pigozzi <stefano.pigozzi@gmail.com>
Fri, 21 Aug 2015 06:56:24 +0000 (08:56 +0200)
committerwm4 <nfxjfg@googlemail.com>
Tue, 29 Sep 2015 21:55:11 +0000 (23:55 +0200)
VideoToolbox also implements a software decoder for h264, and will fallback to
using it if the file cannot be decoded on the GPU. In these cases though,
we want the hwaccel to fail so that we can use the libavcodec software decoder
instead of the Apple one.

Signed-off-by: wm4 <nfxjfg@googlemail.com>
libavcodec/videotoolbox.c

index ca4449105d1a4ce17bad18d8491699a36d50a2ac..9dec5fcafccbce44c22516b3a7c670066cee8656 100644 (file)
@@ -32,8 +32,8 @@
 #include "h264.h"
 #include "mpegvideo.h"
 
-#ifndef kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder
-#  define kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder CFSTR("EnableHardwareAcceleratedVideoDecoder")
+#ifndef kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder
+#  define kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder CFSTR("RequireHardwareAcceleratedVideoDecoder")
 #endif
 
 #define VIDEOTOOLBOX_ESDS_EXTRADATA_PADDING  12
@@ -398,7 +398,7 @@ static CFDictionaryRef videotoolbox_decoder_config_create(CMVideoCodecType codec
                                                                    &kCFTypeDictionaryValueCallBacks);
 
     CFDictionarySetValue(config_info,
-                         kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder,
+                         kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder,
                          kCFBooleanTrue);
 
     if (avctx->extradata_size) {