jlibrtp
Class RTCPReceiverThread

java.lang.Object
  extended by java.lang.Thread
      extended by jlibrtp.RTCPReceiverThread
All Implemented Interfaces:
java.lang.Runnable

public class RTCPReceiverThread
extends java.lang.Thread

This thread hangs on the RTCP socket and waits for new packets

Author:
Arne Kepp

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
private  RTCPSession rtcpSession
          Parent RTCP Session
private  RTPSession rtpSession
          Parent RTP Session
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
RTCPReceiverThread(RTCPSession rtcpSession, RTPSession rtpSession)
          Constructor for new thread
 
Method Summary
private  java.lang.String debugErrorString(int errorCode)
          Returns a legible message when an error occurs
private  Participant findParticipant(long ssrc, java.net.DatagramPacket packet)
          Find out whether a participant with this SSRC is known.
private  int parsePacket(java.net.DatagramPacket packet)
          Parse a received UDP packet Perform the header checks and extract the RTCP packets in it
 void run()
          Start the RTCP receiver thread.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

rtpSession

private RTPSession rtpSession
Parent RTP Session


rtcpSession

private RTCPSession rtcpSession
Parent RTCP Session

Constructor Detail

RTCPReceiverThread

RTCPReceiverThread(RTCPSession rtcpSession,
                   RTPSession rtpSession)
Constructor for new thread

Parameters:
rtcpSession - parent RTCP session
rtpSession - parent RTP session
Method Detail

findParticipant

private Participant findParticipant(long ssrc,
                                    java.net.DatagramPacket packet)
Find out whether a participant with this SSRC is known. If the user is unknown, and the system is operating in unicast mode, try to match the ip-address of the sender to the ip address of a previously unmatched target

Parameters:
ssrc - the SSRC of the participant
packet - the packet that notified us
Returns:
the relevant participant, possibly newly created

parsePacket

private int parsePacket(java.net.DatagramPacket packet)
Parse a received UDP packet Perform the header checks and extract the RTCP packets in it

Parameters:
packet - the packet to be parsed
Returns:
-1 if there was a problem, 0 if successfully parsed

debugErrorString

private java.lang.String debugErrorString(int errorCode)
Returns a legible message when an error occurs

Parameters:
errorCode - the internal error code, commonly negative of packet type
Returns:
a string that is hopefully somewhat informative

run

public void run()
Start the RTCP receiver thread. It will 1) run when it receives a packet 2) parse the packet 3) call any relevant callback functions, update database 4) block until the next one arrives.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread