Browse Source

avcodec/videotoolbox: fix kVTCouldNotFindVideoDecoderErr trying to decode HEVC on iOS

Older iOS devices don't have a hardware HEVC decoder, but the
software decoder offered by VideoToolbox is well-optimized and
performs much better than the ffmpeg decoder.

Signed-off-by: Aman Gupta <aman@tmm1.net>
tags/n4.1
Aman Gupta 7 years ago
parent
commit
bcff983dc3
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      libavcodec/videotoolbox.c

+ 6
- 1
libavcodec/videotoolbox.c View File

@@ -36,6 +36,9 @@
#ifndef kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder
# define kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder CFSTR("RequireHardwareAcceleratedVideoDecoder")
#endif
#ifndef kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder
# define kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder CFSTR("EnableHardwareAcceleratedVideoDecoder")
#endif

#if !HAVE_KCMVIDEOCODECTYPE_HEVC
enum { kCMVideoCodecType_HEVC = 'hvc1' };
@@ -709,7 +712,9 @@ static CFDictionaryRef videotoolbox_decoder_config_create(CMVideoCodecType codec
&kCFTypeDictionaryValueCallBacks);

CFDictionarySetValue(config_info,
kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder,
codec_type == kCMVideoCodecType_HEVC ?
kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder :
kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder,
kCFBooleanTrue);

CFMutableDictionaryRef avc_info;


Loading…
Cancel
Save