From: wang-bin <wbse...@gmail.com>

1. a cvpixelbuffer backed by iosurface can always be converted to an opengl 
texture, using CGLTexImageIOSurface2D for macOS, and undocumented api 
texImageIOSurface(which is internally used by public api 
CVOpenGLESTextureCacheCreateTextureFromImage) for iOS4.0+.
2. enabling the attribute can slow down decoding speed a lot. I tested many 
video clips on my macbook air. for example: ffmpeg -ss 00:00:00 -t 00:03:00 
-hwaccel videotoolbox -an -i big_buck_bunny_1080p_h264.mov -f null ->/dev/null, 
result with the attribute
enabled: frame= 2082 fps= 85 q=-0.0 Lsize=N/A time=00:03:00.00 bitrate=N/A 
speed=7.34x
disabled: frame= 2031 fps=104 q=-0.0 Lsize=N/A time=00:03:00.00 bitrate=N/A 
speed=9.22x
---
 libavcodec/videotoolbox.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
index 9d2f0afa20..24631684d7 100644
--- a/libavcodec/videotoolbox.c
+++ b/libavcodec/videotoolbox.c
@@ -664,11 +664,6 @@ 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);
-- 
2.15.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to