Update WebRTC transceivers dynamically

Matthew Waters ystreet00 at gmail.com
Fri Feb 18 01:53:47 UTC 2022


Setting the sendrecv/recvonly/sendonly does not change what data you
push into webrtcbin.  If you want 'mute' functionality, stop pushing
audio/video into webrtcbin.

Cheers
-Matt

On 18/2/22 05:15, Busayo Famutimi via gstreamer-devel wrote:
> Hello.
>
> Please I have a working webrtc peer connection using. However, I am
> unable to set the transceivers (both audio and video) dynamically.
>
> I have the following code:
>
> GArray *transceivers;
>     g_signal_emit_by_name(voip_data->webrtc, "get-transceivers",
> &transceivers);
>     g_assert(transceivers != NULL && transceivers->len > 1);
>     for (guint i = 0; i < transceivers->len; i++)
>     {
>         GstWebRTCRTPTransceiver *transceiver =
> g_array_index(transceivers, GstWebRTCRTPTransceiver *, i);
>         GstWebRTCKind kind;
>         g_object_get(transceiver, "kind", &kind, NULL);
>         if (kind == GST_WEBRTC_KIND_AUDIO)
>         {
>             if (mic_action == MUTE_MIC)
>                 g_object_set(transceiver, "direction",
> GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_RECVONLY, NULL);
>             else if (mic_action == UNMUTE_MIC)
>                 g_object_set(transceiver, "direction",
> GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDRECV, NULL);
>             else
>                 g_assert_not_reached();
>         }
>     }
>     g_array_unref(transceivers);
>
> but the other peer still receives audio.
>
> I am trying to create the mute/unmute microphone functionality.
>
> How can this be achieved?
>
> Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20220218/4c59fea3/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20220218/4c59fea3/attachment.sig>


More information about the gstreamer-devel mailing list