OPAL  Version 3.18.8
OpalRTPMediaStream Class Reference

#include <rtp_stream.h>

Inheritance diagram for OpalRTPMediaStream:
Collaboration diagram for OpalRTPMediaStream:

Public Member Functions

virtual void PrintDetail (ostream &strm, const char *prefix=NULL, Details details=Details::All()) const
 
virtual PString GetPatchThreadName () const
 
RTP_SyncSourceId SetSyncSource () const
 
void SetSyncSource (RTP_SyncSourceId ssrc)
 
const PTimeInterval & GetReadTimeout () const
 
void SetReadTimeout (const PTimeInterval &t)
 
void SetRewriteHeaders (bool v)
 
void SetVideoUpdateThrottleTime (const PTimeInterval &time)
 
void SetPictureLossThrottleTime (const PTimeInterval &time)
 
Construction
 OpalRTPMediaStream (OpalRTPConnection &conn, const OpalMediaFormat &mediaFormat, bool isSource, OpalRTPSession &rtpSession)
 
 ~OpalRTPMediaStream ()
 
Overrides of OpalMediaStream class
virtual PBoolean Open ()
 
virtual bool IsOpen () const
 
virtual bool IsEstablished () const
 
virtual PBoolean Start ()
 
virtual void OnStartMediaPatch ()
 
virtual bool SetMediaPassThrough (OpalMediaStream &otherStream, bool bypass)
 
virtual PBoolean ReadPacket (RTP_DataFrame &packet)
 
virtual PBoolean WritePacket (RTP_DataFrame &packet)
 
virtual PBoolean SetDataSize (PINDEX dataSize, PINDEX frameTime)
 
virtual PBoolean IsSynchronous () const
 
virtual PBoolean RequiresPatchThread () const
 
virtual PBoolean SetPatch (OpalMediaPatch *patch)
 
virtual OpalRTPSessionGetRtpSession () const
 
virtual void GetJitterBufferDelay (OpalJitterBuffer::Init &info) const
 
virtual void SetJitterBufferDelay (const OpalJitterBuffer::Init &info)
 
virtual void GetStatistics (OpalMediaStatistics &statistics, bool fromPatch=false) const
 
- Public Member Functions inherited from OpalMediaStream
void PrintOn (ostream &strm) const
 
virtual OpalMediaFormat GetMediaFormat () const
 
virtual bool SetMediaFormat (const OpalMediaFormat &mediaFormat)
 
bool UpdateMediaFormat (const OpalMediaFormat &mediaFormat, bool mergeOnly=false)
 
bool ExecuteCommand (const OpalMediaCommand &command) const
 
virtual PBoolean Close ()
 
virtual void OnStopMediaPatch (OpalMediaPatch &patch)
 
virtual PBoolean WritePackets (RTP_DataFrameList &packets)
 
virtual PBoolean ReadData (BYTE *data, PINDEX size, PINDEX &length)
 
virtual PBoolean WriteData (const BYTE *data, PINDEX length, PINDEX &written)
 
virtual bool PushPacket (RTP_DataFrame &packet)
 
PINDEX GetDataSize () const
 
virtual PBoolean RequiresPatchThread (OpalMediaStream *stream) const
 
virtual bool RequireMediaTransportThread (OpalMediaStream &stream) const
 
virtual bool EnableJitterBuffer (bool enab=true)
 
OpalConnectionGetConnection () const
 
bool IsSource () const
 
bool IsSink () const
 
unsigned GetSessionID () const
 
void SetSessionID (unsigned id)
 
PString GetID () const
 
unsigned GetTimestamp () const
 
void SetTimestamp (unsigned ts)
 
bool GetMarker () const
 
void SetMarker (bool m)
 
bool IsPaused () const
 
bool SetPaused (bool pause)
 
OpalMediaPatchPtr GetPatch () const
 
void AddFilter (const PNotifier &filter, const OpalMediaFormat &stage=OpalMediaFormat()) const
 
bool RemoveFilter (const PNotifier &filter, const OpalMediaFormat &stage=OpalMediaFormat()) const
 
 P_DECLARE_BITWISE_ENUM (Details, 6,(DetailMinimum, DetailEOL, DetailNAT, DetailSecured, DetailFEC, DetailAudio, DetailAddresses))
 
 ~OpalMediaStream ()
 

Protected Member Functions

virtual void InternalClose ()
 
virtual bool InternalSetJitterBuffer (const OpalJitterBuffer::Init &init)
 
virtual bool InternalUpdateMediaFormat (const OpalMediaFormat &mediaFormat)
 
virtual bool InternalSetPaused (bool pause, bool fromUser, bool fromPatch)
 
virtual bool InternalExecuteCommand (const OpalMediaCommand &command)
 
 PDECLARE_RTPDataNotifier (OpalRTPMediaStream, OnReceivedPacket)
 
 PTRACE_THROTTLE (m_throttleWriteData, 3, 500)
 
 PTRACE_THROTTLE (m_throttleSendReport, 3, 500)
 
- Protected Member Functions inherited from OpalMediaStream
OpalMediaPatchPtr InternalSetPatchPart1 (OpalMediaPatch *newPatch)
 
void InternalSetPatchPart2 (const OpalMediaPatchPtr &oldPatch)
 
 OpalMediaStream (OpalConnection &conn, const OpalMediaFormat &mediaFormat, unsigned sessionID, bool isSource)
 

Protected Attributes

OpalRTPSessionm_rtpSession
 
bool m_rewriteHeaders
 
RTP_SyncSourceId m_syncSource
 
unsigned m_notifierPriority
 
OpalMediaStreamPtr m_passThruStream
 
OpalJitterBufferm_jitterBuffer
 
PTimeInterval m_readTimeout
 
bool m_forceIntraFrameFlag
 
PSimpleTimer m_forceIntraFrameTimer
 
PSimpleTimer m_videoUpdateThrottleTimer
 
PTimeInterval m_videoUpdateThrottleTime
 
PSimpleTimer m_pictureLossThrottleTimer
 
PTimeInterval m_pictureLossThrottleTime
 
OpalRTPSession::DataNotifier m_receiveNotifier
 
- Protected Attributes inherited from OpalMediaStream
OpalConnectionm_connection
 
unsigned m_sessionID
 
WORD m_sequenceNumber
 
RTP_SyncSourceId m_syncSourceId
 
PString m_identifier
 
OpalMediaFormat m_mediaFormat
 
atomic< bool > m_paused
 
bool m_isSource
 
atomic< bool > m_isOpen
 
PINDEX m_defaultDataSize
 
unsigned m_timestamp
 
bool m_marker
 
OpalMediaPatchPtr m_mediaPatch
 
RTP_DataFrame::PayloadTypes m_payloadType
 
unsigned m_frameTime
 
PINDEX m_frameSize
 

Additional Inherited Members

- Protected Types inherited from OpalMediaStream
typedef OpalMediaPatchPtr PatchPtr
 

Detailed Description

This class describes a media stream that transfers data to/from a RTP session.

Constructor & Destructor Documentation

OpalRTPMediaStream::OpalRTPMediaStream ( OpalRTPConnection conn,
const OpalMediaFormat mediaFormat,
bool  isSource,
OpalRTPSession rtpSession 
)

Construct a new media stream for RTP sessions. This will add a reference to the rtpSession passed in.

Parameters
connConnection that owns the stream
mediaFormatMedia format for stream
isSourceIs a source stream
rtpSessionRTP session to stream to/from
OpalRTPMediaStream::~OpalRTPMediaStream ( )

Destroy the media stream for RTP sessions. This will release the reference to the rtpSession passed into the constructor.

Member Function Documentation

virtual void OpalRTPMediaStream::GetJitterBufferDelay ( OpalJitterBuffer::Init info) const
virtual

Return current jitter buffer info

virtual PString OpalRTPMediaStream::GetPatchThreadName ( ) const
virtual

Reimplemented from OpalMediaStream.

const PTimeInterval& OpalRTPMediaStream::GetReadTimeout ( ) const
inline

References m_readTimeout.

virtual OpalRTPSession& OpalRTPMediaStream::GetRtpSession ( ) const
inlinevirtual

Return current RTP session

References m_rtpSession.

virtual void OpalRTPMediaStream::GetStatistics ( OpalMediaStatistics statistics,
bool  fromPatch = false 
) const
virtual

Reimplemented from OpalMediaStream.

virtual void OpalRTPMediaStream::InternalClose ( )
protectedvirtual

Close any internal components of the stream. This should be used in preference to overriding the Close() function as it is guaranteed to be called exactly once and avoids race conditions in the shut down sequence of a media stream.

Implements OpalMediaStream.

virtual bool OpalRTPMediaStream::InternalExecuteCommand ( const OpalMediaCommand command)
protectedvirtual

Reimplemented from OpalMediaStream.

virtual bool OpalRTPMediaStream::InternalSetJitterBuffer ( const OpalJitterBuffer::Init init)
protectedvirtual

Reimplemented from OpalMediaStream.

virtual bool OpalRTPMediaStream::InternalSetPaused ( bool  pause,
bool  fromUser,
bool  fromPatch 
)
protectedvirtual

Reimplemented from OpalMediaStream.

virtual bool OpalRTPMediaStream::InternalUpdateMediaFormat ( const OpalMediaFormat mediaFormat)
protectedvirtual

Reimplemented from OpalMediaStream.

virtual bool OpalRTPMediaStream::IsEstablished ( ) const
virtual

Returns true if the media stream is established.

Reimplemented from OpalMediaStream.

virtual bool OpalRTPMediaStream::IsOpen ( ) const
virtual

Returns true if the media stream is open.

Reimplemented from OpalMediaStream.

virtual PBoolean OpalRTPMediaStream::IsSynchronous ( ) const
virtual

Indicate if the media stream is synchronous. Returns false for RTP streams.

Implements OpalMediaStream.

virtual void OpalRTPMediaStream::OnStartMediaPatch ( )
virtual

Callback that is called on the source stream once the media patch has started. The default behaviour calls OpalConnection::OnMediaPatchStart()

Reimplemented from OpalMediaStream.

virtual PBoolean OpalRTPMediaStream::Open ( )
virtual

Open the media stream using the media format.

The default behaviour simply sets the isOpen variable to true.

Reimplemented from OpalMediaStream.

OpalRTPMediaStream::PDECLARE_RTPDataNotifier ( OpalRTPMediaStream  ,
OnReceivedPacket   
)
protected
virtual void OpalRTPMediaStream::PrintDetail ( ostream &  strm,
const char *  prefix = NULL,
Details  details = Details::All() 
) const
virtual

Reimplemented from OpalMediaStream.

OpalRTPMediaStream::PTRACE_THROTTLE ( m_throttleWriteData  ,
,
500   
)
protected
OpalRTPMediaStream::PTRACE_THROTTLE ( m_throttleSendReport  ,
,
500   
)
protected
virtual PBoolean OpalRTPMediaStream::ReadPacket ( RTP_DataFrame packet)
virtual

Read an RTP frame of data from the source media stream. The new behaviour simply calls OpalRTPSession::ReadData().

Reimplemented from OpalMediaStream.

virtual PBoolean OpalRTPMediaStream::RequiresPatchThread ( ) const
virtual

Indicate if the media stream requires a OpalMediaPatch thread (active patch). The default behaviour dermines if the media will be flowing between two RTP sessions within the same process. If so the OpalRTPConnection::OnLocalRTP() is called, and if it returns true indicating local handling then this function returns faklse to disable the patch thread.

