rtspserver
Class RtspRtpProcessor


class RtspRtpProcessor

Processes (play and record) rtp traffic for all the active sessions.

Play - Timing is controlled by a timer fifo. When playing is done (reach packet count or end of file reached), RtspRtpProcessor will move session into pause state. Processor also enforces pause points and queued play requests for playing sessions.

Recording - Timing is controlled by a blocking select() on the incoming rtp port. Processor also enforces pause points. However, queued record requests are not supported.

Play and record processing are done in seperate independent threads. Processor has overload dection mechanism to reject processing new sessions if cpu can't handle another session.


Destructor Summary
 virtual ~RtspRtpProcessor()
          destructor

Method Summary
 booladdInitalEvent(Sptr session)
          add inital rtp processor event.
 intallocateRtpPort()
          allocates a rtp port pair
 boolbuildRtpPortList(const int low, const int high)
          build the rtp port pool.
 booldeallocateRtpPort(const int port)
          deallocate a rtp port pair, false on failure
 booldelEvent(Sptr session)
          delete session from rtp processor
 static voiddestroy()
          frees the memory associated with singelton instance
 static RtspRtpProcessor &instance()
          create a singelton object
 boolplayThreadLoaded()
          check if play thread is loaded.
 boolrecordThreadLoaded()
          check if record thread is loaded.
 voidstartThread()
          start rtp processor threads
 voidstopThread()
          stop rtp processor threads

Method Detail

~RtspRtpProcessor

public virtual ~RtspRtpProcessor()
destructor
Method Detail

addInitalEvent

public bool addInitalEvent(Sptr session)
add inital rtp processor event. Processor will place into play or record processor.
Parameters:
session - session to add to processor
Returns: false on failure (ie invalid session state or processor overloaded)

allocateRtpPort

public int allocateRtpPort()
allocates a rtp port pair
Returns: rtp and rtcp port(rtp+1) allocated, or 0 on no port are available

buildRtpPortList

public bool buildRtpPortList(const int low, const int high)
build the rtp port pool. Ports are not really reserved in rtp stack
Parameters:
low - low rtp port range
high - high rtp port range
Returns: false on falure (ie invalid port range). However, default values are still set.

deallocateRtpPort

public bool deallocateRtpPort(const int port)
deallocate a rtp port pair, false on failure
Parameters:
port - rtp port to release
Returns: false of port not with high-low range (doesn't check if port was really allocated

delEvent

public bool delEvent(Sptr session)
delete session from rtp processor
Returns: false if session in invalud state

destroy

public static void destroy()
frees the memory associated with singelton instance

instance

public static RtspRtpProcessor & instance()
create a singelton object

playThreadLoaded

public bool playThreadLoaded()
check if play thread is loaded. This check assumes play requests are spread across time

recordThreadLoaded

public bool recordThreadLoaded()
check if record thread is loaded. This check assumes record requests are spread across time

startThread

public void startThread()
start rtp processor threads

stopThread

public void stopThread()
stop rtp processor threads

Association Links

to Class RtspRtpProcessor

singelton object