New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 803389 link

Starred by 2 users

Issue metadata

Status: Duplicate
Merged: issue 777617
Owner:
Closed: Sep 4
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 799030



Sign in to add a comment

RTCPeerConnectionHandler: Support reusing senders/receiving for Unified Plan

Project Member Reported by hbos@chromium.org, Jan 18 2018

Issue description

When Unified Plan is supported, senders/receivers will no longer be removed. They will become inactive and may be reused in the future.

RTCPeerConnectionHandler and blink needs to be updated such that it supports changing the state of the sender/receiver/transceiver active <-> inactive or else there may be multiple blink objects corresponding to the same content/webrtc objects.
 

Comment 1 by hbos@chromium.org, Jan 18 2018

Blocking: 799030

Comment 2 by hbos@chromium.org, Jan 18 2018

Talking about the transceiver direction. The adding and reusing of sender/receiver needs to be supported whether or not we support transceiver.
Not sure what you mean by "inactive" and "resused", but there shouldn't actually be any reuse at the API layer. RTCRtpTransceivers can reuse the same m= line but the actual objects are different. Perhaps you mean reusing by addTrack? But that's no different than sender.replaceTrack which is already supported.

Comment 4 by hbos@chromium.org, Jan 30 2018

I was referring to 4.4.1.6 Set the RTCSessionDescription,
https://w3c.github.io/webrtc-pc/#set-the-rtcsessiondescription
...
2.2.8. If description is set as a remote description, then run the following steps:
...
2.2.8.2 As described by [JSEP] (section 5.10.), attempt to find an existing RTCRtpTransceiver object, transceiver, to represent the media description.

So I just looked up this JSEP reference for the first time...
https://tools.ietf.org/html/draft-ietf-rtcweb-jsep-24#section-5.10

  If the m= section is sendrecv or recvonly, and there are
  RtpTransceivers of the same type that were added to the
  PeerConnection by addTrack and are not associated with any
  m= section and are not stopped, find the first (according to
  the canonical order described in Section 5.2.1) such
  RtpTransceiver.



So, I'm trying to figure out what this means. Maybe I'm misunderstanding something...

let caller = new RTCPeerConnection();
caller.addTrack(videoTrack1);  // transceiver t1 created
let callee = new RTCPeerConnection();
callee.addTrack(videoTrack2);  // transceiver t2 created

// This causes t1 to be associated with an m= section.
let offer = async caller.createOffer();
async caller.setLocalDescription(offer);

// Since t2 is not associated with an m= section yet I assume
// it will be used to receive the remote videoTrack1 from caller.
// So now t2 will use the same m= section?
async callee.setRemoteDescription(offer);
let answer = async callee.createAnswer();
async callee.setLocalDescription(answer);

// Because t2 and t1 use the same m section, the caller will
// receive the remote videoTrack2 from callee using the
// existing transceiver t1.
async caller.setRemoteDescription(answer);


Does that make sense? I would have assumed a transceiver is created for both directions but my understanding from reading the spec is that we only need one transceiver on both endpoints.

Comment 5 by hbos@chromium.org, Jan 30 2018

Cc: deadbeef@chromium.org
hta@ and deadbeef@ what is your take on #3 and #4?

Comment 6 by hbos@chromium.org, Jan 30 2018

And I assumed something similar can happen if you've removed a track and done a full O/A cycle and then you do the above again.

Comment 7 by hta@chromium.org, Jan 30 2018

The only two cases where a transceiver can detach from a media section is on a rollback and after stopping a transceiver (port=0 in offer/answer). In all other cases - once it's associated with a media section, it stays with that media section.
References to "free-floating" transceivers are for transceivers created with AddTrack or AddTransceiver since the last offer/answer exchange completed. The ones detached by stopping are stopped permanently - they never come back.

Senders and receivers (one of each) are permanently attached to transceivers. Not sure that was a good move, but that's how the spec's written today.

Remember: Senders and receivers are unidirectional: One sends, the other receives.
Transceivers are bidirectional. We use them with both a sender and a receivers.

In the example in #4 - yes, those two tracks are supposed to end up described by the same media section. That's what's interoperable with non-browser SDP, and the point of the whole shenanigan with transceivers and media sections.




Comment 8 by hbos@chromium.org, Jan 30 2018

Thanks!
Okay so they can be "recycled" in the sense of #4 that they may have been created prior (e.g. getReceivers() will list it before the first ontrack event). But once in-use for media, it's a one-time deal, and after stopping a transceiver they will never be "recycled".
The special case of rollback might undo a stop, but it is not recycled for other media in the sense we're talking about.

Comment 9 by hbos@chromium.org, Jan 30 2018

Labels: -Pri-2 Pri-3
I will keep this bug open since using an existing sender/receiver like described in #4 is not supported yet, but it is possible this bug becomes a NO-OP when we support transceivers.
Labels: -M-66
Mergedinto: 777617
Status: Duplicate (was: Assigned)
This is an old bug fixed by the addition of transceviers.

Sign in to add a comment