summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStian Selnes <stian@pexip.com>2015-07-13 11:10:49 +0200
committerTim-Philipp Müller <tim@centricular.com>2015-07-16 16:18:08 +0100
commitfe6f694dbb7f64a37a7db7dd095da75a628645ca (patch)
treeb75e92ca50bfd13ff188785f6fc6788d0f2b46ff
parente066058facfe33b8e38493e7f5c2ef575c3e06b4 (diff)
harness: Forward sticky events to sink harness
Fixes issue where if a sink harness was added late the sticky events would not be forwared. https://bugzilla.gnome.org/show_bug.cgi?id=752494
-rw-r--r--libs/gst/check/gstharness.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libs/gst/check/gstharness.c b/libs/gst/check/gstharness.c
index 77d97c1a8..67f2a6f77 100644
--- a/libs/gst/check/gstharness.c
+++ b/libs/gst/check/gstharness.c
@@ -2074,6 +2074,14 @@ gst_harness_src_push_event (GstHarness * h)
return gst_harness_push_event (h, gst_harness_pull_event (h->src_harness));
}
+
+static gboolean
+forward_sticky_events (GstPad * pad, GstEvent ** ev, gpointer user_data)
+{
+ GstHarness * h = user_data;
+ return gst_pad_push_event (h->priv->sink_forward_pad, gst_event_ref (*ev));
+}
+
/**
* gst_harness_add_sink:
* @h: a #GstHarness
@@ -2103,6 +2111,7 @@ gst_harness_add_sink (GstHarness * h, const gchar * sink_element_name)
}
h->sink_harness = gst_harness_new (sink_element_name);
priv->sink_forward_pad = gst_object_ref (h->sink_harness->srcpad);
+ gst_pad_sticky_events_foreach (h->sinkpad, forward_sticky_events, h);
}
/**
@@ -2128,6 +2137,7 @@ gst_harness_add_sink_parse (GstHarness * h, const gchar * launchline)
}
h->sink_harness = gst_harness_new_parse (launchline);
priv->sink_forward_pad = gst_object_ref (h->sink_harness->srcpad);
+ gst_pad_sticky_events_foreach (h->sinkpad, forward_sticky_events, h);
}
/**