mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
ges: Implement our own idle_add which uses the thread local maincontext
This commit is contained in:
parent
35096e4d94
commit
5847c6e5ed
5 changed files with 19 additions and 3 deletions
|
@ -283,7 +283,7 @@ _load_from_uri (GESFormatter * self, GESTimeline * timeline, const gchar * uri,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (priv->pending_assets == NULL)
|
if (priv->pending_assets == NULL)
|
||||||
g_idle_add ((GSourceFunc) _loading_done_cb, g_object_ref (self));
|
ges_idle_add ((GSourceFunc) _loading_done_cb, g_object_ref (self), NULL);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -351,6 +351,9 @@ G_GNUC_INTERNAL gint element_end_compare (GESTimelineElement *
|
||||||
G_GNUC_INTERNAL GstElementFactory *
|
G_GNUC_INTERNAL GstElementFactory *
|
||||||
ges_get_compositor_factory (void);
|
ges_get_compositor_factory (void);
|
||||||
|
|
||||||
|
G_GNUC_INTERNAL void
|
||||||
|
ges_idle_add (GSourceFunc func, gpointer udata, GDestroyNotify notify);
|
||||||
|
|
||||||
|
|
||||||
/****************************************************
|
/****************************************************
|
||||||
* GESContainer *
|
* GESContainer *
|
||||||
|
|
|
@ -224,7 +224,7 @@ _load_project (GESProject * project, GESTimeline * timeline, GError ** error)
|
||||||
data->project = gst_object_ref (project);
|
data->project = gst_object_ref (project);
|
||||||
|
|
||||||
/* Make sure the signal is emitted after the functions ends */
|
/* Make sure the signal is emitted after the functions ends */
|
||||||
g_idle_add ((GSourceFunc) _emit_loaded_in_idle, data);
|
ges_idle_add ((GSourceFunc) _emit_loaded_in_idle, data, NULL);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1417,7 +1417,7 @@ child_prop_changed_cb (GObject * child, GParamSpec * arg
|
||||||
data->arg = g_param_spec_ref (arg);
|
data->arg = g_param_spec_ref (arg);
|
||||||
data->self = gst_object_ref (self);
|
data->self = gst_object_ref (self);
|
||||||
|
|
||||||
g_idle_add ((GSourceFunc) emit_deep_notify_in_idle, data);
|
ges_idle_add ((GSourceFunc) emit_deep_notify_in_idle, data, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
|
|
|
@ -166,6 +166,19 @@ ges_get_compositor_factory (void)
|
||||||
return compositor_factory;
|
return compositor_factory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ges_idle_add (GSourceFunc func, gpointer udata, GDestroyNotify notify)
|
||||||
|
{
|
||||||
|
GMainContext *context = g_main_context_get_thread_default ();
|
||||||
|
GSource *source = g_idle_source_new ();
|
||||||
|
if (!context)
|
||||||
|
context = g_main_context_default ();
|
||||||
|
|
||||||
|
g_source_set_callback (source, func, udata, notify);
|
||||||
|
g_source_attach (source, context);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
ges_nle_composition_add_object (GstElement * comp, GstElement * object)
|
ges_nle_composition_add_object (GstElement * comp, GstElement * object)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue