Update WebRTC transceivers dynamically

Busayo Famutimi famutimi.busayo at gmail.com
Fri Feb 18 09:37:18 UTC 2022


Thanks Matthew.

Just to understand clearly, I have the following in a pipeline,

"wasapisrc role=comms use-audioclient3=true low-latency=true ! queue !
audioconvert ! audioresample ! queue ! opusenc ! rtpopuspay name=audiopay !
queue name=audio_queue !
application/x-rtp,media=audio,encoding-name=OPUS,payload=111 ! webrtcbin ".

To mute, the queue (named audio_queue) src pad and the webrtcbin sink_pad
(sink_%u) have to be unlinked and

to unmute, both pads must be linked back together.

Is my understanding correct?

Thanks.




On Fri, Feb 18, 2022 at 2:53 AM Matthew Waters <ystreet00 at gmail.com> wrote:

> 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/3a3c125d/attachment-0001.htm>


More information about the gstreamer-devel mailing list