gstwaylandsink: "hide" video window when pipeline is stopped

Guillermo Rodriguez Garcia guille.rodriguez at gmail.com
Thu Jan 23 10:47:30 UTC 2020


El mié., 22 ene. 2020 a las 21:47, Nicolas Dufresne
(<nicolas at ndufresne.ca>) escribió:
>
> Le mercredi 22 janvier 2020 à 18:36 +0100, Guillermo Rodriguez Garcia a écrit :
> > Hello all,
> >
> > I am using gstwaylandsink to render to an application supplied surface
> > (via the GstVideoOverlay interface). I need to control the position of
> > the video window, so the application creates a top-level, fully
> > transparent surface with the same size as the screen, then I use
> > set_render_rectangle to tell waylandsink where the video should
> > actually be drawn. This is working fine.
> >
> > My problem is that when the pipeline is stopped (state set to NULL),
> > the video area is cleared to black, and stays on top of the
> > controlling application. I would need the video area to be "hidden"
> > instead (i.e. removed from the composition).
> >
> > The thing is that looking at the code it seems that this (hiding the
> > window) was actually the intended behaviour. Pipeline state changes
> > are handled in gst_wayland_sink_change_state [1]. For the PAUSED to
> > READY transition, the code looks like this:
> >
> >     case GST_STATE_CHANGE_PAUSED_TO_READY:
> >       gst_buffer_replace (&sink->last_buffer, NULL);
> >       if (sink->window) {
> >         if (gst_wl_window_is_toplevel (sink->window)) {
> >           g_clear_object (&sink->window);
> >         } else {
> >           /* remove buffer from surface, show nothing */
> >           gst_wl_window_render (sink->window, NULL, NULL);
> >         }
> >       }
> >
> > In my case, sink->window is not a toplevel, so the 'else' branch runs.
> >
> > gst_wl_window_render does a wl_surface_attach with a NULL buffer +
> > wl_surface_commit, which should actually "hide" the window. Yet for
> > some reason this is not what is happening.
> >
> > I am probably missing something; any ideas or hints?
>
> Indeed, I would expect exactly what you want to happen. Which compositor is
> this?

I am using Weston in my application but I have checked and I get
exactly the same behaviour with Mutter...

Guillermo

>
> >
> > Thank you,
> >
> >  [1]
> > https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/blob/master/ext/wayland/gstwaylandsink.c#L376
> >
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



-- 
Guillermo Rodriguez Garcia
guille.rodriguez at gmail.com


More information about the gstreamer-devel mailing list