From f4e48c9f8c9cd3aaf5f8705d3032824de2923655 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Mon, 26 Apr 2021 20:42:00 +0200 Subject: [PATCH] Sink: render black on READY_TO_NULL state change Show black background when playback finishes --- lib/gst/clapper/gtk4/gstclapperglsink.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/gst/clapper/gtk4/gstclapperglsink.c b/lib/gst/clapper/gtk4/gstclapperglsink.c index a97dcdc9..7ec85157 100644 --- a/lib/gst/clapper/gtk4/gstclapperglsink.c +++ b/lib/gst/clapper/gtk4/gstclapperglsink.c @@ -604,6 +604,12 @@ gst_clapper_gl_sink_change_state (GstElement * element, GstStateChange transitio return ret; switch (transition) { + case GST_STATE_CHANGE_NULL_TO_READY: + GST_OBJECT_LOCK (clapper_sink); + if (clapper_sink->widget) + clapper_sink->widget->ignore_textures = FALSE; + GST_OBJECT_UNLOCK (clapper_sink); + break; case GST_STATE_CHANGE_READY_TO_PAUSED: { GtkWindow *window = NULL; @@ -619,6 +625,12 @@ gst_clapper_gl_sink_change_state (GstElement * element, GstStateChange transitio } break; } + case GST_STATE_CHANGE_READY_TO_NULL: + GST_OBJECT_LOCK (clapper_sink); + if (clapper_sink->widget) + clapper_sink->widget->ignore_textures = TRUE; + GST_OBJECT_UNLOCK (clapper_sink); + /* Fall through to render black bg */ case GST_STATE_CHANGE_PAUSED_TO_READY: GST_OBJECT_LOCK (clapper_sink); if (clapper_sink->widget)