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

Thomas Guillem thomas at gllm.fr
Tue Jan 26 09:53:39 UTC 2021


kCVPixelBufferIOSurfacePropertiesKey is already used for cvpx pool creation (used by filters and not the vt decoder).

You should explain why it is needed now (in the commit log).

On Tue, Jan 26, 2021, at 09:29, Alexandre Janniaux wrote:
> The kCVPixelBufferIOSSurfaceProperties is supposed to be mandatory for
> baking the buffer with an iosurface.
> 
> See https://developer.apple.com/library/archive/qa/qa1781/_index.html
> ---
>  modules/codec/videotoolbox.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/modules/codec/videotoolbox.c b/modules/codec/videotoolbox.c
> index 9224989cb7..de1a3483b6 100644
> --- a/modules/codec/videotoolbox.c
> +++ b/modules/codec/videotoolbox.c
> @@ -1205,6 +1205,16 @@ static int StartVideoToolbox(decoder_t *p_dec)
>                           kCVPixelBufferOpenGLESCompatibilityKey,
>                           kCFBooleanTrue);
>  #endif
> +    CFMutableDictionaryRef iosurfaceProperties = cfdict_create(0);
> +    if (iosurfaceProperties == NULL)
> +    {
> +        CFRelease(destinationPixelBufferAttributes);
> +        CFRelease(decoderConfiguration);
> +        return VLC_ENOMEM;
> +    }
> +    CFDictionarySetValue(destinationPixelBufferAttributes,
> +                         kCVPixelBufferIOSurfacePropertiesKey,
> +                         iosurfaceProperties);
>  
>      cfdict_set_int32(destinationPixelBufferAttributes,
>                       kCVPixelBufferWidthKey, 
> p_dec->fmt_out.video.i_visible_width);
> @@ -1235,6 +1245,7 @@ static int StartVideoToolbox(decoder_t *p_dec)
>                                            decoderConfiguration,
>                                            
> destinationPixelBufferAttributes,
>                                            &decoderCallbackRecord, 
> &p_sys->session);
> +    CFRelease(iosurfaceProperties);
>      CFRelease(decoderConfiguration);
>      CFRelease(destinationPixelBufferAttributes);
>  
> -- 
> 2.30.0
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list