tests: nle: Set sync=FALSE on sinks

A significant portion of the NLE test suite was often timing out due to
the tests taking way longer than necessary because the sinks were
synchronizing to the clock, which is the default behavior for
fakevideosink and fakeaudiosink.

Notable was the case of nleoperation.c:test_pyramid_operations, that ran
through a 10 second stream twice. As the default timeout is 20 seconds,
this made the test flaky.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4914>
This commit is contained in:
Alicia Boya García 2023-06-21 16:24:12 +02:00 committed by GStreamer Marge Bot
parent 8081c22a73
commit 98fbbe7a53
7 changed files with 18 additions and 0 deletions

View file

@ -15,6 +15,7 @@ fill_pipeline_and_check (GstElement * comp, GList * segments,
pipeline = gst_pipeline_new ("test_pipeline");
sink = gst_element_factory_make_or_warn ("fakevideosink", "sink");
fail_if (sink == NULL);
g_object_set (sink, "sync", FALSE, NULL);
gst_bin_add_many (GST_BIN (pipeline), comp, sink, NULL);
@ -563,6 +564,7 @@ GST_START_TEST (test_renegotiation)
sink = gst_element_factory_make_or_warn ("fakeaudiosink", "sink");
g_object_set (sink, "sync", FALSE, NULL);
audioconvert = gst_element_factory_make_or_warn ("audioconvert", "aconv");
gst_bin_add_many (GST_BIN (pipeline), comp, audioconvert, sink, NULL);

View file

@ -54,6 +54,7 @@ GST_START_TEST (test_change_object_start_stop_in_current_stack)
gst_element_set_state (comp, GST_STATE_READY);
sink = gst_element_factory_make_or_warn ("fakevideosink", "sink");
g_object_set (sink, "sync", FALSE, NULL);
gst_bin_add_many (GST_BIN (pipeline), comp, sink, NULL);
gst_element_link (comp, sink);
@ -218,6 +219,7 @@ GST_START_TEST (test_remove_last_object)
gst_element_set_state (GST_ELEMENT (composition), GST_STATE_READY);
fakesink = gst_element_factory_make ("fakeaudiosink", NULL);
g_object_set (fakesink, "sync", FALSE, NULL);
gst_bin_add_many (GST_BIN (pipeline), GST_ELEMENT (composition), fakesink,
NULL);
gst_element_link (GST_ELEMENT (composition), fakesink);
@ -309,6 +311,7 @@ GST_START_TEST (test_dispose_on_commit)
composition = gst_element_factory_make ("nlecomposition", "composition");
pipeline = GST_ELEMENT (gst_pipeline_new (NULL));
fakesink = gst_element_factory_make ("fakevideosink", NULL);
g_object_set (fakesink, "sync", FALSE, NULL);
nlesource = gst_element_factory_make ("nlesource", "nlesource1");
audiotestsrc = gst_element_factory_make ("audiotestsrc", "audiotestsrc1");
@ -353,6 +356,7 @@ GST_START_TEST (test_simple_audiomixer)
composition = gst_element_factory_make ("nlecomposition", "composition");
gst_element_set_state (composition, GST_STATE_READY);
fakesink = gst_element_factory_make ("fakeaudiosink", NULL);
g_object_set (fakesink, "sync", FALSE, NULL);
/* nle_audiomixer */
nle_audiomixer = gst_element_factory_make ("nleoperation", "nle_audiomixer");
@ -483,6 +487,7 @@ GST_START_TEST (test_seek_on_nested)
gst_element_set_state (comp, GST_STATE_READY);
sink = gst_element_factory_make_or_warn ("fakevideosink", "sink");
g_object_set (sink, "sync", FALSE, NULL);
gst_bin_add_many (GST_BIN (pipeline), comp, sink, NULL);
gst_element_link (comp, sink);
@ -578,6 +583,7 @@ GST_START_TEST (test_error_in_nested_timeline)
gst_element_set_state (comp, GST_STATE_READY);
sink = gst_element_factory_make_or_warn ("fakevideosink", "sink");
g_object_set (sink, "sync", FALSE, NULL);
gst_bin_add_many (GST_BIN (pipeline), comp, sink, NULL);
gst_element_link (comp, sink);
@ -664,6 +670,7 @@ GST_START_TEST (test_nest_deep)
gst_element_set_state (comp, GST_STATE_READY);
sink = gst_element_factory_make_or_warn ("fakevideosink", "sink");
g_object_set (sink, "sync", FALSE, NULL);
gst_bin_add_many (GST_BIN (pipeline), comp, sink, NULL);
gst_element_link (comp, sink);

View file

@ -14,6 +14,7 @@ fill_pipeline_and_check (GstElement * comp, GList * segments)
pipeline = gst_pipeline_new ("test_pipeline");
sink = gst_element_factory_make_or_warn ("fakevideosink", "sink");
fail_if (sink == NULL);
g_object_set (sink, "sync", FALSE, NULL);
gst_bin_add_many (GST_BIN (pipeline), comp, sink, NULL);

View file

@ -26,6 +26,7 @@ GST_START_TEST (test_simple_videotestsrc)
sink = gst_element_factory_make_or_warn ("fakevideosink", "sink");
fail_if (sink == NULL);
g_object_set (sink, "sync", FALSE, NULL);
gst_bin_add_many (GST_BIN (pipeline), nlesource, sink, NULL);
@ -126,6 +127,7 @@ GST_START_TEST (test_videotestsrc_in_bin)
sink = gst_element_factory_make_or_warn ("fakevideosink", "sink");
fail_if (sink == NULL);
g_object_set (sink, "sync", FALSE, NULL);
gst_bin_add_many (GST_BIN (pipeline), nlesource, sink, NULL);

View file

@ -37,6 +37,7 @@ fill_pipeline_and_check (GstElement * comp, GList * segments, GList * seeks)
pipeline = gst_pipeline_new ("test_pipeline");
sink = gst_element_factory_make_or_warn ("fakevideosink", "sink");
fail_if (sink == NULL);
g_object_set (sink, "sync", FALSE, NULL);
gst_bin_add_many (GST_BIN (pipeline), comp, sink, NULL);

View file

@ -41,6 +41,7 @@ test_simplest_full (void)
sink = gst_element_factory_make_or_warn ("fakevideosink", "sink");
fail_if (sink == NULL);
g_object_set (sink, "sync", FALSE, NULL);
gst_bin_add_many (GST_BIN (pipeline), comp, sink, NULL);
@ -258,6 +259,7 @@ test_one_after_other_full (void)
sink = gst_element_factory_make_or_warn ("fakevideosink", "sink");
fail_if (sink == NULL);
g_object_set (sink, "sync", FALSE, NULL);
gst_bin_add_many (GST_BIN (pipeline), comp, sink, NULL);
@ -461,6 +463,7 @@ test_one_under_another_full (void)
sink = gst_element_factory_make_or_warn ("fakevideosink", "sink");
fail_if (sink == NULL);
g_object_set (sink, "sync", FALSE, NULL);
gst_bin_add_many (GST_BIN (pipeline), comp, sink, NULL);
@ -615,6 +618,7 @@ test_one_bin_after_other_full (void)
sink = gst_element_factory_make_or_warn ("fakevideosink", "sink");
fail_if (sink == NULL);
g_object_set (sink, "sync", FALSE, NULL);
gst_bin_add_many (GST_BIN (pipeline), comp, sink, NULL);

View file

@ -284,6 +284,7 @@ _setup_test (GstElement * pipeline, gdouble rate)
/* sink */
sink = gst_element_factory_make_or_warn ("fakeaudiosink", "sink");
g_object_set (sink, "sync", FALSE, NULL);
gst_bin_add_many (GST_BIN (pipeline), comp, sink, NULL);
gst_element_link (comp, sink);