admin 管理员组

文章数量: 1086019

I am working on a WebRTC-based telco app. When negotiating the connection I get the local media streams, and the requirements define that the user enters a room by default without outgoing media, so I disable both streams:

val peerConnection = PeerConnection()
val streams =
    MediaDevices.getUserMedia(
        audio = true,
        video = true
    )
streams.tracks.forEach {
    it.enabled = false
    peerConnection.addTrack(it)
}

(using webrtc-kmp lib).

Later on, when the user chooses to show their video stream, I set the enabled flag on the video stream to true and I am getting an error from the server:

WebRtcEndpoint error:Error code 1: Internal data stream error., 
source: nicesrc66, 
element: kmswebrtcendpoint66, 
debug info: 
../libs/gst/base/gstbasesrc.c(3177): gst_base_src_loop ():
/GstPipeline:pipeline64/KmsWebrtcEndpoint:kmswebrtcendpoint66/KmsWebrtcSession:kmswebrtcsession66/KmsWebrtcTransportSrcNice:kmswebrtctransportsrcnice66/GstNiceSrc:nicesrc66:
streaming stopped, reason not-linked (-1).

After this error the PeerConnection object on the client side becomes disconnected and the media exchange stops. The same happens if I don't get the local stream on negotiation (but still set the media sendrecv in the SDP offer) but only on enabling the outgoing video and adding it with replaceTrack(...) on the appropriate Sender.

The client side peer connection is set to two-way (sendrecv). I am not getting any negotiationNeeded events on the client (Kurento does not support renegotiation AFAIK), and on opening the connection I see both Audio flowIn and Video flowIn events.

Is enabling/disabling (video) of streams supported by Kurento, and if it is, am I missing something?

本文标签: enabling disabling and replacing WebRTC tracks after negotiation against KurentoStack Overflow