summaryrefslogtreecommitdiff
path: root/gnl/gnlcomposition.c
diff options
context:
space:
mode:
authorMathieu Duponchelle <mathieu.duponchelle@epitech.eu>2013-05-29 16:55:34 +0200
committerSebastian Dröge <slomo@circular-chaos.org>2013-06-11 21:53:56 +0200
commitcb1818f086dd4772ef6344193831aba8273b8215 (patch)
tree15daa893ee1db7ef27fd38f300f783827b9a0d1d /gnl/gnlcomposition.c
parent8153731bee539183597145ada7ba1157a546ad4b (diff)
gnlcomposition: forward non time-resetting flush stops outside the composition,
except those consecutive to a seek event. The 'reset-time' parameter has been added in 1.0, and we need it to be FALSE outside the composition. Related to https://bugzilla.gnome.org/show_bug.cgi?id=701146
Diffstat (limited to 'gnl/gnlcomposition.c')
-rw-r--r--gnl/gnlcomposition.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/gnl/gnlcomposition.c b/gnl/gnlcomposition.c
index b04f3e1..88e600f 100644
--- a/gnl/gnlcomposition.c
+++ b/gnl/gnlcomposition.c
@@ -145,6 +145,8 @@ struct _GnlCompositionPrivate
GCond update_pipeline_cond;
GMutex update_pipeline_mutex;
+ gboolean reset_time;
+
gboolean running;
};
@@ -377,6 +379,8 @@ gnl_composition_init (GnlComposition * comp)
priv->waitingpads = 0;
+ priv->reset_time = FALSE;
+
priv->objects_hash = g_hash_table_new_full
(g_direct_hash,
g_direct_equal, NULL, (GDestroyNotify) hash_value_destroy);
@@ -631,6 +635,8 @@ gnl_composition_reset (GnlComposition * comp)
COMP_FLUSHING_UNLOCK (comp);
+ priv->reset_time = FALSE;
+
priv->update_required = FALSE;
priv->send_stream_start = TRUE;
@@ -649,6 +655,14 @@ 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_FLUSH_STOP:
+ GST_DEBUG_OBJECT (comp,
+ "replacing flush stop event with a flush stop event with 'reset_time' = %d",
+ priv->reset_time);
+ GST_PAD_PROBE_INFO_DATA (info) =
+ gst_event_new_flush_stop (priv->reset_time);
+ gst_event_unref (event);
+ break;
case GST_EVENT_STREAM_START:
if (g_atomic_int_compare_and_exchange (&priv->send_stream_start, TRUE,
FALSE)) {
@@ -1061,6 +1075,7 @@ gnl_composition_event_handler (GstPad * ghostpad, GstObject * parent,
COMP_OBJECTS_UNLOCK (comp);
gst_event_unref (event);
event = nevent;
+ priv->reset_time = TRUE;
break;
}
case GST_EVENT_QOS:
@@ -1150,6 +1165,7 @@ gnl_composition_event_handler (GstPad * ghostpad, GstObject * parent,
if (priv->waitingpads == 0) {
GST_DEBUG_OBJECT (comp, "About to call gnl_event_pad_func()");
res = priv->gnl_event_pad_func (priv->ghostpad, parent, event);
+ priv->reset_time = FALSE;
GST_DEBUG_OBJECT (comp, "Done calling gnl_event_pad_func() %d", res);
} else
gst_event_unref (event);
@@ -1265,7 +1281,8 @@ gnl_composition_ghost_pad_set_target (GnlComposition * comp, GstPad * target,
if (target && (priv->ghosteventprobe == 0)) {
priv->ghosteventprobe =
- gst_pad_add_probe (target, GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM,
+ gst_pad_add_probe (target,
+ GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM | GST_PAD_PROBE_TYPE_EVENT_FLUSH,
(GstPadProbeCallback) ghost_event_probe_handler, comp, NULL);
GST_DEBUG_OBJECT (comp, "added event probe %lu", priv->ghosteventprobe);
}