[FFmpeg-cvslog] avcodec/videotoolbox: set kCVPixelBufferOpenGLESCompatibilityKey for iOS

wang-bin git at videolan.org
Mon Mar 6 11:54:54 EET 2017


ffmpeg | branch: master | wang-bin <wbsecg1 at gmail.com> | Fri Mar  3 18:10:54 2017 +0800| [3267e1703b32e83bce1329676fd007cc66a592c7] | committer: wm4

avcodec/videotoolbox: set kCVPixelBufferOpenGLESCompatibilityKey for iOS

kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey is not available in
iOS

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3267e1703b32e83bce1329676fd007cc66a592c7
---

 libavcodec/videotoolbox.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
index 824f2d8..9199b02 100644
--- a/libavcodec/videotoolbox.c
+++ b/libavcodec/videotoolbox.c
@@ -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);



More information about the ffmpeg-cvslog mailing list