From 874370d0ab8fbe1173cde0d154cbeee08f7791ba Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Wed, 5 Jul 2023 14:23:50 -0400 Subject: [PATCH] nle: composition: Avoid running query before being constructed `gst_pad_create_stream_id` runs a URI query on the element which triggers traces for not constructed objects which fails in rust tracers as object should have names in all traces. Part-of: --- .../plugins/nle/nlecomposition.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-editing-services/plugins/nle/nlecomposition.c b/subprojects/gst-editing-services/plugins/nle/nlecomposition.c index b3541ac574..c1f7577a97 100644 --- a/subprojects/gst-editing-services/plugins/nle/nlecomposition.c +++ b/subprojects/gst-editing-services/plugins/nle/nlecomposition.c @@ -1079,6 +1079,17 @@ nle_composition_set_property (GObject * object, guint property_id, } } +static void +nle_composition_constructed (GObject * obj) +{ + NleCompositionPrivate *priv = NLE_COMPOSITION (obj)->priv; + + priv->id = gst_pad_create_stream_id (NLE_OBJECT_SRC (obj), + GST_ELEMENT (obj), NULL); + + ((GObjectClass *) parent_class)->constructed (obj); +} + static void nle_composition_class_init (NleCompositionClass * klass) { @@ -1098,6 +1109,8 @@ nle_composition_class_init (NleCompositionClass * klass) " Mathieu Duponchelle ," " Thibault Saunier "); + + gobject_class->constructed = GST_DEBUG_FUNCPTR (nle_composition_constructed); gobject_class->dispose = GST_DEBUG_FUNCPTR (nle_composition_dispose); gobject_class->finalize = GST_DEBUG_FUNCPTR (nle_composition_finalize); gobject_class->get_property = @@ -1195,8 +1208,6 @@ nle_composition_init (NleComposition * comp) nle_composition_reset (comp); - priv->id = gst_pad_create_stream_id (NLE_OBJECT_SRC (comp), - GST_ELEMENT (comp), NULL); priv->drop_tags = DEFAULT_DROP_TAGS; priv->nle_event_pad_func = GST_PAD_EVENTFUNC (NLE_OBJECT_SRC (comp)); gst_pad_set_event_function (NLE_OBJECT_SRC (comp),