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
36#ifndef kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder36#ifndef kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder
37# define kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder CFSTR("RequireHardwareAcceleratedVideoDecoder")37# define kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder CFSTR("RequireHardwareAcceleratedVideoDecoder")
38#endif38#endif
39#ifndef kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder
40# define kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder CFSTR("EnableHardwareAcceleratedVideoDecoder")
41#endif
39 42
40#if !HAVE_KCMVIDEOCODECTYPE_HEVC43#if !HAVE_KCMVIDEOCODECTYPE_HEVC
41enum { kCMVideoCodecType_HEVC = 'hvc1' };44enum { kCMVideoCodecType_HEVC = 'hvc1' };
@@ -709,7 +712,9 @@ static CFDictionaryRef videotoolbox_decoder_config_create(CMVideoCodecType codec · 667 unmodified lines
709 &kCFTypeDictionaryValueCallBacks);712 &kCFTypeDictionaryValueCallBacks);
710 713
711 CFDictionarySetValue(config_info,714 CFDictionarySetValue(config_info,
712 kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder,715 codec_type == kCMVideoCodecType_HEVC ?
716 kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder :
717 kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder,
713 kCFBooleanTrue);718 kCFBooleanTrue);
714 719
715 CFMutableDictionaryRef avc_info;720 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