diff options
author | Olivier CrĂȘte <olivier.crete@collabora.com> | 2021-04-21 15:55:00 -0400 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2021-05-13 15:05:00 -0400 |
commit | 6a3a62abaeb756fb104f41c2635a79880e81d322 (patch) | |
tree | 59e7b9e7509a97dd870cf81f356b953103ee3d32 /tests | |
parent | 4c3270409d956793fa3c85f11a4fffacbc6f3176 (diff) | |
download | gstreamer-plugins-bad-6a3a62abaeb756fb104f41c2635a79880e81d322.tar.gz |
webrtcbin tests: Use properties to access the inside of the transceiver object
This will allow hiding the insides from unsafe application access.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2183>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/check/elements/webrtcbin.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/tests/check/elements/webrtcbin.c b/tests/check/elements/webrtcbin.c index 03a667111..942f0b29c 100644 --- a/tests/check/elements/webrtcbin.c +++ b/tests/check/elements/webrtcbin.c @@ -1569,14 +1569,15 @@ GST_END_TEST; GST_START_TEST (test_add_transceiver) { struct test_webrtc *t = test_webrtc_new (); - GstWebRTCRTPTransceiverDirection direction; + GstWebRTCRTPTransceiverDirection direction, trans_direction; GstWebRTCRTPTransceiver *trans; direction = GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDRECV; g_signal_emit_by_name (t->webrtc1, "add-transceiver", direction, NULL, &trans); fail_unless (trans != NULL); - fail_unless_equals_int (direction, trans->direction); + g_object_get (trans, "direction", &trans_direction, NULL); + fail_unless_equals_int (direction, trans_direction); gst_object_unref (trans); @@ -1707,7 +1708,8 @@ GST_START_TEST (test_recvonly_sendonly) fail_unless (transceivers != NULL); fail_unless_equals_int (transceivers->len, 2); trans = g_array_index (transceivers, GstWebRTCRTPTransceiver *, 1); - trans->direction = GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDONLY; + g_object_set (trans, "direction", + GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDONLY, NULL); g_array_unref (transceivers); @@ -2778,6 +2780,7 @@ GST_START_TEST (test_dual_audio) GstHarness *h; GstWebRTCRTPTransceiver *trans; GArray *transceivers; + guint mline; /* test that each mline gets a unique transceiver even with the same caps */ @@ -2798,11 +2801,13 @@ GST_START_TEST (test_dual_audio) trans = g_array_index (transceivers, GstWebRTCRTPTransceiver *, 0); fail_unless (trans != NULL); - fail_unless_equals_int (trans->mline, 0); + g_object_get (trans, "mlineindex", &mline, NULL); + fail_unless_equals_int (mline, 0); trans = g_array_index (transceivers, GstWebRTCRTPTransceiver *, 1); fail_unless (trans != NULL); - fail_unless_equals_int (trans->mline, 1); + g_object_get (trans, "mlineindex", &mline, NULL); + fail_unless_equals_int (mline, 1); g_array_unref (transceivers); test_webrtc_free (t); @@ -3613,8 +3618,7 @@ GST_START_TEST (test_reject_request_pad) pad = gst_element_request_pad (t->webrtc1, templ, "sink_0", caps); fail_unless (pad == NULL); - gst_caps_unref (trans->codec_preferences); - trans->codec_preferences = NULL; + g_object_set (trans, "codec-preferences", NULL, NULL); /* This should fail because the kind doesn't match */ pad = gst_element_request_pad (t->webrtc1, templ, "sink_0", caps); |