Commit 5847c6e5 authored by Thibault Saunier's avatar Thibault Saunier 🌵

ges: Implement our own idle_add which uses the thread local maincontext

parent 35096e4d
......@@ -283,7 +283,7 @@ _load_from_uri (GESFormatter * self, GESTimeline * timeline, const gchar * uri,
return FALSE;
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;
}
......
......@@ -351,6 +351,9 @@ G_GNUC_INTERNAL gint element_end_compare (GESTimelineElement *
G_GNUC_INTERNAL GstElementFactory *
ges_get_compositor_factory (void);
G_GNUC_INTERNAL void
ges_idle_add (GSourceFunc func, gpointer udata, GDestroyNotify notify);
/****************************************************
* GESContainer *
......
......@@ -224,7 +224,7 @@ _load_project (GESProject * project, GESTimeline * timeline, GError ** error)
data->project = gst_object_ref (project);
/* 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;
}
}
......
......@@ -1417,7 +1417,7 @@ child_prop_changed_cb (GObject * child, GParamSpec * arg
data->arg = g_param_spec_ref (arg);
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
......
......@@ -166,6 +166,19 @@ ges_get_compositor_factory (void)
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
ges_nle_composition_add_object (GstElement * comp, GstElement * object)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment