RTP_Session Class Reference

Inheritance diagram for RTP_Session:

RTP_UDP List of all members.

Call back functions

enum  SendReceiveStatus { e_ProcessPacket, e_IgnorePacket, e_AbortTransport }
virtual SendReceiveStatus OnSendData (RTP_DataFrame &frame)
virtual SendReceiveStatus OnReceiveData (const RTP_DataFrame &frame, const RTP_UDP &rtp)
virtual SendReceiveStatus OnReceiveControl (RTP_ControlFrame &frame)

Public Types

enum  { DefaultAudioSessionID = 1, DefaultVideoSessionID = 2, DefaultFaxSessionID = 3, DefaultExtVideoSessionID = 5 }

Public Member Functions

Construction
 RTP_Session (unsigned id, RTP_UserData *userData=NULL)
 ~RTP_Session ()
Operations
void SetJitterBufferSize (unsigned minJitterDelay, unsigned maxJitterDelay, PINDEX stackSize=30000)
unsigned GetJitterBufferSize () const
virtual BOOL ModifyQOS (RTP_QOS *)
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 WriteControl (RTP_ControlFrame &frame)=0
virtual BOOL SendReport ()
virtual void Close (BOOL reading)=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)
DWORD GetSyncSourceOut () const
void IncrementReference ()
BOOL DecrementReference ()
BOOL WillIgnoreOtherSources () const
void SetIgnoreOtherSources (BOOL ignore)
BOOL WillIgnoreOutOfOrderPackets () const
void SetIgnoreOutOfOrderPackets (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 GetMaximumSendTime () const
DWORD GetMinimumSendTime () const
DWORD GetAverageReceiveTime () const
DWORD GetMaximumReceiveTime () const
DWORD GetMinimumReceiveTime () const
DWORD GetAvgJitterTime () const
DWORD GetMaxJitterTime () const
PTime GetFirstDataReceivedTime () const
PString GetLocalTransportAddress () const
PString GetRemoteTransportAddress () const
Functions added to RTP aggregator
virtual int GetDataSocketHandle () const
virtual int GetControlSocketHandle () const

Protected Member Functions

void AddReceiverReport (RTP_ControlFrame::ReceiverReport &receiver)

Protected Attributes

unsigned sessionID
PString canonicalName
PString toolName
unsigned referenceCount
RTP_UserDatauserData
RTP_JitterBufferjitter
BOOL ignoreOtherSources
BOOL ignoreOutOfOrderPackets
DWORD syncSourceOut
DWORD syncSourceIn
PTimeInterval reportTimeInterval
unsigned txStatisticsInterval
unsigned rxStatisticsInterval
WORD lastSentSequenceNumber
WORD expectedSequenceNumber
DWORD lastSentTimestamp
PTimeInterval lastSentPacketTime
PTimeInterval lastReceivedPacketTime
WORD lastRRSequenceNumber
PINDEX consecutiveOutOfOrderPackets
DWORD packetsSent
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
PString localAddress
PString remoteAddress
unsigned txStatisticsCount
unsigned rxStatisticsCount
DWORD averageSendTimeAccum
DWORD maximumSendTimeAccum
DWORD minimumSendTimeAccum
DWORD averageReceiveTimeAccum
DWORD maximumReceiveTimeAccum
DWORD minimumReceiveTimeAccum
DWORD packetsLostSinceLastRR
DWORD lastTransitTime
PTime firstDataReceivedTime
PMutex reportMutex
PTimer reportTimer

Classes

class  ReceiverReport
class  SenderReport
class  SourceDescription

Detailed Description

Definition at line 530 of file rtp.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
DefaultAudioSessionID 
DefaultVideoSessionID 
DefaultFaxSessionID 
DefaultExtVideoSessionID 

Definition at line 535 of file rtp.h.

enum RTP_Session::SendReceiveStatus

Enumerator:
e_ProcessPacket 
e_IgnorePacket 
e_AbortTransport 

Definition at line 637 of file rtp.h.


Constructor & Destructor Documentation

RTP_Session::RTP_Session ( unsigned  id,
RTP_UserData userData = NULL 
)

Create a new RTP session.

Parameters:
id  Session ID for RTP channel
userData  Optional data for session.

Definition at line 732 of file rtp.cxx.

References averageReceiveTime, averageReceiveTimeAccum, averageSendTime, averageSendTimeAccum, consecutiveOutOfOrderPackets, expectedSequenceNumber, ignoreOtherSources, ignoreOutOfOrderPackets, jitter, jitterLevel, lastRRSequenceNumber, lastSentSequenceNumber, lastTransitTime, localAddress, maximumJitterLevel, maximumReceiveTime, maximumReceiveTimeAccum, maximumSendTime, maximumSendTimeAccum, minimumReceiveTime, minimumReceiveTimeAccum, minimumSendTime, minimumSendTimeAccum, octetsReceived, octetsSent, packetsLost, packetsLostSinceLastRR, packetsOutOfOrder, packetsReceived, packetsSent, referenceCount, remoteAddress, rxStatisticsCount, rxStatisticsInterval, sessionID, syncSourceIn, syncSourceOut, txStatisticsCount, txStatisticsInterval, and userData.

RTP_Session::~RTP_Session (  ) 

Delete a session. This deletes the userData field.

Definition at line 800 of file rtp.cxx.

References averageReceiveTime, averageSendTime, GetPacketsTooLate(), jitter, jitterLevel, maximumJitterLevel, maximumReceiveTime, maximumSendTime, minimumReceiveTime, minimumSendTime, octetsReceived, octetsSent, RTP_UserData::OnFinalStatistics(), packetsLost, packetsOutOfOrder, packetsReceived, packetsSent, and userData.


Member Function Documentation

void RTP_Session::SetJitterBufferSize ( unsigned  minJitterDelay,
unsigned  maxJitterDelay,
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
stackSize  Stack size for jitter thread

Definition at line 869 of file rtp.cxx.

References jitter, RTP_JitterBuffer::Resume(), RTP_JitterBuffer::SetDelay(), and SetIgnoreOutOfOrderPackets().

Referenced by H323_RTPChannel::Receive().

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.

Definition at line 898 of file rtp.cxx.

References RTP_JitterBuffer::GetJitterTime(), and jitter.

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

Modifies the QOS specifications for this RTP session

Reimplemented in RTP_UDP.

Definition at line 585 of file rtp.h.

BOOL RTP_Session::ReadBufferedData ( DWORD  timestamp,
RTP_DataFrame frame 
)

Read a data frame from the RTP channel. This function will conditionally read data from eth 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

Definition at line 908 of file rtp.cxx.

References jitter, ReadData(), and RTP_JitterBuffer::ReadData().

Referenced by H323_RTPChannel::Receive().

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.

Referenced by RTP_JitterBuffer::OnRead(), and ReadBufferedData().

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.

Referenced by H323_RTPChannel::Transmit().

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.

Referenced by SendReport().

BOOL RTP_Session::SendReport (  )  [virtual]

Write the RTCP reports.

Definition at line 1173 of file rtp.cxx.

References AddReceiverReport(), RTP_ControlFrame::AddSourceDescription(), RTP_ControlFrame::AddSourceDescriptionItem(), canonicalName, RTP_ControlFrame::e_CNAME, RTP_ControlFrame::e_ReceiverReport, RTP_ControlFrame::e_SenderReport, RTP_ControlFrame::e_TOOL, RTP_ControlFrame::GetPayloadPtr(), lastSentTimestamp, octetsSent, packetsReceived, packetsSent, reportMutex, reportTimeInterval, reportTimer, RTP_ControlFrame::SetCount(), RTP_ControlFrame::SetPayloadSize(), RTP_ControlFrame::SetPayloadType(), syncSourceIn, syncSourceOut, toolName, WriteControl(), and RTP_ControlFrame::WriteNextCompound().

Referenced by OnReceiveData(), OnSendData(), and RTP_UDP::ReadData().

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.

Referenced by H323_RTPChannel::CleanUpOnTermination().

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

Get the local host name as used in SDES packes.

Implemented in RTP_UDP.

unsigned RTP_Session::GetSessionID (  )  const [inline]

Get the ID for the RTP session.

Definition at line 700 of file rtp.h.

References sessionID.

Referenced by RTP_SessionManager::AddSession(), H323_RTPChannel::GetSessionID(), H323_RTP_UDP::OnReceivedAckPDU(), H323_RTP_UDP::OnReceivedPDU(), H323_RTP_UDP::OnSendingPDU(), and H323_RTP_UDP::OnSendRasInfo().

PString RTP_Session::GetCanonicalName (  )  const

Get the canonical name for the RTP session.

Definition at line 830 of file rtp.cxx.

References canonicalName, and reportMutex.

Referenced by H323_RTP_UDP::OnSendRasInfo().

void RTP_Session::SetCanonicalName ( const PString &  name  ) 

Set the canonical name for the RTP session.

Definition at line 839 of file rtp.cxx.

References canonicalName, and reportMutex.

PString RTP_Session::GetToolName (  )  const

Get the tool name for the RTP session.

Definition at line 846 of file rtp.cxx.

References reportMutex, and toolName.

void RTP_Session::SetToolName ( const PString &  name  ) 

Set the tool name for the RTP session.

Definition at line 855 of file rtp.cxx.

References reportMutex, and toolName.

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

Get the user data for the session.

Definition at line 720 of file rtp.h.

References userData.

Referenced by H323Connection::GetSessionCallbacks().

void RTP_Session::SetUserData ( RTP_UserData data  ) 

Set the user data for the session.

Parameters:
data  New user data to be used

Definition at line 862 of file rtp.cxx.

References userData.

Referenced by H323Connection::UseSession().

DWORD RTP_Session::GetSyncSourceOut (  )  const [inline]

Get the source output identifier.

Definition at line 730 of file rtp.h.

References syncSourceOut.

Referenced by H323_RTP_UDP::OnSendRasInfo().

void RTP_Session::IncrementReference (  )  [inline]

Increment reference count for RTP session.

Definition at line 734 of file rtp.h.

References referenceCount.

Referenced by RTP_SessionManager::UseSession().

BOOL RTP_Session::DecrementReference (  )  [inline]

Decrement reference count for RTP session.

Definition at line 738 of file rtp.h.

References referenceCount.

BOOL RTP_Session::WillIgnoreOtherSources (  )  const [inline]

Indicate if will ignore all but first received SSRC value.

Definition at line 742 of file rtp.h.

References ignoreOtherSources.

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

Definition at line 746 of file rtp.h.

References ignoreOtherSources.

BOOL RTP_Session::WillIgnoreOutOfOrderPackets (  )  const [inline]

Indicate if will ignore out of order packets.

Definition at line 752 of file rtp.h.

References ignoreOutOfOrderPackets.

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

Indicate if will ignore out of order packets.

Parameters:
ignore  Flag for ignore out of order packets

Definition at line 756 of file rtp.h.

References ignoreOutOfOrderPackets.

Referenced by SetJitterBufferSize().

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

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

Definition at line 762 of file rtp.h.

References reportTimeInterval.

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.

Definition at line 766 of file rtp.h.

References reportTimeInterval.

PTimeInterval RTP_Session::GetReportTimer (  )  [inline]

Get the current report timer

Definition at line 772 of file rtp.h.

References reportTimer.

unsigned RTP_Session::GetTxStatisticsInterval (  )  [inline]

Get the interval for transmitter statistics in the session.

Definition at line 777 of file rtp.h.

References txStatisticsInterval.

void RTP_Session::SetTxStatisticsInterval ( unsigned  packets  ) 

Set the interval for transmitter statistics in the session.

Parameters:
packets  Number of packets between callbacks

Definition at line 919 of file rtp.cxx.

References averageSendTimeAccum, maximumSendTimeAccum, minimumSendTimeAccum, txStatisticsCount, and txStatisticsInterval.

unsigned RTP_Session::GetRxStatisticsInterval (  )  [inline]

Get the interval for receiver statistics in the session.

Definition at line 787 of file rtp.h.

References rxStatisticsInterval.

void RTP_Session::SetRxStatisticsInterval ( unsigned  packets  ) 

Set the interval for receiver statistics in the session.

Parameters:
packets  Number of packets between callbacks

Definition at line 929 of file rtp.cxx.

References averageReceiveTimeAccum, maximumReceiveTimeAccum, minimumReceiveTimeAccum, rxStatisticsCount, and rxStatisticsInterval.

DWORD RTP_Session::GetPacketsSent (  )  const [inline]

Get total number of packets sent in session.

Definition at line 797 of file rtp.h.

References packetsSent.

DWORD RTP_Session::GetOctetsSent (  )  const [inline]

Get total number of octets sent in session.

Definition at line 801 of file rtp.h.

References octetsSent.

DWORD RTP_Session::GetPacketsReceived (  )  const [inline]

Get total number of packets received in session.

Definition at line 805 of file rtp.h.

References packetsReceived.

DWORD RTP_Session::GetOctetsReceived (  )  const [inline]

Get total number of octets received in session.

Definition at line 809 of file rtp.h.

References octetsReceived.

DWORD RTP_Session::GetPacketsLost (  )  const [inline]

Get total number received packets lost in session.

Definition at line 813 of file rtp.h.

References packetsLost.

DWORD RTP_Session::GetPacketsOutOfOrder (  )  const [inline]

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

Definition at line 817 of file rtp.h.

References packetsOutOfOrder.

DWORD RTP_Session::GetPacketsTooLate (  )  const

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

Definition at line 1450 of file rtp.cxx.

References RTP_JitterBuffer::GetPacketsTooLate(), and jitter.

Referenced by OnReceiveData(), and ~RTP_Session().

DWORD RTP_Session::GetAverageSendTime (  )  const [inline]

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

Definition at line 827 of file rtp.h.

References averageSendTime.

DWORD RTP_Session::GetMaximumSendTime (  )  const [inline]

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

Definition at line 833 of file rtp.h.

References maximumSendTime.

DWORD RTP_Session::GetMinimumSendTime (  )  const [inline]

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

Definition at line 839 of file rtp.h.

References minimumSendTime.

DWORD RTP_Session::GetAverageReceiveTime (  )  const [inline]

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

Definition at line 845 of file rtp.h.

References averageReceiveTime.

DWORD RTP_Session::GetMaximumReceiveTime (  )  const [inline]

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

Definition at line 851 of file rtp.h.

References maximumReceiveTime.

DWORD RTP_Session::GetMinimumReceiveTime (  )  const [inline]

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

Definition at line 857 of file rtp.h.

References minimumReceiveTime.

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.

Definition at line 863 of file rtp.h.

References jitterLevel.

DWORD RTP_Session::GetMaxJitterTime (  )  const [inline]

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

Definition at line 868 of file rtp.h.

References maximumJitterLevel.

PTime RTP_Session::GetFirstDataReceivedTime (  )  const [inline]

return the timestamp at which the first packet of RTP data was received

Definition at line 873 of file rtp.h.

References firstDataReceivedTime.

PString RTP_Session::GetLocalTransportAddress (  )  const [inline]

return the local Transport Address

Definition at line 878 of file rtp.h.

References localAddress.

PString RTP_Session::GetRemoteTransportAddress (  )  const [inline]

return the remote Transport Address

Definition at line 883 of file rtp.h.

References remoteAddress.


The documentation for this class was generated from the following files:
Generated on Thu Oct 25 13:46:13 2007 for h323plus by  doxygen 1.5.2