New issue
Advanced search Search tips

Issue 922678 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Jan 17
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug


Participants' hotlists:
WebRTC-Unified-Plan


Sign in to add a comment

addTrack doesn't appear to reuse available RTCRtpTransceiver (Unified Plan)

Reported by xsvengo...@gmail.com, Jan 16 (6 days ago)

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0

Steps to reproduce the problem:
1. Open the test page
2. Start
3. Call
4. Add Video
5. Test (observe the console prints a 3rd active transceiver)
6. Remove Video
7. Test (observe the console prints the 3rd transceiver is recvonly and the sender track is null
8. Add Video
9. Test (observe the console prints 4 transceivers)

What is the expected behavior?
Following the steps above I expected only 3 transceivers to be printed in step 9.

What went wrong?
The spec talks about reusing RTCRtpTransceivers for the addTrack function (http://w3c.github.io/webrtc-pc/#rtcpeerconnection-interface-extensions) and I noticed it wasn't working for me. The attached sample is a version of https://webrtc.github.io/samples/src/content/peerconnection/pc1/

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 72.0.3626.53 (Official Build) beta (64-bit) (cohort: Beta)  Channel: n/a
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version:
 
pc1-addTrack.zip
5.2 KB Download
bug-example.webm
22.4 MB Download

Comment 1 by xsvengo...@gmail.com, Jan 16 (6 days ago)

I was reading the spec again and noticed one of the criteria isn't met in order for the transceiver to be reused:
[x]sender's track is null
[x]sender's kind matches
[x]transceiver is not stopped
[]sender has never been used to send

In the case this isn't a bug. I guess my main concern is that the SDP keeps growing every time you call addTrack /removeTrack. Is this an issue?

Comment 2 by viswa.karala@chromium.org, Jan 17 (6 days ago)

Labels: Needs-Triage-M72

Comment 3 by guidou@chromium.org, Jan 17 (5 days ago)

Components: -Blink>WebRTC Blink>WebRTC>PeerConnection
Owner: hbos@chromium.org
Status: Assigned (was: Unconfirmed)
hbos@: can you take a look?

Comment 4 by hbos@chromium.org, Jan 17 (5 days ago)

Status: WontFix (was: Assigned)
As noted in #1, one of the criteria of reusing a transceiver is "The sender has never been used to send."
The list of transceivers can grow, but it cannot shrink. When RTCRtpTransceiver.stop() is shipped, you will be able to clean up the SDP a bit, but getTransceivers().length will forever grow.

If you want to reuse transceivers you should make use of the RTCRtpTransceiver.direction attribute (changing the direction will trigger onnegotiationneeded). With RTCRtpSender.replaceTrack() you can seamlessly change which track to send (or stop sending if you set it to null) which doesn't even require renegotiation, which may be a good idea if you want to switch camera or mute the stream.

If you want to get into the "transceiver mindset" you might as well start using addTransceiver() instead of addTrack() to make it more clear that you are in fact adding transceivers when you're doing this.

Not adding an unnecessary number of transceivers can be a good idea, in case resources are wasted on encoders and decoders that aren't used.

Sign in to add a comment