W3C home > Mailing lists > Public > public-webrtc-logs@w3.org > January 2018

Re: [webrtc-pc] addTransceiver woes

From: jan-ivar via GitHub <sysbot+gh@w3.org>
Date: Wed, 03 Jan 2018 17:56:02 +0000
To: public-webrtc-logs@w3.org
Message-ID: <issue_comment.created-355079916-1515002161-sysbot+gh@w3.org>
So many conversations here.

> From a different angle, why do we require negotiation for this:
> ```
> const pc = new RTCPeerConnection();
> const transceiver = pc.addTransceiver('audio');
> // ... negotiate (so the transceiver becomes associated)
> pc.addTrack(someAudioTrack, someStream);
> ```
> which, presumably, would reuse the transceivers sender.

@fippo It would not, because it fails the following test for re-use:

 *"The sender has never been used to send. More precisely, the [[CurrentDirection]] slot of the RTCRtpTransceiver associated with the sender has never had a value of `sendrecv` or `sendonly`."*

We decided long ago `replaceTrack` should never negotiate. I've heard no reason here to reopen that.

> > Do we need negotiation to go from "there was never a track" to "there is a track"?
> In some cases.

To clarify: Not today in any implementation. We've basically absorbed API complexity here to be able to fail gracefully in case of theoretical conflicts with future "pre-encoded" cameras. But again, I'm not hearing any new information on this topic that wasn't discussed 3 years ago.

> ```
> // 3. And this?
> transceiver = pc.addTransceiver();
> transceiver.sender.replaceTrack(track2);
> O/A cycle
> ```
> I would assume 3) to work the same as 1), but from my understanding of replaceTrack() it would fail without an initial O/A cycle, 

@henbos `replaceTrack` mustn't fail in this instance. This is poor wording in the spec. The intent of the sentence *"Determine if negotiation is needed to transmit withTrack in place of the sender's existing track."* and *"If negotiation is needed, then reject p"* was to protect an already transmitting sender from entering into a failure state. The intent was never to limit`replaceTrack` to working only when [[NegotiationNeeded]] == `false`.

@stefhak I don't have a strong opinion on the default, just pointing out the two competing use-cases.

GitHub Notification of comment by jan-ivar
Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/1662#issuecomment-355079916 using your GitHub account
Received on Wednesday, 3 January 2018 17:56:04 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 6 May 2023 21:19:43 UTC