summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillermo Rodríguez <guille.rodriguez@gmail.com>2020-01-28 13:06:59 +0100
committerTim-Philipp Müller <tim@centricular.com>2020-02-05 09:12:29 +0000
commit24456ea8500b1d3f42ea4340f223311506e5127d (patch)
tree6b85cc573f5a321dec32c2ba95f727ad14862804
parent3fbfb7909d957428374f30580e37c4ebd166a4fe (diff)
downloadgstreamer-plugins-bad-24456ea8500b1d3f42ea4340f223311506e5127d.tar.gz
waylandsink: Clear window when pipeline is stopped
When a pipeline is stopped (actually when the waylandsink element state changes from PAUSED to READY) the video surface is cleared, but the opaque black surface behind is not. Fix this by actually clearing both surfaces.
-rw-r--r--ext/wayland/wlwindow.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/ext/wayland/wlwindow.c b/ext/wayland/wlwindow.c
index 3249d8ec6..c3dc61d28 100644
--- a/ext/wayland/wlwindow.c
+++ b/ext/wayland/wlwindow.c
@@ -453,14 +453,18 @@ gst_wl_window_render (GstWlWindow * window, GstWlBuffer * buffer,
gst_wl_window_set_opaque (window, info);
}
- if (G_LIKELY (buffer))
+ if (G_LIKELY (buffer)) {
gst_wl_buffer_attach (buffer, window->video_surface_wrapper);
- else
+ wl_surface_damage (window->video_surface_wrapper, 0, 0,
+ window->video_rectangle.w, window->video_rectangle.h);
+ wl_surface_commit (window->video_surface_wrapper);
+ } else {
+ /* clear both video and parent surfaces */
wl_surface_attach (window->video_surface_wrapper, NULL, 0, 0);
-
- wl_surface_damage (window->video_surface_wrapper, 0, 0,
- window->video_rectangle.w, window->video_rectangle.h);
- wl_surface_commit (window->video_surface_wrapper);
+ wl_surface_commit (window->video_surface_wrapper);
+ wl_surface_attach (window->area_surface_wrapper, NULL, 0, 0);
+ wl_surface_commit (window->area_surface_wrapper);
+ }
if (G_UNLIKELY (info)) {
/* commit also the parent (area_surface) in order to change