summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <thibault.saunier@collabora.com>2013-05-16 00:16:18 -0400
committerThibault Saunier <thibault.saunier@collabora.com>2013-05-16 00:22:39 -0400
commitf5601d9749c9c49b142d747cb9736373232ec14e (patch)
tree6ac4160fe00ef9eaa6fa33046cfde8f6011161f3
parent3627065c8ec01fa744bec3187423344c2179fac3 (diff)
gnlcomposition: Only send stream-start once and for each source start
We concider the output of a gnlcomposition as 1 coherente stream.
-rw-r--r--gnl/gnlcomposition.c13
1 files changed, 12 insertions, 1 deletions
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;