janus_rtcp_get_sender_ssrc and janus_rtcp_get_receiver_ssrc

55 views
Skip to first unread message

Gustavo Goncalves

unread,
Jun 12, 2015, 9:36:08 AM6/12/15
to meetech...@googlegroups.com
Hi,

I couldn't find any examples with the janus_rtcp_get_sender_ssrc or janus_rtcp_get_receiver_ssrc functions, so I got confused with their usage.

In my understanding of the RTP + RTCP Protocol a SSRC uniquely iddentifies a stream source, hence I don't understand how we can give a RTCP packet to the methods and they will give us the sender, or the receiver SSRC. If a stream is identified by the SSRC, how can we have a sender SSRC and a receiver SSRC?

Thanks in advance,

Gustavo Gonçalves.

Lorenzo Miniero

unread,
Jun 12, 2015, 11:04:12 AM6/12/15
to meetech...@googlegroups.com, gs.gon...@campus.fct.unl.pt
Hi Gustavo,

those methods are only used by the core, so if you're writing a plugin or just using Janus you shouldn't really worry about those. Anyway, SSRC uniquely identifies a stream source, right, but a conversation is usually made of two streams, one you send and another you receive. That's definitely what's happening in Janus, for instance. In RTCP SR and RR packets, since they convey statistics about the RTP transmission, you have references to both.

L.

Gustavo Goncalves

unread,
Jun 12, 2015, 12:03:24 PM6/12/15
to meetech...@googlegroups.com, gs.gon...@campus.fct.unl.pt
Thanks for the quick reply Lorenzo,

I am using Janus for streaming and building my own plugin.
I have structured my plugin in a way that makes me use SSRC's in order to identify the sender of a stream.

I have attached a file that has an example of my question when we are working with streaming, and we don't have two peers sending streams.

Could you tell me if I am understanding correctly the way that those functions work, please?

Thank you for your help.

Gustavo
schema2.txt

Lorenzo Miniero

unread,
Jun 14, 2015, 5:19:58 AM6/14/15
to meetech...@googlegroups.com, gs.gon...@campus.fct.unl.pt
The Janus core will overwrite the SSRCs. In a VideoCall-like plugin, the SSRC the first peer sets is not the SSRC the second peer will get, as you'll have two different media sessions, the one each peer has with Janus, which just happens to be "bridged" by the plugin.

That said, one you use those methods you should always get coherent information when you use them on the two separate legs. So if you check "sender" and "receiver"for the RTCP sent by peer1, you'll always get the same info; same for peer2; it's just that the info for peer1 and peer2 won't match, since as soon as you relay an RTP or RTCP packet to peer2 the info peer1 set will be overwritten by Janus.

L.

Lorenzo Miniero

unread,
Jun 14, 2015, 5:21:08 AM6/14/15
to meetech...@googlegroups.com, lmin...@gmail.com, gs.gon...@campus.fct.unl.pt
PS: what do you need the SSRC to identify senders for? this is something that with Janus you can already achieve by usig the plugin session. Incoming RTP and RTCP will always be within the context of a previously created handle, vthat uniquely identified a PeerConnection.

L.

Gustavo Goncalves

unread,
Jun 15, 2015, 6:32:42 AM6/15/15
to Lorenzo Miniero, meetech...@googlegroups.com
You were right, I didn't need the SSRC's for nothing, I found another, much simpler way to do what I needed.

Thank you very much for your explanation, it was very helpful and it will be useful in the future.

Gustavo
Reply all
Reply to author
Forward
0 new messages