OPAL  Version 3.10.4
OpalRTPMediaStream Class Reference

#include <mediastrm.h>

Inheritance diagram for OpalRTPMediaStream:
OpalMediaStream

Public Member Functions

Construction
 OpalRTPMediaStream (OpalRTPConnection &conn, const OpalMediaFormat &mediaFormat, bool isSource, RTP_Session &rtpSession, unsigned minAudioJitterDelay, unsigned maxAudioJitterDelay)
 ~OpalRTPMediaStream ()
Overrides of OpalMediaStream class
virtual PBoolean Open ()
virtual PBoolean Close ()
virtual bool SetPaused (bool pause, bool fromPatch=false)
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 bool EnableJitterBuffer (bool enab=true) const
virtual PBoolean SetPatch (OpalMediaPatch *patch)
virtual RTP_SessionGetRtpSession () const
virtual void GetStatistics (OpalMediaStatistics &statistics, bool fromPatch=false) const
- Public Member Functions inherited from OpalMediaStream
void PrintOn (ostream &strm) const
virtual OpalMediaFormat GetMediaFormat () const
bool UpdateMediaFormat (const OpalMediaFormat &mediaFormat)
virtual bool InternalUpdateMediaFormat (const OpalMediaFormat &mediaFormat)
virtual PBoolean ExecuteCommand (const OpalMediaCommand &command)
virtual PBoolean Start ()
virtual void OnStartMediaPatch ()
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)
bool PushPacket (RTP_DataFrame &packet)
PINDEX GetDataSize () const
virtual PBoolean RequiresPatchThread (OpalMediaStream *stream) const
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 IsOpen () const
OpalMediaPatchGetPatch () const
void AddFilter (const PNotifier &filter, const OpalMediaFormat &stage=OpalMediaFormat()) const
bool RemoveFilter (const PNotifier &filter, const OpalMediaFormat &stage=OpalMediaFormat()) const
 ~OpalMediaStream ()

Protected Attributes

RTP_SessionrtpSession
unsigned minAudioJitterDelay
unsigned maxAudioJitterDelay
- Protected Attributes inherited from OpalMediaStream
OpalConnectionconnection
unsigned sessionID
PString identifier
OpalMediaFormat mediaFormat
bool m_paused
bool isSource
bool isOpen
PINDEX defaultDataSize
unsigned timestamp
bool marker
unsigned mismatchedPayloadTypes
OpalMediaPatchmediaPatch
RTP_DataFrame::PayloadTypes m_payloadType
unsigned m_frameTime
PINDEX m_frameSize

Additional Inherited Members

- Protected Member Functions inherited from OpalMediaStream
void IncrementTimestamp (PINDEX size)
bool InternalWriteData (const BYTE *data, PINDEX length, PINDEX &written)
 OpalMediaStream (OpalConnection &conn, const OpalMediaFormat &mediaFormat, unsigned sessionID, bool isSource)

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,
RTP_Session rtpSession,
unsigned  minAudioJitterDelay,
unsigned  maxAudioJitterDelay 
)

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
minAudioJitterDelayMinimum jitter buffer size (if applicable)
maxAudioJitterDelayMaximum jitter buffer size (if applicable)
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 PBoolean OpalRTPMediaStream::Close ( )
virtual

Close the media stream.

The default does nothing.

Reimplemented from OpalMediaStream.

virtual bool OpalRTPMediaStream::EnableJitterBuffer ( bool  enab = true) const
virtual

Enable jitter buffer for the media stream. Returns true if a jitter buffer is enabled/disabled. Returns false if no jitter buffer exists for the media stream.

The default behaviour sets the RTP_Session jitter buffer size according to the connection parameters, then returns true.

Reimplemented from OpalMediaStream.

virtual RTP_Session& OpalRTPMediaStream::GetRtpSession ( ) const
inlinevirtual

Return current RTP session

References rtpSession.

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

Reimplemented from OpalMediaStream.

virtual PBoolean OpalRTPMediaStream::IsSynchronous ( ) const
virtual

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

Implements 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.

virtual PBoolean OpalRTPMediaStream::ReadPacket ( RTP_DataFrame packet)
virtual

Read an RTP frame of data from the source media stream. The new behaviour simply calls RTP_Session::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 PBoolean OpalRTPMediaStream::SetPatch ( OpalMediaPatch patch)
virtual

Set the patch thread that is using this stream.

Parameters
patchMedia patch thread

Reimplemented from OpalMediaStream.

virtual bool OpalRTPMediaStream::SetPaused ( bool  pause,
bool  fromPatch = false 
)
virtual

Set the paused state for stream. This will stop reading/writing data from the stream.

Parameters
pauseIndicate that the stream should be paused
fromPatchIs being called from OpalMediaPatch

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 RTP_Session::WriteData().

Reimplemented from OpalMediaStream.

Field Documentation

unsigned OpalRTPMediaStream::maxAudioJitterDelay
protected
unsigned OpalRTPMediaStream::minAudioJitterDelay
protected
RTP_Session& OpalRTPMediaStream::rtpSession
protected

Referenced by GetRtpSession().


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