mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
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>
This commit is contained in:
parent
f34be8a3bd
commit
cc556452ce
1 changed files with 8 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue