]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/videotoolbox.c
videotoolbox: require hardware acceleration
[ffmpeg] / libavcodec / videotoolbox.c
index b78238ae37592419a79dc95504a9d906dcb38bde..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) {
@@ -501,7 +501,6 @@ static int videotoolbox_default_init(AVCodecContext *avctx)
     VTDecompressionOutputCallbackRecord decoder_cb;
     CFDictionaryRef decoder_spec;
     CFDictionaryRef buf_attr;
-    int32_t pix_fmt;
 
     if (!videotoolbox) {
         av_log(avctx, AV_LOG_ERROR, "hwaccel context is not set\n");
@@ -528,8 +527,6 @@ static int videotoolbox_default_init(AVCodecContext *avctx)
         break;
     }
 
-    pix_fmt = videotoolbox->cv_pix_fmt_type;
-
     decoder_spec = videotoolbox_decoder_config_create(videotoolbox->cm_codec_type, avctx);
 
     videotoolbox->cm_fmt_desc = videotoolbox_format_desc_create(videotoolbox->cm_codec_type,