mirror of https://git.ffmpeg.org/ffmpeg.git
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>
This commit is contained in:
parent
84e03db9a3
commit
bcff983dc3
|
@ -36,6 +36,9 @@
|
||||||
#ifndef kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder
|
#ifndef kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder
|
||||||
# define kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder CFSTR("RequireHardwareAcceleratedVideoDecoder")
|
# define kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder CFSTR("RequireHardwareAcceleratedVideoDecoder")
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder
|
||||||
|
# define kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder CFSTR("EnableHardwareAcceleratedVideoDecoder")
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !HAVE_KCMVIDEOCODECTYPE_HEVC
|
#if !HAVE_KCMVIDEOCODECTYPE_HEVC
|
||||||
enum { kCMVideoCodecType_HEVC = 'hvc1' };
|
enum { kCMVideoCodecType_HEVC = 'hvc1' };
|
||||||
|
@ -709,6 +712,8 @@ static CFDictionaryRef videotoolbox_decoder_config_create(CMVideoCodecType codec
|
||||||
&kCFTypeDictionaryValueCallBacks);
|
&kCFTypeDictionaryValueCallBacks);
|
||||||
|
|
||||||
CFDictionarySetValue(config_info,
|
CFDictionarySetValue(config_info,
|
||||||
|
codec_type == kCMVideoCodecType_HEVC ?
|
||||||
|
kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder :
|
||||||
kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder,
|
kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder,
|
||||||
kCFBooleanTrue);
|
kCFBooleanTrue);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue