public class RTCPSession
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.Hashtable<java.lang.Long,java.util.LinkedList<RtcpPktAPP>> |
appQueue
APP queue , index is SSRC of target
|
protected int |
avgPktSize
The average compound RTCP packet size, in octets, including UDP and IP headers
|
protected boolean |
fbAllowEarly
Whether next RTCP packet can be sent early
|
protected java.util.Hashtable<java.lang.Long,java.util.LinkedList<RtcpPkt>> |
fbQueue
Feedback queue , index is SSRC of target
|
protected long |
fbWaiting
Is there a feedback packet waiting? SSRC of destination
|
protected boolean |
initial
Are we just starting up?
|
protected java.net.InetAddress |
mcGroup
Multicast group
|
protected int |
nextDelay
Delay between RTCP transmissions, in ms.
|
protected long |
prevTime
Previous time a delay was calculated
|
protected RTCPReceiverThread |
recvThrd
RTCP Receiver thread
|
protected java.net.MulticastSocket |
rtcpMCSock
Multicast socket
|
protected java.net.DatagramSocket |
rtcpSock
Unicast socket
|
protected RTPSession |
rtpSession
Parent session
|
protected int |
senderCount
Pessimistic case estimate of the current number of senders
|
protected RTCPSenderThread |
senderThrd
RTCP Sender thread
|
Modifier | Constructor and Description |
---|---|
protected |
RTCPSession(RTPSession parent,
java.net.DatagramSocket rtcpSocket)
Constructor for unicast sessions
|
protected |
RTCPSession(RTPSession parent,
java.net.MulticastSocket rtcpSocket,
java.net.InetAddress multicastGroup)
Constructor for multicast sessions
|
Modifier and Type | Method and Description |
---|---|
protected void |
addToAppQueue(long targetSsrc,
RtcpPktAPP aPkt)
Adds an RTCP APP (application) packet to the queue
|
protected int |
addToFbQueue(long targetSsrc,
RtcpPkt aPkt)
Check the feedback queue for similar packets and adds
the new packet if it is not redundant
|
protected void |
calculateDelay()
Calculate the delay before the next RTCP packet can be sent
|
protected void |
calculateRegularDelay()
Calculates a delay value in accordance with RFC 3550
|
protected void |
cleanAppQueue(long ssrc)
Cleans the TCP APP (application) packet queues of any packets that are
too old, defined as 60 seconds since insertion.
|
protected void |
cleanFbQueue(long ssrc)
Cleans the feeback queue of any packets that have expired,
ie feedback packet that are no longer relevant.
|
protected boolean |
fbSendEarly()
Check whether the conditions are satisfied to send a feedbkac packet immediately.
|
protected boolean |
fbSendImmediately()
Check whether the conditions are satisfied to send a feedbkac packet immediately.
|
protected RtcpPktAPP[] |
getFromAppQueue(long targetSsrc)
Adds an RTCP APP (application) packet to the queue
|
protected RtcpPkt[] |
getFromFbQueue(long ssrc)
Checks whether there are ny feedback packets waiting
to be sent.
|
protected void |
sendByes()
Send bye packets, handled by RTCP Sender thread
|
protected void |
start()
Starts the session, calculates delays and fires up the threads.
|
protected void |
updateAvgPacket(int length)
Update the average packet size
|
protected void |
wakeSenderThread(long ssrc)
Wake the sender thread because of this ssrc
|
protected RTPSession rtpSession
protected java.net.DatagramSocket rtcpSock
protected java.net.MulticastSocket rtcpMCSock
protected java.net.InetAddress mcGroup
protected RTCPReceiverThread recvThrd
protected RTCPSenderThread senderThrd
protected long prevTime
protected int nextDelay
protected int avgPktSize
protected int senderCount
protected boolean fbAllowEarly
protected java.util.Hashtable<java.lang.Long,java.util.LinkedList<RtcpPkt>> fbQueue
protected java.util.Hashtable<java.lang.Long,java.util.LinkedList<RtcpPktAPP>> appQueue
protected boolean initial
protected long fbWaiting
protected RTCPSession(RTPSession parent, java.net.DatagramSocket rtcpSocket)
parent
- RTPSession that started thisrtcpSocket
- the socket to use for listening and sendingprotected RTCPSession(RTPSession parent, java.net.MulticastSocket rtcpSocket, java.net.InetAddress multicastGroup)
parent
- parent RTPSessionrtcpSocket
- parent RTPSession that started thismulticastGroup
- multicast group to bind the socket toprotected void start()
protected void sendByes()
protected void calculateDelay()
protected void calculateRegularDelay()
protected void updateAvgPacket(int length)
length
- of latest packetprotected void addToAppQueue(long targetSsrc, RtcpPktAPP aPkt)
targetSsrc
- the SSRC of the recipientaPkt
- protected RtcpPktAPP[] getFromAppQueue(long targetSsrc)
targetSsrc
- the SSRC of the recipientprotected void cleanAppQueue(long ssrc)
ssrc
- The SSRC of the user who has left, negative value -> general cleanupprotected int addToFbQueue(long targetSsrc, RtcpPkt aPkt)
aPkt
- protected RtcpPkt[] getFromFbQueue(long ssrc)
ssrc
- of the participant we are notifyingprotected void cleanFbQueue(long ssrc)
ssrc
- The SSRC of the user who has left, negative value -> general cleanupprotected boolean fbSendImmediately()
protected boolean fbSendEarly()
protected void wakeSenderThread(long ssrc)
ssrc
- that has feedback waiting.