gstwaylandsink: "hide" video window when pipeline is stopped

Guillermo Rodriguez Garcia guille.rodriguez at gmail.com
Wed Jan 22 17:36:38 UTC 2020


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?

Thank you,

 [1] https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/blob/master/ext/wayland/gstwaylandsink.c#L376

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


More information about the gstreamer-devel mailing list