[vlc-devel] [PATCH] videotoolbox: set iosurface property

Alexandre Janniaux ajanni at videolabs.io
Fri Dec 11 11:54:36 CET 2020


See https://developer.apple.com/library/archive/qa/qa1781/_index.html
---
 modules/codec/videotoolbox.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/codec/videotoolbox.c b/modules/codec/videotoolbox.c
index 0db6424f98..c09ef37769 100644
--- a/modules/codec/videotoolbox.c
+++ b/modules/codec/videotoolbox.c
@@ -1208,6 +1208,10 @@ static int StartVideoToolbox(decoder_t *p_dec)
                          kCVPixelBufferOpenGLESCompatibilityKey,
                          kCFBooleanTrue);
 #endif
+    CFMutableDictionaryRef iosurfaceProperties = cfdict_create(0);
+    CFDictionarySetValue(destinationPixelBufferAttributes,
+                         kCVPixelBufferIOSurfacePropertiesKey,
+                         iosurfaceProperties);
 
     cfdict_set_int32(destinationPixelBufferAttributes,
                      kCVPixelBufferWidthKey, p_dec->fmt_out.video.i_visible_width);
@@ -1238,6 +1242,7 @@ static int StartVideoToolbox(decoder_t *p_dec)
                                           decoderConfiguration,
                                           destinationPixelBufferAttributes,
                                           &decoderCallbackRecord, &p_sys->session);
+    CFRelease(iosurfaceProperties);
     CFRelease(decoderConfiguration);
     CFRelease(destinationPixelBufferAttributes);
 
-- 
2.29.2



More information about the vlc-devel mailing list