summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2021-04-14 19:46:56 -0400
committerOlivier CrĂȘte <olivier.crete@collabora.com>2021-05-13 15:05:00 -0400
commitcc556452cee436458e0cb2b8fbd432cc059f9e74 (patch)
tree7948385e6a4cc37cd0e9766d5245f80c4b2360d8 /tests
parentf34be8a3bd94b44e6a084bf55f325152ab5ee04d (diff)
downloadgstreamer-plugins-bad-cc556452cee436458e0cb2b8fbd432cc059f9e74.tar.gz
webrtc test: Add explicit test clock
This way the test clock is not linked to the multiple harnesses Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2183>
Diffstat (limited to 'tests')
-rw-r--r--tests/check/elements/webrtcbin.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/check/elements/webrtcbin.c b/tests/check/elements/webrtcbin.c
index 2f6747f20..a883fee74 100644
--- a/tests/check/elements/webrtcbin.c
+++ b/tests/check/elements/webrtcbin.c
@@ -62,6 +62,7 @@ struct test_webrtc;
struct test_webrtc
{
GList *harnesses;
+ GstTestClock *test_clock;
GThread *thread;
GMainLoop *loop;
GstBus *bus1;
@@ -538,6 +539,8 @@ test_webrtc_new (void)
g_mutex_init (&ret->lock);
g_cond_init (&ret->cond);
+ ret->test_clock = GST_TEST_CLOCK (gst_test_clock_new ());
+
ret->thread = g_thread_new ("test-webrtc", (GThreadFunc) _bus_thread, ret);
g_mutex_lock (&ret->lock);
@@ -553,6 +556,9 @@ test_webrtc_new (void)
ret->webrtc2 = gst_element_factory_make ("webrtcbin", NULL);
fail_unless (ret->webrtc1 != NULL && ret->webrtc2 != NULL);
+ gst_element_set_clock (ret->webrtc1, GST_CLOCK (ret->test_clock));
+ gst_element_set_clock (ret->webrtc2, GST_CLOCK (ret->test_clock));
+
gst_element_set_bus (ret->webrtc1, ret->bus1);
gst_element_set_bus (ret->webrtc2, ret->bus2);
@@ -617,6 +623,8 @@ test_webrtc_free (struct test_webrtc *t)
g_thread_join (t->thread);
+ g_object_unref (t->test_clock);
+
gst_bus_remove_watch (t->bus1);
gst_bus_remove_watch (t->bus2);