RTP_Session Class Reference

#include <rtp.h>

Inheritance diagram for RTP_Session:

RTP_UDP SecureRTP_UDP T38PseudoRTP List of all members.

Call back functions

enum  SendReceiveStatus { e_ProcessPacket, e_IgnorePacket, e_AbortTransport }
virtual SendReceiveStatus OnSendData (RTP_DataFrame &frame)
virtual SendReceiveStatus OnSendControl (RTP_ControlFrame &frame, PINDEX &len)
virtual SendReceiveStatus OnReceiveData (RTP_DataFrame &frame)
virtual SendReceiveStatus OnReceiveControl (RTP_ControlFrame &frame)
 PARRAY (ReceiverReportArray, ReceiverReport)
virtual void OnRxSenderReport (const SenderReport &sender, const ReceiverReportArray &reports)
virtual void OnRxReceiverReport (DWORD src, const ReceiverReportArray &reports)
 PARRAY (SourceDescriptionArray, SourceDescription)
virtual void OnRxSourceDescription (const SourceDescriptionArray &descriptions)
virtual void OnRxGoodbye (const PDWORDArray &sources, const PString &reason)
virtual void OnRxApplDefined (const PString &type, unsigned subtype, DWORD src, const BYTE *data, PINDEX size)

Public Member Functions

virtual void SendBYE ()
virtual void SetCloseOnBYE (BOOL v)
Operations
void SetJitterBufferSize (unsigned minJitterDelay, unsigned maxJitterDelay, unsigned timeUnits=8, PINDEX stackSize=30000)
unsigned GetJitterBufferSize () const
unsigned GetJitterTimeUnits () const
virtual BOOL ModifyQOS (RTP_QOS *)
virtual BOOL ReadBufferedData (DWORD timestamp, RTP_DataFrame &frame)
virtual BOOL ReadData (RTP_DataFrame &frame, BOOL loop)=0
virtual BOOL WriteData (RTP_DataFrame &frame)=0
virtual BOOL WriteOOBData (RTP_DataFrame &frame)
virtual BOOL WriteControl (RTP_ControlFrame &frame)=0
virtual BOOL SendReport ()
virtual void Close (BOOL reading)=0
virtual void Reopen (BOOL isReading)=0
virtual PString GetLocalHostName ()=0
Member variable access
unsigned GetSessionID () const
PString GetCanonicalName () const
void SetCanonicalName (const PString &name)
PString GetToolName () const
void SetToolName (const PString &name)
RTP_UserDataGetUserData () const
void SetUserData (RTP_UserData *data, BOOL autoDeleteUserData=TRUE)
DWORD GetSyncSourceOut () const
void IncrementReference ()
BOOL DecrementReference ()
BOOL WillIgnoreOtherSources () const
void SetIgnoreOtherSources (BOOL ignore)
BOOL WillIgnoreOutOfOrderPackets () const
void SetIgnoreOutOfOrderPackets (BOOL ignore)
void SetIgnorePayloadTypeChanges (BOOL ignore)
const PTimeInterval & GetReportTimeInterval ()
void SetReportTimeInterval (const PTimeInterval &interval)
PTimeInterval GetReportTimer ()
unsigned GetTxStatisticsInterval ()
void SetTxStatisticsInterval (unsigned packets)
unsigned GetRxStatisticsInterval ()
void SetRxStatisticsInterval (unsigned packets)
DWORD GetPacketsSent () const
DWORD GetOctetsSent () const
DWORD GetPacketsReceived () const
DWORD GetOctetsReceived () const
DWORD GetPacketsLost () const
DWORD GetPacketsOutOfOrder () const
DWORD GetPacketsTooLate () const
DWORD GetAverageSendTime () const
DWORD GetMarkerRecvCount () const
DWORD GetMarkerSendCount () const
DWORD GetMaximumSendTime () const
DWORD GetMinimumSendTime () const
DWORD GetAverageReceiveTime () const
DWORD GetMaximumReceiveTime () const
DWORD GetMinimumReceiveTime () const
DWORD GetAvgJitterTime () const
DWORD GetMaxJitterTime () const
Functions added to support RTP aggregation
virtual int GetDataSocketHandle () const
virtual int GetControlSocketHandle () const

Protected Member Functions

void AddReceiverReport (RTP_ControlFrame::ReceiverReport &receiver)
BOOL InsertReportPacket (RTP_ControlFrame &report)

Protected Attributes

unsigned sessionID
PString canonicalName
PString toolName
unsigned referenceCount
RTP_UserDatauserData
BOOL autoDeleteUserData
RTP_JitterBufferjitter
BOOL ignoreOtherSources
BOOL ignoreOutOfOrderPackets
DWORD syncSourceOut
DWORD syncSourceIn
DWORD lastSentTimestamp
BOOL allowSyncSourceInChange
BOOL allowRemoteTransmitAddressChange
BOOL allowSequenceChange
PTimeInterval reportTimeInterval
unsigned txStatisticsInterval
unsigned rxStatisticsInterval
WORD lastSentSequenceNumber
WORD expectedSequenceNumber
PTimeInterval lastSentPacketTime
PTimeInterval lastReceivedPacketTime
WORD lastRRSequenceNumber
PINDEX consecutiveOutOfOrderPackets
PMutex sendDataMutex
DWORD timeStampOut
DWORD timeStampOffs
BOOL timeStampOffsetEstablished
BOOL timeStampIsPremedia
DWORD packetsSent
DWORD rtcpPacketsSent
DWORD octetsSent
DWORD packetsReceived
DWORD octetsReceived
DWORD packetsLost
DWORD packetsOutOfOrder
DWORD averageSendTime
DWORD maximumSendTime
DWORD minimumSendTime
DWORD averageReceiveTime
DWORD maximumReceiveTime
DWORD minimumReceiveTime
DWORD jitterLevel
DWORD maximumJitterLevel
DWORD markerSendCount
DWORD markerRecvCount
unsigned txStatisticsCount
unsigned rxStatisticsCount
DWORD averageSendTimeAccum
DWORD maximumSendTimeAccum
DWORD minimumSendTimeAccum
DWORD averageReceiveTimeAccum
DWORD maximumReceiveTimeAccum
DWORD minimumReceiveTimeAccum
DWORD packetsLostSinceLastRR
DWORD lastTransitTime
RTP_DataFrame::PayloadTypes lastReceivedPayloadType
BOOL ignorePayloadTypeChanges
PMutex reportMutex
PTimer reportTimer
PHandleAggregatoraggregator
BOOL closeOnBye
BOOL byeSent

Classes

class  ReceiverReport
class  SenderReport
class  SourceDescription

Detailed Description

This class is for encpsulating the IETF Real Time Protocol interface.


Member Enumeration Documentation

enum RTP_Session::SendReceiveStatus

Enumerator:
e_ProcessPacket 
e_IgnorePacket 
e_AbortTransport 


Constructor & Destructor Documentation

RTP_Session::RTP_Session ( PHandleAggregator aggregator,
unsigned  id,
RTP_UserData userData = NULL,
BOOL  autoDeleteUserData = TRUE 
)

Create a new RTP session.

Parameters:
aggregator  RTP aggregator
id  Session ID for RTP channel
userData  Optional data for session.
autoDeleteUserData  Delete optional data with session.

RTP_Session::~RTP_Session (  ) 

Delete a session. This deletes the userData field if autoDeleteUserData is TRUE.

RTP_Session::RTP_Session ( PHandleAggregator aggregator,
unsigned  id,
RTP_UserData userData = NULL,
BOOL  autoDeleteUserData = TRUE 
)

Create a new RTP session.

Parameters:
aggregator  RTP aggregator
id  Session ID for RTP channel
userData  Optional data for session.
autoDeleteUserData  Delete optional data with session.

RTP_Session::~RTP_Session (  ) 

Delete a session. This deletes the userData field if autoDeleteUserData is TRUE.


Member Function Documentation

void RTP_Session::SetJitterBufferSize ( unsigned  minJitterDelay,
unsigned  maxJitterDelay,
unsigned  timeUnits = 8,
PINDEX  stackSize = 30000 
)

Sets the size of the jitter buffer to be used by this RTP session. A session default to not having any jitter buffer enabled for reading and the ReadBufferedData() function simply calls ReadData(). Once a jitter buffer has been created it cannot be removed, though its size may be adjusted.

If the jitterDelay paramter is zero, it destroys the jitter buffer attached to this RTP session.

Parameters:
minJitterDelay  Minimum jitter buffer delay in RTP timestamp units
maxJitterDelay  Maximum jitter buffer delay in RTP timestamp units
timeUnits  Time Units
stackSize  Stack size for jitter thread

unsigned RTP_Session::GetJitterBufferSize (  )  const

Get current size of the jitter buffer. This returns the currently used jitter buffer delay in RTP timestamp units. It will be some value between the minimum and maximum set in the SetJitterBufferSize() function.

unsigned RTP_Session::GetJitterTimeUnits (  )  const

Get current time units of the jitter buffer.

virtual BOOL RTP_Session::ModifyQOS ( RTP_QOS  )  [inline, virtual]

Modifies the QOS specifications for this RTP session

Reimplemented in RTP_UDP.

virtual BOOL RTP_Session::ReadBufferedData ( DWORD  timestamp,
RTP_DataFrame frame 
) [virtual]

Read a data frame from the RTP channel. This function will conditionally read data from the jitter buffer or directly if there is no jitter buffer enabled. An application should generally use this in preference to directly calling ReadData().

Parameters:
timestamp  Timestamp to read from buffer.
frame  Frame read from the RTP session

virtual BOOL RTP_Session::ReadData ( RTP_DataFrame frame,
BOOL  loop 
) [pure virtual]

Read a data frame from the RTP channel. Any control frames received are dispatched to callbacks and are not returned by this function. It will block until a data frame is available or an error occurs.

Parameters:
frame  Frame read from the RTP session
loop  If TRUE, loop as long as data is available, if FALSE, only process once

Implemented in RTP_UDP, and T38PseudoRTP.

virtual BOOL RTP_Session::WriteData ( RTP_DataFrame frame  )  [pure virtual]

Write a data frame from the RTP channel.

Parameters:
frame  Frame to write to the RTP session

Implemented in RTP_UDP, and T38PseudoRTP.

virtual BOOL RTP_Session::WriteOOBData ( RTP_DataFrame frame  )  [virtual]

Write data frame to the RTP channel outside the normal stream of media Used for RFC2833 packets

Reimplemented in RTP_UDP.

virtual BOOL RTP_Session::WriteControl ( RTP_ControlFrame frame  )  [pure virtual]

Write a control frame from the RTP channel.

Parameters:
frame  Frame to write to the RTP session

Implemented in RTP_UDP.

virtual BOOL RTP_Session::SendReport (  )  [virtual]

Write the RTCP reports.

virtual void RTP_Session::Close ( BOOL  reading  )  [pure virtual]

Close down the RTP session.

Parameters:
reading  Closing the read side of the session

Implemented in RTP_UDP.

virtual void RTP_Session::Reopen ( BOOL  isReading  )  [pure virtual]

Reopens an existing session in the given direction.

Implemented in RTP_UDP.

virtual PString RTP_Session::GetLocalHostName (  )  [pure virtual]

Get the local host name as used in SDES packes.

Implemented in RTP_UDP.

virtual SendReceiveStatus RTP_Session::OnSendData ( RTP_DataFrame frame  )  [virtual]

Reimplemented in T38PseudoRTP.

