mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-06 07:28:53 +00:00
childproxy: include the child name in the signal
This commit is contained in:
parent
d93c5c5fd0
commit
e7b9b68361
3 changed files with 22 additions and 12 deletions
10
gst/gstbin.c
10
gst/gstbin.c
|
@ -1160,10 +1160,11 @@ no_state_recalc:
|
||||||
|
|
||||||
GST_CAT_DEBUG_OBJECT (GST_CAT_PARENTAGE, bin, "added element \"%s\"",
|
GST_CAT_DEBUG_OBJECT (GST_CAT_PARENTAGE, bin, "added element \"%s\"",
|
||||||
elem_name);
|
elem_name);
|
||||||
g_free (elem_name);
|
|
||||||
|
|
||||||
g_signal_emit (bin, gst_bin_signals[ELEMENT_ADDED], 0, element);
|
g_signal_emit (bin, gst_bin_signals[ELEMENT_ADDED], 0, element);
|
||||||
gst_child_proxy_child_added ((GObject *) bin, (GObject *) element);
|
gst_child_proxy_child_added ((GObject *) bin, (GObject *) element, elem_name);
|
||||||
|
|
||||||
|
g_free (elem_name);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
@ -1480,7 +1481,6 @@ no_state_recalc:
|
||||||
|
|
||||||
GST_CAT_INFO_OBJECT (GST_CAT_PARENTAGE, bin, "removed child \"%s\"",
|
GST_CAT_INFO_OBJECT (GST_CAT_PARENTAGE, bin, "removed child \"%s\"",
|
||||||
elem_name);
|
elem_name);
|
||||||
g_free (elem_name);
|
|
||||||
|
|
||||||
gst_element_set_bus (element, NULL);
|
gst_element_set_bus (element, NULL);
|
||||||
|
|
||||||
|
@ -1497,8 +1497,10 @@ no_state_recalc:
|
||||||
GST_OBJECT_UNLOCK (element);
|
GST_OBJECT_UNLOCK (element);
|
||||||
|
|
||||||
g_signal_emit (bin, gst_bin_signals[ELEMENT_REMOVED], 0, element);
|
g_signal_emit (bin, gst_bin_signals[ELEMENT_REMOVED], 0, element);
|
||||||
gst_child_proxy_child_removed ((GObject *) bin, (GObject *) element);
|
gst_child_proxy_child_removed ((GObject *) bin, (GObject *) element,
|
||||||
|
elem_name);
|
||||||
|
|
||||||
|
g_free (elem_name);
|
||||||
/* element is really out of our control now */
|
/* element is really out of our control now */
|
||||||
gst_object_unref (element);
|
gst_object_unref (element);
|
||||||
|
|
||||||
|
|
|
@ -452,26 +452,30 @@ gst_child_proxy_set (GObject * object, const gchar * first_property_name, ...)
|
||||||
* gst_child_proxy_child_added:
|
* gst_child_proxy_child_added:
|
||||||
* @object: the parent object
|
* @object: the parent object
|
||||||
* @child: the newly added child
|
* @child: the newly added child
|
||||||
|
* @name: the name of the new child
|
||||||
*
|
*
|
||||||
* Emits the "child-added" signal.
|
* Emits the "child-added" signal.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
gst_child_proxy_child_added (GObject * object, GObject * child)
|
gst_child_proxy_child_added (GObject * object, GObject * child,
|
||||||
|
const gchar * name)
|
||||||
{
|
{
|
||||||
g_signal_emit (G_OBJECT (object), signals[CHILD_ADDED], 0, child);
|
g_signal_emit (G_OBJECT (object), signals[CHILD_ADDED], 0, child, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_child_proxy_child_removed:
|
* gst_child_proxy_child_removed:
|
||||||
* @object: the parent object
|
* @object: the parent object
|
||||||
* @child: the removed child
|
* @child: the removed child
|
||||||
|
* @name: the name of the old child
|
||||||
*
|
*
|
||||||
* Emits the "child-removed" signal.
|
* Emits the "child-removed" signal.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
gst_child_proxy_child_removed (GObject * object, GObject * child)
|
gst_child_proxy_child_removed (GObject * object, GObject * child,
|
||||||
|
const gchar * name)
|
||||||
{
|
{
|
||||||
g_signal_emit (G_OBJECT (object), signals[CHILD_REMOVED], 0, child);
|
g_signal_emit (G_OBJECT (object), signals[CHILD_REMOVED], 0, child, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* gobject methods */
|
/* gobject methods */
|
||||||
|
@ -495,6 +499,7 @@ gst_child_proxy_base_init (gpointer g_class)
|
||||||
* GstChildProxy::child-added:
|
* GstChildProxy::child-added:
|
||||||
* @child_proxy: the #GstChildProxy
|
* @child_proxy: the #GstChildProxy
|
||||||
* @object: the #GObject that was added
|
* @object: the #GObject that was added
|
||||||
|
* @name: the name of the new child
|
||||||
*
|
*
|
||||||
* Will be emitted after the @object was added to the @child_proxy.
|
* Will be emitted after the @object was added to the @child_proxy.
|
||||||
*/
|
*/
|
||||||
|
@ -502,12 +507,13 @@ gst_child_proxy_base_init (gpointer g_class)
|
||||||
g_signal_new ("child-added", G_TYPE_FROM_CLASS (g_class),
|
g_signal_new ("child-added", G_TYPE_FROM_CLASS (g_class),
|
||||||
G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GstChildProxyInterface,
|
G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GstChildProxyInterface,
|
||||||
child_added), NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE,
|
child_added), NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE,
|
||||||
1, G_TYPE_OBJECT);
|
2, G_TYPE_OBJECT, G_TYPE_STRING);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GstChildProxy::child-removed:
|
* GstChildProxy::child-removed:
|
||||||
* @child_proxy: the #GstChildProxy
|
* @child_proxy: the #GstChildProxy
|
||||||
* @object: the #GObject that was removed
|
* @object: the #GObject that was removed
|
||||||
|
* @name: the name of the old child
|
||||||
*
|
*
|
||||||
* Will be emitted after the @object was removed from the @child_proxy.
|
* Will be emitted after the @object was removed from the @child_proxy.
|
||||||
*/
|
*/
|
||||||
|
@ -515,7 +521,7 @@ gst_child_proxy_base_init (gpointer g_class)
|
||||||
g_signal_new ("child-removed", G_TYPE_FROM_CLASS (g_class),
|
g_signal_new ("child-removed", G_TYPE_FROM_CLASS (g_class),
|
||||||
G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GstChildProxyInterface,
|
G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GstChildProxyInterface,
|
||||||
child_removed), NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE,
|
child_removed), NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE,
|
||||||
1, G_TYPE_OBJECT);
|
2, G_TYPE_OBJECT, G_TYPE_STRING);
|
||||||
|
|
||||||
initialized = TRUE;
|
initialized = TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,8 +95,10 @@ void gst_child_proxy_set (GObject * object,
|
||||||
const gchar * first_property_name,
|
const gchar * first_property_name,
|
||||||
...) G_GNUC_NULL_TERMINATED;
|
...) G_GNUC_NULL_TERMINATED;
|
||||||
|
|
||||||
void gst_child_proxy_child_added (GObject * object, GObject * child);
|
void gst_child_proxy_child_added (GObject * object, GObject * child,
|
||||||
void gst_child_proxy_child_removed (GObject * object, GObject * child);
|
const gchar *name);
|
||||||
|
void gst_child_proxy_child_removed (GObject * object, GObject * child,
|
||||||
|
const gchar *name);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue