|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjlibrtp.ParticipantDatabase
public class ParticipantDatabase
The participant database maintains three hashtables with participants. The key issue is to be fast for operations that happen every time an RTP packet is sent or received. We allow linear searching in cases where we need to update participants with information. The keying is therefore usually the SSRC. In cases where we have the cname, but no SSRC is known (no SDES packet has been received), a simple hash i calculated based on the CNAME. The RTCP code should, when receiving SDES packets, check whether the participant is known and update the copy in this database with SSRC if needed.
Field Summary | |
---|---|
(package private) java.util.LinkedList<Participant> |
receivers
A linked list to hold participants explicitly added by the application In unicast mode this is the list used for RTP and RTCP transmission, in multicast it should not be in use. |
(package private) RTPSession |
rtpSession
The parent RTP Session |
(package private) java.util.concurrent.ConcurrentHashMap<java.lang.Long,Participant> |
ssrcTable
The hashtable holds participants added through received RTP and RTCP packets, as well as participants that have been linked to an SSRC by ip address (in unicast mode). |
Constructor Summary | |
---|---|
protected |
ParticipantDatabase(RTPSession parent)
Simple constructor |
Method Summary | |
---|---|
protected int |
addParticipant(int cameFrom,
Participant p)
|
private int |
addParticipantMulticast(int cameFrom,
Participant p)
Add a multicast participant to the database |
private int |
addParticipantUnicast(int cameFrom,
Participant p)
Add a unicast participant to the database Result will be reported back through tpSession.appIntf.userEvent |
protected void |
debugPrint()
|
protected Participant |
getParticipant(long ssrc)
Find a participant based on the ssrc |
protected java.util.Enumeration<Participant> |
getParticipants()
Enumeration of all the participants with known ssrcs. |
protected java.util.Iterator<Participant> |
getUnicastReceivers()
Iterator for all the unicast receivers. |
protected void |
removeParticipant(Participant p)
Remove a participant from all tables |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
RTPSession rtpSession
java.util.LinkedList<Participant> receivers
java.util.concurrent.ConcurrentHashMap<java.lang.Long,Participant> ssrcTable
Constructor Detail |
---|
protected ParticipantDatabase(RTPSession parent)
parent
- parent RTPSessionMethod Detail |
---|
protected int addParticipant(int cameFrom, Participant p)
cameFrom
- 0: Application, 1: RTP packet, 2: RTCPp
- the participant
private int addParticipantMulticast(int cameFrom, Participant p)
cameFrom
- 0: Application, 1,2: discovered through RTP or RTCPp
- the participant to add
private int addParticipantUnicast(int cameFrom, Participant p)
cameFrom
- 0: Application, 1,2: discovered through RTP or RTCPp
- the participant to add
protected void removeParticipant(Participant p)
p
- the participant to be removedprotected Participant getParticipant(long ssrc)
ssrc
- of the participant to be found
protected java.util.Iterator<Participant> getUnicastReceivers()
protected java.util.Enumeration<Participant> getParticipants()
protected void debugPrint()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |