AddTrack vs. AddTransceiver

2,161 views
Skip to first unread message

Bo Zhou

unread,
Jun 22, 2019, 10:36:41 AM6/22/19
to discuss-webrtc
Hi !

The program is using Unified Plan, according the document “Migrating your native/mobile application to Unified Plan”, it looks like the AddTrack is the wrapper of AddTransceiver.

I'd like to know in order to create the offer contains 2 video streams, 1 is sendrecv, the 2nd is sendonly/recvonly, is that mandatory to call AddTransceiver for the 2 tracks ?

Now my problem is only 1 video stream works, 2nd doesn't work, and the most strange thing is that same program, Linux works with 2 video streams, Windows just receives the second video stream. Is there anybody knows this ? 

Thank you very much.

Jan Kaláb

unread,
Jun 23, 2019, 5:25:04 AM6/23/19
to discuss-webrtc
Well, to my knowledge, backed up by some experiments, it works like this:

The Transceiver has some type (audio/video), directions, and senders and receivers. And senders and receivers contains track.

Now, when you create new Transceiver, the senders/receivers/tracks are empty.

And when you call addTrack, it looks for those empty tracnsceivers with matching type (audio/video) and adds the track (as sender). If it can't find empty transceiver, it creates new one. Also note, that addTrack returns RtpSender object.

Dne sobota 22. června 2019 16:36:41 UTC+2 Bo Zhou napsal(a):

Harald Alvestrand

unread,
Jun 23, 2019, 6:06:14 AM6/23/19
to discuss...@googlegroups.com
Quibbling: The track attached to the receiver is always present.
It's the track attached to the sender that can be empty or changed (with replaceTrack()).
--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/dee3063c-ffdc-4147-9a31-ca2259cca3c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
Surveillance is pervasive. Go Dark.

Bo Zhou

unread,
Jun 26, 2019, 1:09:02 AM6/26/19
to discuss-webrtc
Hi !

Thanks for the reply !

Finally I think the AddTrack() is the easy way to handle both Recv+Send trakcs. When it's needed to have a single directional track, we can use AddTransceiver().


On Sunday, June 23, 2019 at 7:06:14 PM UTC+9, Harald Alvestrand wrote:
Quibbling: The track attached to the receiver is always present.
It's the track attached to the sender that can be empty or changed (with replaceTrack()).


On 6/23/19 11:25 AM, Jan Kaláb wrote:
Well, to my knowledge, backed up by some experiments, it works like this:

The Transceiver has some type (audio/video), directions, and senders and receivers. And senders and receivers contains track.

Now, when you create new Transceiver, the senders/receivers/tracks are empty.

And when you call addTrack, it looks for those empty tracnsceivers with matching type (audio/video) and adds the track (as sender). If it can't find empty transceiver, it creates new one. Also note, that addTrack returns RtpSender object.

Dne sobota 22. června 2019 16:36:41 UTC+2 Bo Zhou napsal(a):
Hi !

The program is using Unified Plan, according the document “Migrating your native/mobile application to Unified Plan”, it looks like the AddTrack is the wrapper of AddTransceiver.

I'd like to know in order to create the offer contains 2 video streams, 1 is sendrecv, the 2nd is sendonly/recvonly, is that mandatory to call AddTransceiver for the 2 tracks ?

Now my problem is only 1 video stream works, 2nd doesn't work, and the most strange thing is that same program, Linux works with 2 video streams, Windows just receives the second video stream. Is there anybody knows this ? 

Thank you very much.
--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages