History

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.

Aman Gupta committed 8 years ago

Commit bcff9831 parent 84e03db1 file · +6 −1Browse files

Unified · Split

libavcodec/videotoolbox.c+6−1
@@ -36,6 +36,9 @@ · 35 unmodified lines
3636 #ifndef kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder
3737 # define kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder CFSTR("RequireHardwareAcceleratedVideoDecoder")
3838 #endif
39+#ifndef kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder
40+# define kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder CFSTR("EnableHardwareAcceleratedVideoDecoder")
41+#endif
3942
4043 #if !HAVE_KCMVIDEOCODECTYPE_HEVC
4144 enum { kCMVideoCodecType_HEVC = 'hvc1' };
@@ -709,7 +712,9 @@ static CFDictionaryRef videotoolbox_decoder_config_create(CMVideoCodecType codec · 667 unmodified lines
709712 &kCFTypeDictionaryValueCallBacks);
710713
711714 CFDictionarySetValue(config_info,
712− kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder,
715+ codec_type == kCMVideoCodecType_HEVC ?
716+ kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder :
717+ kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder,
713718 kCFBooleanTrue);
714719
715720 CFMutableDictionaryRef avc_info;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t