[vlc-devel] [PATCH] libvlc: add a bool return value to the resize callback

robux4 at ycbcr.xyz robux4 at ycbcr.xyz
Thu Nov 15 19:57:02 CET 2018


I don't think it's any notification. It's not an event it's a callback, used when rendering is done in a host app. And it tells the app the size it's going to use to render. It may have to allocate some texture and it may fail (4K rgba for example).
I'm not sure rendering will work if the resizing fails.

Later I'd like to signal the bit depth, the HDR format and possibly the pixel format (it may not be RGB).
On 15 Nov 2018 at 19:47 +0100, Rémi Denis-Courmont <remi at remlab.net>, wrote:
> The size is a notification, not a request, from the system via the window. It is not possible to "fail" a notification. The return value here is void very much on purpose.
>
> Nack.
>
> > Le 15 novembre 2018 15:20:28 GMT+02:00, Steve Lhomme <robux4 at ycbcr.xyz> a écrit :
> > > For some reason it may be impossible to the host to provide a context with the
> > > given size.
> > > include/vlc/libvlc_media_player.h | 3 ++-
> > > modules/video_output/vgl.c        | 2 +-
> > > 2 files changed, 3 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/include/vlc/libvlc_media_player.h b/include/vlc/libvlc_media_player.h
> > > index 73dadda3ba..987fd40c9d 100644
> > > --- a/include/vlc/libvlc_media_player.h
> > > +++ b/include/vlc/libvlc_media_player.h
> > > @@ -446,9 +446,10 @@ typedef void (*libvlc_gl_cleanup_cb)(void* opaque);
> > >  * \param opaque private pointer passed to the @a libvlc_video_set_opengl_callbacks() [IN]
> > >  * \param width video width in pixel [IN]
> > >  * \param height video height in pixel [IN]
> > > + * \return true on success
> > >  * \version LibVLC 4.0.0 or later
> > >  */
> > > -typedef void (*libvlc_gl_resize_cb)(void* opaque, unsigned width, unsigned height);
> > > +typedef bool (*libvlc_gl_resize_cb)(void* opaque, unsigned width, unsigned height);
> > >
> > >
> > > /**
> > > diff --git a/modules/video_output/vgl.c b/modules/video_output/vgl.c
> > > index 6a69a3751e..1a1d537edc 100644
> > > --- a/modules/video_output/vgl.c
> > > +++ b/modules/video_output/vgl.c
> > > @@ -33,7 +33,7 @@ struct vout_display_sys_t
> > > {
> > >     void (*cleanupCb)(void* opaque);
> > >     bool (*setupCb)(void* opaque);
> > > -    void (*resizeCb)(void* opaque, unsigned, unsigned);
> > > +    bool (*resizeCb)(void* opaque, unsigned, unsigned);
> > >     void (*swapCb)(void* opaque);
> > >     bool (*makeCurrentCb)(void* opaque, bool);
> > >     void* (*getProcAddressCb)(void* opaque, const char *name);
>
> --
> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20181115/a5d5eddc/attachment.html>


More information about the vlc-devel mailing list