]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/videotoolbox: set kCVPixelBufferOpenGLESCompatibilityKey for iOS
authorwang-bin <wbsecg1@gmail.com>
Fri, 3 Mar 2017 10:10:54 +0000 (18:10 +0800)
committerwm4 <nfxjfg@googlemail.com>
Mon, 6 Mar 2017 09:54:02 +0000 (10:54 +0100)
kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey is not available in
iOS

libavcodec/videotoolbox.c

index 824f2d8e683f6ecef6cb75a8fa6e0dbdc8f4d584..9199b020556bd32b7d3562820b14048e71a0e4d8 100644 (file)
@@ -31,6 +31,7 @@
 #include "bytestream.h"
 #include "h264dec.h"
 #include "mpegvideo.h"
+#include <TargetConditionals.h>
 
 #ifndef kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder
 #  define kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder CFSTR("RequireHardwareAcceleratedVideoDecoder")
@@ -477,7 +478,11 @@ static CFDictionaryRef videotoolbox_buffer_attributes_create(int width,
     CFDictionarySetValue(buffer_attributes, kCVPixelBufferIOSurfacePropertiesKey, io_surface_properties);
     CFDictionarySetValue(buffer_attributes, kCVPixelBufferWidthKey, w);
     CFDictionarySetValue(buffer_attributes, kCVPixelBufferHeightKey, h);
+#if TARGET_OS_IPHONE
+    CFDictionarySetValue(buffer_attributes, kCVPixelBufferOpenGLESCompatibilityKey, kCFBooleanTrue);
+#else
     CFDictionarySetValue(buffer_attributes, kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey, kCFBooleanTrue);
+#endif
 
     CFRelease(io_surface_properties);
     CFRelease(cv_pix_fmt);