virtual SendReceiveStatus RTP_Session::OnSendControl ( RTP_ControlFrame frame,
PINDEX &  len 
) [virtual]

Reimplemented in T38PseudoRTP.

virtual SendReceiveStatus RTP_Session::OnReceiveData ( RTP_DataFrame frame  )  [virtual]

Reimplemented in T38PseudoRTP.

virtual SendReceiveStatus RTP_Session::OnReceiveControl ( RTP_ControlFrame frame  )  [virtual]

RTP_Session::PARRAY ( ReceiverReportArray  ,
ReceiverReport   
)

virtual void RTP_Session::OnRxSenderReport ( const SenderReport sender,
const ReceiverReportArray &  reports 
) [virtual]

virtual void RTP_Session::OnRxReceiverReport ( DWORD  src,
const ReceiverReportArray &  reports 
) [virtual]

RTP_Session::PARRAY ( SourceDescriptionArray  ,
SourceDescription   
)

virtual void RTP_Session::OnRxSourceDescription ( const SourceDescriptionArray &  descriptions  )  [virtual]

virtual void RTP_Session::OnRxGoodbye ( const PDWORDArray &  sources,
const PString &  reason 
) [virtual]

virtual void RTP_Session::OnRxApplDefined ( const PString &  type,
unsigned  subtype,
DWORD  src,
const BYTE *  data,
PINDEX  size 
) [virtual]

unsigned RTP_Session::GetSessionID (  )  const [inline]

Get the ID for the RTP session.

PString RTP_Session::GetCanonicalName (  )  const

Get the canonical name for the RTP session.

void RTP_Session::SetCanonicalName ( const PString &  name  ) 

Set the canonical name for the RTP session.

PString RTP_Session::GetToolName (  )  const

Get the tool name for the RTP session.

void RTP_Session::SetToolName ( const PString &  name  ) 

Set the tool name for the RTP session.

RTP_UserData* RTP_Session::GetUserData (  )  const [inline]

Get the user data for the session.

void RTP_Session::SetUserData ( RTP_UserData data,
BOOL  autoDeleteUserData = TRUE 
)

Set the user data for the session.

Parameters:
data  New user data to be used
autoDeleteUserData  Delete optional data with session.

DWORD RTP_Session::GetSyncSourceOut (  )  const [inline]

Get the source output identifier.

void RTP_Session::IncrementReference (  )  [inline]

Increment reference count for RTP session.

BOOL RTP_Session::DecrementReference (  )  [inline]

Decrement reference count for RTP session.

BOOL RTP_Session::WillIgnoreOtherSources (  )  const [inline]

Indicate if will ignore all but first received SSRC value.

void RTP_Session::SetIgnoreOtherSources ( BOOL  ignore  )  [inline]

Indicate if will ignore all but first received SSRC value.

Parameters:
ignore  Flag for ignore other SSRC values

BOOL RTP_Session::WillIgnoreOutOfOrderPackets (  )  const [inline]

Indicate if will ignore out of order packets.

void RTP_Session::SetIgnoreOutOfOrderPackets ( BOOL  ignore  )  [inline]

Indicate if will ignore out of order packets.

Parameters:
ignore  Flag for ignore out of order packets

void RTP_Session::SetIgnorePayloadTypeChanges ( BOOL  ignore  )  [inline]

Indicate if will ignore rtp payload type changes in received packets.

Parameters:
ignore  Flag to ignore payload type changes

const PTimeInterval& RTP_Session::GetReportTimeInterval (  )  [inline]

Get the time interval for sending RTCP reports in the session.

void RTP_Session::SetReportTimeInterval ( const PTimeInterval &  interval  )  [inline]

Set the time interval for sending RTCP reports in the session.

Parameters:
interval  New time interval for reports.

PTimeInterval RTP_Session::GetReportTimer (  )  [inline]

Get the current report timer

unsigned RTP_Session::GetTxStatisticsInterval (  )  [inline]

Get the interval for transmitter statistics in the session.

void RTP_Session::SetTxStatisticsInterval ( unsigned  packets  ) 

Set the interval for transmitter statistics in the session.

Parameters:
packets  Number of packets between callbacks

unsigned RTP_Session::GetRxStatisticsInterval (  )  [inline]

Get the interval for receiver statistics in the session.

void RTP_Session::SetRxStatisticsInterval ( unsigned  packets  ) 

Set the interval for receiver statistics in the session.

Parameters:
packets  Number of packets between callbacks

DWORD RTP_Session::GetPacketsSent (  )  const [inline]

Get total number of packets sent in session.

DWORD RTP_Session::GetOctetsSent (  )  const [inline]

Get total number of octets sent in session.

DWORD RTP_Session::GetPacketsReceived (  )  const [inline]

Get total number of packets received in session.

DWORD RTP_Session::GetOctetsReceived (  )  const [inline]

Get total number of octets received in session.

DWORD RTP_Session::GetPacketsLost (  )  const [inline]

Get total number received packets lost in session.

DWORD RTP_Session::GetPacketsOutOfOrder (  )  const [inline]

Get total number of packets received out of order in session.

DWORD RTP_Session::GetPacketsTooLate (  )  const

Get total number received packets too late to go into jitter buffer.

DWORD RTP_Session::GetAverageSendTime (  )  const [inline]

Get average time between sent packets. This is averaged over the last txStatisticsInterval packets and is in milliseconds.

DWORD RTP_Session::GetMarkerRecvCount (  )  const [inline]

Get the number of marker packets received this session. This can be used to find out the number of frames received in a video RTP stream.

DWORD RTP_Session::GetMarkerSendCount (  )  const [inline]

Get the number of marker packets sent this session. This can be used to find out the number of frames sent in a video RTP stream.

DWORD RTP_Session::GetMaximumSendTime (  )  const [inline]

Get maximum time between sent packets. This is over the last txStatisticsInterval packets and is in milliseconds.

DWORD RTP_Session::GetMinimumSendTime (  )  const [inline]

Get minimum time between sent packets. This is over the last txStatisticsInterval packets and is in milliseconds.

DWORD RTP_Session::GetAverageReceiveTime (  )  const [inline]

Get average time between received packets. This is averaged over the last rxStatisticsInterval packets and is in milliseconds.

DWORD RTP_Session::GetMaximumReceiveTime (  )  const [inline]

Get maximum time between received packets. This is over the last rxStatisticsInterval packets and is in milliseconds.

DWORD RTP_Session::GetMinimumReceiveTime (  )  const [inline]

Get minimum time between received packets. This is over the last rxStatisticsInterval packets and is in milliseconds.

DWORD RTP_Session::GetAvgJitterTime (  )  const [inline]

Get averaged jitter time for received packets. This is the calculated statistical variance of the interarrival time of received packets in milliseconds.

DWORD RTP_Session::GetMaxJitterTime (  )  const [inline]

Get averaged jitter time for received packets. This is the maximum value of jitterLevel for the session.

virtual int RTP_Session::GetDataSocketHandle (  )  const [inline, virtual]

Reimplemented in RTP_UDP.

virtual int RTP_Session::GetControlSocketHandle (  )  const [inline, virtual]

Reimplemented in RTP_UDP.

virtual void RTP_Session::SendBYE (  )  [virtual]

virtual void RTP_Session::SetCloseOnBYE ( BOOL  v  )  [inline, virtual]

void RTP_Session::AddReceiverReport ( RTP_ControlFrame::ReceiverReport receiver  )  [protected]

BOOL RTP_Session::InsertReportPacket ( RTP_ControlFrame report  )  [protected]


Member Data Documentation

unsigned RTP_Session::sessionID [protected]

PString RTP_Session::canonicalName [protected]

PString RTP_Session::toolName [protected]

unsigned RTP_Session::referenceCount [protected]

RTP_UserData* RTP_Session::userData [protected]

BOOL RTP_Session::autoDeleteUserData [protected]

RTP_JitterBuffer* RTP_Session::jitter [protected]

BOOL RTP_Session::ignoreOtherSources [protected]

BOOL RTP_Session::ignoreOutOfOrderPackets [protected]

DWORD RTP_Session::syncSourceOut [protected]

DWORD RTP_Session::syncSourceIn [protected]

DWORD RTP_Session::lastSentTimestamp [protected]

BOOL RTP_Session::allowSyncSourceInChange [protected]

BOOL RTP_Session::allowRemoteTransmitAddressChange [protected]

BOOL RTP_Session::allowSequenceChange [protected]

PTimeInterval RTP_Session::reportTimeInterval [protected]

unsigned RTP_Session::txStatisticsInterval [protected]

unsigned RTP_Session::rxStatisticsInterval [protected]

WORD RTP_Session::lastSentSequenceNumber [protected]

WORD RTP_Session::expectedSequenceNumber [protected]

PTimeInterval RTP_Session::lastSentPacketTime [protected]

PTimeInterval RTP_Session::lastReceivedPacketTime [protected]

WORD RTP_Session::lastRRSequenceNumber [protected]

PINDEX RTP_Session::consecutiveOutOfOrderPackets [protected]

PMutex RTP_Session::sendDataMutex [protected]

DWORD RTP_Session::timeStampOut [protected]

DWORD RTP_Session::timeStampOffs [protected]

BOOL RTP_Session::timeStampOffsetEstablished [protected]

BOOL RTP_Session::timeStampIsPremedia [protected]

DWORD RTP_Session::packetsSent [protected]

DWORD RTP_Session::rtcpPacketsSent [protected]

DWORD RTP_Session::octetsSent [protected]

DWORD RTP_Session::packetsReceived [protected]

DWORD RTP_Session::octetsReceived [protected]

DWORD RTP_Session::packetsLost [protected]

DWORD RTP_Session::packetsOutOfOrder [protected]

DWORD RTP_Session::averageSendTime [protected]

DWORD RTP_Session::maximumSendTime [protected]

DWORD RTP_Session::minimumSendTime [protected]

DWORD RTP_Session::averageReceiveTime [protected]

DWORD RTP_Session::maximumReceiveTime [protected]

DWORD RTP_Session::minimumReceiveTime [protected]

DWORD RTP_Session::jitterLevel [protected]

DWORD RTP_Session::maximumJitterLevel [protected]

DWORD RTP_Session::markerSendCount [protected]

DWORD RTP_Session::markerRecvCount [protected]

unsigned RTP_Session::txStatisticsCount [protected]

unsigned RTP_Session::rxStatisticsCount [protected]

DWORD RTP_Session::averageSendTimeAccum [protected]

DWORD RTP_Session::maximumSendTimeAccum [protected]

DWORD RTP_Session::minimumSendTimeAccum [protected]

DWORD RTP_Session::averageReceiveTimeAccum [protected]

DWORD RTP_Session::maximumReceiveTimeAccum [protected]

DWORD RTP_Session::minimumReceiveTimeAccum [protected]

DWORD RTP_Session::packetsLostSinceLastRR [protected]

DWORD RTP_Session::lastTransitTime [protected]

RTP_DataFrame::PayloadTypes RTP_Session::lastReceivedPayloadType [protected]

BOOL RTP_Session::ignorePayloadTypeChanges [protected]

PMutex RTP_Session::reportMutex [protected]

PTimer RTP_Session::reportTimer [protected]

PHandleAggregator* RTP_Session::aggregator [protected]

BOOL RTP_Session::closeOnBye [protected]

BOOL RTP_Session::byeSent [protected]


The documentation for this class was generated from the following file:
Generated on Fri Mar 7 06:34:07 2008 for OPAL by  doxygen 1.5.1