<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    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.<br>
    <br>
    Cheers<br>
    -Matt<br>
    <br>
    <div class="moz-cite-prefix">On 18/2/22 05:15, Busayo Famutimi via
      gstreamer-devel wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CACCWeRc91+LuGPW=42C-z5CF_9fuBQ-GMZi=O3=aXSiWhPQUPg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div dir="ltr">Hello.
          <div><br>
          </div>
          <div>Please I have a working webrtc peer connection using.
            However, I am unable to set the transceivers (both audio and
            video) dynamically.</div>
          <div><br>
          </div>
          <div>I have the following code:</div>
          <div><br>
          </div>
          <div>
            <div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:Consolas,"Courier New",monospace;font-size:14px;line-height:19px;white-space:pre-wrap"><div><span style="color:rgb(78,201,176)">GArray</span> *<span style="color:rgb(156,220,254)">transceivers</span>;</div><div>    <span style="color:rgb(220,220,170)">g_signal_emit_by_name</span>(<span style="color:rgb(156,220,254)">voip_data</span>-><span style="color:rgb(156,220,254)">webrtc</span>, <span style="color:rgb(206,145,120)">"get-transceivers"</span>, &<span style="color:rgb(156,220,254)">transceivers</span>);</div><div>    <span style="color:rgb(86,156,214)">g_assert</span>(<span style="color:rgb(156,220,254)">transceivers</span> != <span style="color:rgb(86,156,214)">NULL</span> && <span style="color:rgb(156,220,254)">transceivers</span>-><span style="color:rgb(156,220,254)">len</span> > <span style="color:rgb(181,206,168)">1</span>);</div><div>    <span style="color:rgb(197,134,192)">for</span> (<span style="color:rgb(78,201,176)">guint</span> <span style="color:rgb(156,220,254)">i</span> = <span style="color:rgb(181,206,168)">0</span>; <span style="color:rgb(156,220,254)">i</span> < <span style="color:rgb(156,220,254)">transceivers</span>-><span style="color:rgb(156,220,254)">len</span>; <span style="color:rgb(156,220,254)">i</span>++) </div><div>    {</div><div>        <span style="color:rgb(78,201,176)">GstWebRTCRTPTransceiver</span> *<span style="color:rgb(156,220,254)">transceiver</span> = <span style="color:rgb(86,156,214)">g_array_index</span>(<span style="color:rgb(156,220,254)">transceivers</span>, <span style="color:rgb(78,201,176)">GstWebRTCRTPTransceiver</span> *, <span style="color:rgb(156,220,254)">i</span>);</div><div>        <span style="color:rgb(78,201,176)">GstWebRTCKind</span> <span style="color:rgb(156,220,254)">kind</span>;</div><div>        <span style="color:rgb(220,220,170)">g_object_get</span>(<span style="color:rgb(156,220,254)">transceiver</span>, <span style="color:rgb(206,145,120)">"kind"</span>, &<span style="color:rgb(156,220,254)">kind</span>, <span style="color:rgb(86,156,214)">NULL</span>);</div><div>        <span style="color:rgb(197,134,192)">if</span> (<span style="color:rgb(156,220,254)">kind</span> == <span style="color:rgb(79,193,255)">GST_WEBRTC_KIND_AUDIO</span>)</div><div>        {</div><div>            <span style="color:rgb(197,134,192)">if</span> (<span style="color:rgb(156,220,254)">mic_action</span> == <span style="color:rgb(79,193,255)">MUTE_MIC</span>)
</div><div>                <span style="color:rgb(220,220,170)">g_object_set</span>(<span style="color:rgb(156,220,254)">transceiver</span>, <span style="color:rgb(206,145,120)">"direction"</span>, <span style="color:rgb(79,193,255)">GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_RECVONLY</span>, <span style="color:rgb(86,156,214)">NULL</span>);</div><div>            <span style="color:rgb(197,134,192)">else</span> <span style="color:rgb(197,134,192)">if</span> (<span style="color:rgb(156,220,254)">mic_action</span> == <span style="color:rgb(79,193,255)">UNMUTE_MIC</span>)</div><div>                <span style="color:rgb(220,220,170)">g_object_set</span>(<span style="color:rgb(156,220,254)">transceiver</span>, <span style="color:rgb(206,145,120)">"direction"</span>, <span style="color:rgb(79,193,255)">GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_SENDRECV</span>, <span style="color:rgb(86,156,214)">NULL</span>);</div><div>            <span style="color:rgb(197,134,192)">else</span></div><div>                <span style="color:rgb(86,156,214)">g_assert_not_reached</span>();</div><div>        }</div><div>    }</div><div>    <span style="color:rgb(220,220,170)">g_array_unref</span>(<span style="color:rgb(156,220,254)">transceivers</span>);</div></div>
          </div>
          <div><br>
          </div>
          <div>but the other peer still receives audio.</div>
          <div><br>
          </div>
          <div>I am trying to create the mute/unmute microphone
            functionality.</div>
          <div><br>
          </div>
          <div>How can this be achieved?</div>
          <div><br>
          </div>
          <div>Thanks.</div>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>