mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
harness: always set our test-clock on the harnessed element
The integration is already so tight, there is no reason to not further formalize it! https://bugzilla.gnome.org/show_bug.cgi?id=761914
This commit is contained in:
parent
aafa79e281
commit
69f5d28718
1 changed files with 13 additions and 10 deletions
|
@ -691,11 +691,13 @@ gst_harness_add_element_full (GstHarness * h, GstElement * element,
|
||||||
GstStaticPadTemplate * hsrc, const gchar * element_sinkpad_name,
|
GstStaticPadTemplate * hsrc, const gchar * element_sinkpad_name,
|
||||||
GstStaticPadTemplate * hsink, const gchar * element_srcpad_name)
|
GstStaticPadTemplate * hsink, const gchar * element_srcpad_name)
|
||||||
{
|
{
|
||||||
|
GstClock * element_clock;
|
||||||
gboolean has_sinkpad, has_srcpad;
|
gboolean has_sinkpad, has_srcpad;
|
||||||
|
|
||||||
g_return_if_fail (element != NULL);
|
g_return_if_fail (element != NULL);
|
||||||
g_return_if_fail (h->element == NULL);
|
g_return_if_fail (h->element == NULL);
|
||||||
|
|
||||||
|
element_clock = GST_ELEMENT_CLOCK (element);
|
||||||
h->element = gst_object_ref (element);
|
h->element = gst_object_ref (element);
|
||||||
check_element_type (element, &has_sinkpad, &has_srcpad);
|
check_element_type (element, &has_sinkpad, &has_srcpad);
|
||||||
|
|
||||||
|
@ -721,17 +723,21 @@ gst_harness_add_element_full (GstHarness * h, GstElement * element,
|
||||||
g_free (stream_id);
|
g_free (stream_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* if the element already has a testclock attached,
|
||||||
|
we replace our own with it, if no clock we attach the testclock */
|
||||||
|
if (element_clock) {
|
||||||
|
if (GST_IS_TEST_CLOCK (element_clock)) {
|
||||||
|
gst_object_replace ((GstObject **) & h->priv->testclock,
|
||||||
|
(GstObject *) GST_ELEMENT_CLOCK (element));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
gst_harness_use_testclock (h);
|
||||||
|
}
|
||||||
|
|
||||||
/* don't start sources, they start producing data! */
|
/* don't start sources, they start producing data! */
|
||||||
if (has_sinkpad)
|
if (has_sinkpad)
|
||||||
gst_harness_play (h);
|
gst_harness_play (h);
|
||||||
|
|
||||||
/* if the element already has a testclock attached, we replace our own with it */
|
|
||||||
if (GST_ELEMENT_CLOCK (element)
|
|
||||||
&& GST_IS_TEST_CLOCK (GST_ELEMENT_CLOCK (element))) {
|
|
||||||
gst_object_replace ((GstObject **) & h->priv->testclock,
|
|
||||||
(GstObject *) GST_ELEMENT_CLOCK (element));
|
|
||||||
}
|
|
||||||
|
|
||||||
gst_harness_element_ref (h);
|
gst_harness_element_ref (h);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (h, "added element to harness %p "
|
GST_DEBUG_OBJECT (h, "added element to harness %p "
|
||||||
|
@ -2101,9 +2107,7 @@ gst_harness_add_src_harness (GstHarness * h,
|
||||||
if (h->src_harness)
|
if (h->src_harness)
|
||||||
gst_harness_teardown (h->src_harness);
|
gst_harness_teardown (h->src_harness);
|
||||||
h->src_harness = src_harness;
|
h->src_harness = src_harness;
|
||||||
|
|
||||||
gst_harness_set_forward_pad (h->src_harness, h->srcpad);
|
gst_harness_set_forward_pad (h->src_harness, h->srcpad);
|
||||||
gst_harness_use_testclock (h->src_harness);
|
|
||||||
h->src_harness->priv->has_clock_wait = has_clock_wait;
|
h->src_harness->priv->has_clock_wait = has_clock_wait;
|
||||||
gst_harness_set_forwarding (h->src_harness, h->priv->forwarding);
|
gst_harness_set_forwarding (h->src_harness, h->priv->forwarding);
|
||||||
}
|
}
|
||||||
|
@ -2296,7 +2300,6 @@ gst_harness_add_sink_harness (GstHarness * h, GstHarness * sink_harness)
|
||||||
}
|
}
|
||||||
h->sink_harness = sink_harness;
|
h->sink_harness = sink_harness;
|
||||||
gst_harness_set_forward_pad (h, h->sink_harness->srcpad);
|
gst_harness_set_forward_pad (h, h->sink_harness->srcpad);
|
||||||
gst_harness_use_testclock (h->sink_harness);
|
|
||||||
if (priv->forwarding && h->sinkpad)
|
if (priv->forwarding && h->sinkpad)
|
||||||
gst_pad_sticky_events_foreach (h->sinkpad, forward_sticky_events, h);
|
gst_pad_sticky_events_foreach (h->sinkpad, forward_sticky_events, h);
|
||||||
gst_harness_set_forwarding (h->sink_harness, priv->forwarding);
|
gst_harness_set_forwarding (h->sink_harness, priv->forwarding);
|
||||||
|
|
Loading…
Reference in a new issue