[vlc-devel] [PATCH v2] videotoolbox: set iosurface property
Alexandre Janniaux
ajanni at videolabs.io
Tue Jan 26 10:15:55 UTC 2021
Hi,
The link is quite precise on why this is needed in the general
way. It doesn't seem to be needed currently for VT but this is
not documented as-is.
Should I add more precision from the link to the commit message
to ensure that the information is always in the commit?
Regards,
--
Alexandre Janniaux
Videolabs
On Tue, Jan 26, 2021 at 10:53:39AM +0100, Thomas Guillem wrote:
> 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
> _______________________________________________
> 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