Reimplemented from OpalMediaStream.

virtual PBoolean OpalRTPMediaStream::SetDataSize ( PINDEX  dataSize,
PINDEX  frameTime 
)
virtual

Set the data size in bytes that is expected to be used.

Parameters
dataSizeNew data size (in total)
frameTimeIndividual frame time (if applicable)

Reimplemented from OpalMediaStream.

virtual void OpalRTPMediaStream::SetJitterBufferDelay ( const OpalJitterBuffer::Init info)
virtual

Return current jitter buffer info

virtual bool OpalRTPMediaStream::SetMediaPassThrough ( OpalMediaStream otherStream,
bool  bypass 
)
virtual

Bypass media patch. Send media directly to/from the media streams.

Parameters
otherStreamStream to bypass media data to/from
bypassTurn bypass on or off

Reimplemented from OpalMediaStream.

virtual PBoolean OpalRTPMediaStream::SetPatch ( OpalMediaPatch patch)
virtual

Set the patch thread that is using this stream.

Parameters
patchMedia patch thread

Reimplemented from OpalMediaStream.

void OpalRTPMediaStream::SetPictureLossThrottleTime ( const PTimeInterval &  time)
inline

Set time between consecutive Picture Loss I-Frame requests. If negative then this is set to Round Trip Time * 2.

References m_pictureLossThrottleTime.

void OpalRTPMediaStream::SetReadTimeout ( const PTimeInterval &  t)
void OpalRTPMediaStream::SetRewriteHeaders ( bool  v)
inline

References m_rewriteHeaders.

RTP_SyncSourceId OpalRTPMediaStream::SetSyncSource ( ) const
inline

References m_syncSource.

void OpalRTPMediaStream::SetSyncSource ( RTP_SyncSourceId  ssrc)
void OpalRTPMediaStream::SetVideoUpdateThrottleTime ( const PTimeInterval &  time)
inline

Set time between consecutive Full I-Frame requests. If negative then this is set to Round Trip Time * 2.

References m_videoUpdateThrottleTime.

virtual PBoolean OpalRTPMediaStream::Start ( )
virtual

Start the media stream.

The default behaviour calls Resume() on the associated OpalMediaPatch thread if it was suspended.

Reimplemented from OpalMediaStream.

virtual PBoolean OpalRTPMediaStream::WritePacket ( RTP_DataFrame packet)
virtual

Write an RTP frame of data to the sink media stream. The new behaviour simply calls OpalRTPSession::WriteData().

Reimplemented from OpalMediaStream.

Field Documentation

bool OpalRTPMediaStream::m_forceIntraFrameFlag
protected
PSimpleTimer OpalRTPMediaStream::m_forceIntraFrameTimer
protected
OpalJitterBuffer* OpalRTPMediaStream::m_jitterBuffer
protected
unsigned OpalRTPMediaStream::m_notifierPriority
protected
OpalMediaStreamPtr OpalRTPMediaStream::m_passThruStream
protected
PTimeInterval OpalRTPMediaStream::m_pictureLossThrottleTime
protected
PSimpleTimer OpalRTPMediaStream::m_pictureLossThrottleTimer
protected
PTimeInterval OpalRTPMediaStream::m_readTimeout
protected

Referenced by GetReadTimeout().

OpalRTPSession::DataNotifier OpalRTPMediaStream::m_receiveNotifier
protected
bool OpalRTPMediaStream::m_rewriteHeaders
protected

Referenced by SetRewriteHeaders().

OpalRTPSession& OpalRTPMediaStream::m_rtpSession
protected

Referenced by GetRtpSession().

RTP_SyncSourceId OpalRTPMediaStream::m_syncSource
protected

Referenced by SetSyncSource().

PTimeInterval OpalRTPMediaStream::m_videoUpdateThrottleTime
protected
PSimpleTimer OpalRTPMediaStream::m_videoUpdateThrottleTimer
protected

The documentation for this class was generated from the following file: