[vlc-devel] [PATCH 1/6] vout_window: add rendering suspension/resuming callbacks

Alexandre Janniaux ajanni at videolabs.io
Fri Feb 5 09:48:08 UTC 2021


Hi,

As answered by the others here, STATE_ABOVE/BELOW won't
be equivalent to «visible/not visible», which could be
another naming for the callback.

Indeed, you could have STATE_BELOW and still be visible
on desktop since it designates wallpaper mode.

I don't really want to add a NOT_VISIBLE state here
because it doesn't seem to combine correctly with, like,
wallpaper mode + NOT_VISIBLE.

I hope the intent is clearer.

Regards,
--
Alexandre Janniaux
Videolabs

On Fri, Feb 05, 2021 at 10:17:04AM +0100, Thomas Guillem wrote:
> Hello,
>
> Why not using vout_window_ReportState()? That use the following enum:
>
> VOUT_WINDOW_STATE_ABOVE
> VOUT_WINDOW_STATE_BELOW
>
> It doesn't seem to be used by any vout modules for now. And maybe the core implementation is not correct for you need.
>
>
> On Fri, Feb 5, 2021, at 10:01, Alexandre Janniaux wrote:
> > Those callbacks are used by vout_window implementations in environment
> > where the rendering is constrained by the application state. The design
> > case for those events is iOS where application must not draw onto its
> > surface when they have been moved to the background, but it should be
> > generalizable to every cases where the window is in a state such as no
> > more rendering is needed for it.
> > ---
> >  include/vlc_vout_window.h | 33 +++++++++++++++++++++++++++++++++
> >  1 file changed, 33 insertions(+)
> >
> > diff --git a/include/vlc_vout_window.h b/include/vlc_vout_window.h
> > index ea16d4b414..b02c451794 100644
> > --- a/include/vlc_vout_window.h
> > +++ b/include/vlc_vout_window.h
> > @@ -289,6 +289,25 @@ struct vout_window_callbacks {
> >       */
> >      void (*output_event)(struct vout_window_t *,
> >                           const char *id, const char *desc);
> > +
> > +    /**
> > +     * Callback for window rendering suspension.
> > +     *
> > +     * This callback function (if non-NULL) signals that the window has been
> > +     * suspended and should not be used for rendering after the end of this
> > +     * function until the `resumed` event is submitted. Typicaly use case of
> > +     * this event is when the application has been moved to the background
> > +     * and should not draw anything.
> > +     */
> > +    void (*rendering_suspended)(struct vout_window_t *);
> > +
> > +    /**
> > +     * Callback for resuming window rendering.
> > +     *
> > +     * This callback function (if non-NULL) signals that the window has been
> > +     * resumed and can be rendered.
> > +     */
> > +    void (*rendering_resumed)(struct vout_window_t *);
> >  };
> >
> >  /**
> > @@ -692,5 +711,19 @@ static inline void
> > vout_window_ReportOutputDevice(vout_window_t *window,
> >          window->owner.cbs->output_event(window, id, name);
> >  }
> >
> > +static inline void
> > +vout_window_ReportRenderingSuspended(vout_window_t *window)
> > +{
> > +    if (window->owner.cbs->rendering_suspended != NULL)
> > +        window->owner.cbs->rendering_suspended(window);
> > +}
> > +
> > +static inline void
> > +vout_window_ReportRenderingResumed(vout_window_t *window)
> > +{
> > +    if (window->owner.cbs->rendering_resumed != NULL)
> > +        window->owner.cbs->rendering_resumed(window);
> > +}
> > +
> >  /** @} */
> >  #endif /* VLC_VOUT_WINDOW_H */
> > --
> > 2.28.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