From f5601d9749c9c49b142d747cb9736373232ec14e Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Thu, 16 May 2013 00:16:18 -0400 Subject: gnlcomposition: Only send stream-start once and for each source start We concider the output of a gnlcomposition as 1 coherente stream. --- gnl/gnlcomposition.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gnl/gnlcomposition.c b/gnl/gnlcomposition.c index 3a73b63..7107e7f 100644 --- a/gnl/gnlcomposition.c +++ b/gnl/gnlcomposition.c @@ -144,7 +144,7 @@ struct _GnlCompositionPrivate We are called before gnl_object_sync_handler */ GstPadEventFunction gnl_event_pad_func; - + gboolean send_stream_start; }; static GParamSpec *gnlobject_properties[GNLOBJECT_PROP_LAST]; @@ -619,6 +619,7 @@ gnl_composition_reset (GnlComposition * comp) COMP_FLUSHING_UNLOCK (comp); priv->update_required = FALSE; + priv->send_stream_start = TRUE; GST_DEBUG_OBJECT (comp, "Composition now resetted"); } @@ -684,6 +685,16 @@ ghost_event_probe_handler (GstPad * ghostpad G_GNUC_UNUSED, GST_DEBUG_OBJECT (comp, "event: %s", GST_EVENT_TYPE_NAME (event)); switch (GST_EVENT_TYPE (event)) { + case GST_EVENT_STREAM_START: + if (g_atomic_int_compare_and_exchange (&priv->send_stream_start, TRUE, + FALSE)) { + /* FIXME: Do we want to create a new stream ID here? */ + GST_DEBUG_OBJECT (comp, "forward stream-start %p", event); + } else { + GST_DEBUG_OBJECT (comp, "droping stream-start %p", event); + retval = GST_PAD_PROBE_DROP; + } + break; case GST_EVENT_SEGMENT: { guint64 rstart, rstop; -- cgit v1.2.3