ges: pipeline: Avoid setting state before being constructed
authorThibault Saunier <tsaunier@igalia.com>
Wed, 5 Jul 2023 18:22:59 +0000 (14:22 -0400)
committerTim-Philipp Müller <tim@centricular.com>
Mon, 10 Jul 2023 18:00:49 +0000 (19:00 +0100)
It means setting state which triggers traces for not constructed objects
which fails in rust tracers as object should have names in all traces.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4984>

subprojects/gst-editing-services/ges/ges-pipeline.c

index f68a474..50987b0 100644 (file)
@@ -255,6 +255,16 @@ _timeline_track_removed_cb (GESTimeline * timeline, GESTrack * track,
 }
 
 static void
+ges_pipeline_constructed (GObject * object)
+{
+  GESPipeline *self = GES_PIPELINE (object);
+
+  ges_pipeline_set_mode (self, DEFAULT_TIMELINE_MODE);
+
+  ((GObjectClass *) ges_pipeline_parent_class)->constructed (object);
+}
+
+static void
 ges_pipeline_dispose (GObject * object)
 {
   GESPipeline *self = GES_PIPELINE (object);
@@ -301,6 +311,8 @@ ges_pipeline_class_init (GESPipelineClass * klass)
   GST_DEBUG_CATEGORY_INIT (ges_pipeline_debug, "gespipeline",
       GST_DEBUG_FG_YELLOW, "ges pipeline");
 
+
+  object_class->constructed = ges_pipeline_constructed;
   object_class->dispose = ges_pipeline_dispose;
   object_class->get_property = ges_pipeline_get_property;
   object_class->set_property = ges_pipeline_set_property;
@@ -405,8 +417,6 @@ ges_pipeline_init (GESPipeline * self)
   if (G_UNLIKELY (self->priv->encodebin == NULL))
     goto no_encodebin;
 
-  ges_pipeline_set_mode (self, DEFAULT_TIMELINE_MODE);
-
   return;
 
 no_playsink: