mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 16:02:00 +02:00
plugin: Present fallback window right after assembled UI
When started from gst-play/launch-1.0 show window right after it was created. No need to idle dispatch window present when changing state, since we are already on correct thread when opening resources using start() method.
This commit is contained in:
@@ -67,7 +67,6 @@ window_clear_no_lock (GstClapperSink *self)
|
||||
self->window_destroy_id = 0;
|
||||
}
|
||||
self->window = NULL;
|
||||
self->presented_window = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -568,6 +567,9 @@ gst_clapper_sink_start_on_main (GstClapperSink *self)
|
||||
|
||||
self->window_destroy_id = g_signal_connect (self->window,
|
||||
"destroy", G_CALLBACK (window_destroy_cb), self);
|
||||
|
||||
GST_INFO_OBJECT (self, "Presenting window");
|
||||
gtk_window_present (self->window);
|
||||
}
|
||||
|
||||
GST_CLAPPER_SINK_UNLOCK (self);
|
||||
@@ -575,15 +577,6 @@ gst_clapper_sink_start_on_main (GstClapperSink *self)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
window_present_on_main_idle (GtkWindow *window)
|
||||
{
|
||||
GST_INFO ("Presenting window");
|
||||
gtk_window_present (window);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_clapper_sink_start (GstBaseSink *bsink)
|
||||
{
|
||||
@@ -658,16 +651,6 @@ gst_clapper_sink_change_state (GstElement *element, GstStateChange transition)
|
||||
}
|
||||
GST_CLAPPER_SINK_UNLOCK (self);
|
||||
break;
|
||||
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
||||
GST_CLAPPER_SINK_LOCK (self);
|
||||
if (G_UNLIKELY (self->window && !self->presented_window)) {
|
||||
g_idle_add_full (G_PRIORITY_DEFAULT,
|
||||
(GSourceFunc) window_present_on_main_idle,
|
||||
g_object_ref (self->window), (GDestroyNotify) g_object_unref);
|
||||
self->presented_window = TRUE;
|
||||
}
|
||||
GST_CLAPPER_SINK_UNLOCK (self);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user