diff options
author | Olivier CrĂȘte <olivier.crete@collabora.com> | 2021-04-21 16:27:38 -0400 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2021-05-13 17:49:49 -0400 |
commit | ba079092f8a6e3fcd653065b1eb80c89e4f35eed (patch) | |
tree | 1bf0c37d0fbbfb90e6798eafdc729dc0f7449340 | |
parent | 5f9ba620ce9e0b91397636c13e0bd1153cbcf348 (diff) |
webrtc: 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-examples/-/merge_requests/36>
-rw-r--r-- | webrtc/sendonly/webrtc-unidirectional-h264.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/webrtc/sendonly/webrtc-unidirectional-h264.c b/webrtc/sendonly/webrtc-unidirectional-h264.c index 48fe8a0..593d861 100644 --- a/webrtc/sendonly/webrtc-unidirectional-h264.c +++ b/webrtc/sendonly/webrtc-unidirectional-h264.c @@ -259,22 +259,34 @@ create_receiver_entry (SoupWebsocketConnection * connection) &transceivers); g_assert (transceivers != NULL && transceivers->len > 1); trans = g_array_index (transceivers, GstWebRTCRTPTransceiver *, 0); - trans->direction = GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDONLY; + g_object_set (trans, "direction", + GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDONLY, NULL); if (video_priority) { GstWebRTCPriorityType priority; priority = _priority_from_string (video_priority); - if (priority) - gst_webrtc_rtp_sender_set_priority (trans->sender, priority); + if (priority) { + GstWebRTCRTPSender *sender; + + g_object_get (trans, "sender", &sender, NULL); + gst_webrtc_rtp_sender_set_priority (sender, priority); + g_object_unref (sender); + } } 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); if (audio_priority) { GstWebRTCPriorityType priority; priority = _priority_from_string (audio_priority); - if (priority) - gst_webrtc_rtp_sender_set_priority (trans->sender, priority); + if (priority) { + GstWebRTCRTPSender *sender; + + g_object_get (trans, "sender", &sender, NULL); + gst_webrtc_rtp_sender_set_priority (sender, priority); + g_object_unref (sender); + } } g_array_unref (transceivers); |