smartmixer: Give a unique name to each compositor instances
authorThibault Saunier <thibault.saunier@osg.samsung.com>
Thu, 10 Aug 2017 19:05:09 +0000 (15:05 -0400)
committerThibault Saunier <thibault.saunier@osg.samsung.com>
Fri, 11 Aug 2017 01:40:37 +0000 (21:40 -0400)
ges/ges-smart-video-mixer.c
plugins/nle/nlecomposition.c

index b28e1a4eb784b668a858cff1465b8a54485b108e..c2d9f2e451fa7eb53bfcff436ec1bfdd06169a9a 100644 (file)
@@ -228,6 +228,28 @@ ges_smart_mixer_finalize (GObject * object)
   G_OBJECT_CLASS (ges_smart_mixer_parent_class)->finalize (object);
 }
 
+static void
+ges_smart_mixer_constructed (GObject * obj)
+{
+  GstPad *pad;
+
+  GESSmartMixer *self = GES_SMART_MIXER (obj);
+  gchar *cname = g_strdup_printf ("%s-compositor", GST_OBJECT_NAME (self));
+
+  self->mixer =
+      gst_element_factory_create (ges_get_compositor_factory (), cname);
+  g_free (cname);
+  g_object_set (self->mixer, "background", 1, NULL);
+  gst_bin_add (GST_BIN (self), self->mixer);
+
+  pad = gst_element_get_static_pad (self->mixer, "src");
+  self->srcpad = gst_ghost_pad_new ("src", pad);
+  gst_pad_set_active (self->srcpad, TRUE);
+  gst_object_unref (pad);
+  gst_element_add_pad (GST_ELEMENT (self), self->srcpad);
+}
+
+
 static void
 ges_smart_mixer_class_init (GESSmartMixerClass * klass)
 {
@@ -249,25 +271,13 @@ ges_smart_mixer_class_init (GESSmartMixerClass * klass)
 
   object_class->dispose = ges_smart_mixer_dispose;
   object_class->finalize = ges_smart_mixer_finalize;
+  object_class->constructed = ges_smart_mixer_constructed;
 }
 
 static void
 ges_smart_mixer_init (GESSmartMixer * self)
 {
-  GstPad *pad;
   g_mutex_init (&self->lock);
-
-  self->mixer = gst_element_factory_create (ges_get_compositor_factory (),
-      "smart-mixer-mixer");
-  g_object_set (self->mixer, "background", 1, NULL);
-  gst_bin_add (GST_BIN (self), self->mixer);
-
-  pad = gst_element_get_static_pad (self->mixer, "src");
-  self->srcpad = gst_ghost_pad_new ("src", pad);
-  gst_pad_set_active (self->srcpad, TRUE);
-  gst_object_unref (pad);
-  gst_element_add_pad (GST_ELEMENT (self), self->srcpad);
-
   self->pads_infos = g_hash_table_new_full (g_direct_hash, g_direct_equal,
       NULL, (GDestroyNotify) destroy_pad);
 }
index b042f2caf82a77d6439fe4aeac960011c3c03086..cf833139378090c6d8cf74d457b6166868cebcac 100644 (file)
@@ -2745,7 +2745,7 @@ _deactivate_stack (NleComposition * comp, gboolean flush_downstream)
 {
   GstPad *ptarget;
 
-  GST_INFO_OBJECT (comp, "Deactivating current stack (flushing downstream: %d",
+  GST_INFO_OBJECT (comp, "Deactivating current stack (flushing downstream: %d)",
       flush_downstream);
   _set_current_bin_to_ready (comp, flush_downstream);