mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-30 11:08:34 +00:00
"deep-notify" signal gets emitted only from the main thread
https://bugzilla.gnome.org/show_bug.cgi?id=784414
This commit is contained in:
parent
50865a4f37
commit
e9794d2bf2
1 changed files with 38 additions and 2 deletions
|
@ -100,6 +100,13 @@ struct _GESTimelineElementPrivate
|
||||||
GESTimelineElement *copied_from;
|
GESTimelineElement *copied_from;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
GObject *child;
|
||||||
|
GParamSpec *arg;
|
||||||
|
GESTimelineElement *self;
|
||||||
|
} EmitDeepNotifyInIdleData;
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
_lookup_child (GESTimelineElement * self, const gchar * prop_name,
|
_lookup_child (GESTimelineElement * self, const gchar * prop_name,
|
||||||
GObject ** child, GParamSpec ** pspec)
|
GObject ** child, GParamSpec ** pspec)
|
||||||
|
@ -1268,12 +1275,41 @@ had_timeline:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
emit_deep_notify_in_idle (EmitDeepNotifyInIdleData * data)
|
||||||
|
{
|
||||||
|
g_signal_emit (data->self, ges_timeline_element_signals[DEEP_NOTIFY], 0,
|
||||||
|
data->child, data->arg);
|
||||||
|
|
||||||
|
gst_object_unref (data->child);
|
||||||
|
g_param_spec_unref (data->arg);
|
||||||
|
gst_object_unref (data->self);
|
||||||
|
g_slice_free (EmitDeepNotifyInIdleData, data);
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
child_prop_changed_cb (GObject * child, GParamSpec * arg
|
child_prop_changed_cb (GObject * child, GParamSpec * arg
|
||||||
G_GNUC_UNUSED, GESTimelineElement * self)
|
G_GNUC_UNUSED, GESTimelineElement * self)
|
||||||
{
|
{
|
||||||
g_signal_emit (self, ges_timeline_element_signals[DEEP_NOTIFY], 0,
|
EmitDeepNotifyInIdleData *data;
|
||||||
child, arg);
|
|
||||||
|
/* Emit "deep-notify" right away if in main thread */
|
||||||
|
if (g_main_context_acquire (g_main_context_default ())) {
|
||||||
|
g_main_context_release (g_main_context_default ());
|
||||||
|
g_signal_emit (self, ges_timeline_element_signals[DEEP_NOTIFY], 0,
|
||||||
|
child, arg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
data = g_slice_new (EmitDeepNotifyInIdleData);
|
||||||
|
|
||||||
|
data->child = gst_object_ref (child);
|
||||||
|
data->arg = g_param_spec_ref (arg);
|
||||||
|
data->self = gst_object_ref (self);
|
||||||
|
|
||||||
|
g_idle_add ((GSourceFunc) emit_deep_notify_in_idle, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
|
|
Loading…
Reference in a new issue