aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAman Gupta <aman@tmm1.net>2018-04-19 15:34:01 -0700
committerAman Gupta <aman@tmm1.net>2018-05-04 18:24:49 -0700
commitbcff983dc340e76518935111146c0e1daf4cb37b (patch)
tree853e80d3925cb836365a7ec7cb868c4e5fb666a4
parent84e03db9a334611d261cb09c534a56bf57a49cd9 (diff)
downloadffmpeg-bcff983dc340e76518935111146c0e1daf4cb37b.tar.gz
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>
-rw-r--r--libavcodec/videotoolbox.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
index 6dd800daf8..8671608a35 100644
--- a/libavcodec/videotoolbox.c
+++ b/libavcodec/videotoolbox.c
@@ -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;