OPAL  Version 3.14.3
OpalMixerMediaStream Class Reference

#include <opalmixer.h>

Inheritance diagram for OpalMixerMediaStream:
Collaboration diagram for OpalMixerMediaStream:

Public Member Functions

bool CheckMixedVideoSize (unsigned width, unsigned height)
 
Construction
 OpalMixerMediaStream (OpalConnection &conn, const OpalMediaFormat &mediaFormat, unsigned sessionID, bool isSource, PSafePtr< OpalMixerNode > node, bool listenOnly)
 
 ~OpalMixerMediaStream ()
 
Overrides of OpalMediaStream class
virtual PBoolean Open ()
 
virtual PBoolean Start ()
 
virtual PBoolean WritePacket (RTP_DataFrame &packet)
 
virtual PBoolean IsSynchronous () const
 
virtual PBoolean RequiresPatchThread () const
 
Member variable access
PSafePtr< OpalMixerNodeGetNode ()
 
- Public Member Functions inherited from OpalMediaStream
virtual bool InternalUpdateMediaFormat (const OpalMediaFormat &mediaFormat)
 
virtual bool InternalSetPaused (bool pause, bool fromUser, bool fromPatch)
 
virtual bool InternalExecuteCommand (const OpalMediaCommand &command)
 
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 bool IsOpen () const
 
virtual PBoolean Close ()
 
virtual void OnStartMediaPatch ()
 
virtual void OnStopMediaPatch (OpalMediaPatch &patch)
 
virtual PBoolean WritePackets (RTP_DataFrameList &packets)
 
virtual PBoolean ReadPacket (RTP_DataFrame &packet)
 
virtual PBoolean ReadData (BYTE *data, PINDEX size, PINDEX &length)
 
virtual PBoolean WriteData (const BYTE *data, PINDEX length, PINDEX &written)
 
bool PushPacket (RTP_DataFrame &packet)
 
virtual PBoolean SetDataSize (PINDEX dataSize, PINDEX frameTime)
 
PINDEX GetDataSize () const
 
virtual PBoolean RequiresPatchThread (OpalMediaStream *stream) const
 
virtual bool EnableJitterBuffer (bool enab=true) 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 SetPaused (bool pause)
 
virtual PBoolean SetPatch (OpalMediaPatch *patch)
 
OpalMediaPatchPtr GetPatch () const
 
void AddFilter (const PNotifier &filter, const OpalMediaFormat &stage=OpalMediaFormat()) const
 
bool RemoveFilter (const PNotifier &filter, const OpalMediaFormat &stage=OpalMediaFormat()) const
 
virtual void GetStatistics (OpalMediaStatistics &statistics, bool fromPatch=false) const
 
 P_DECLARE_BITWISE_ENUM (Details, 6,(DetailMinimum, DetailEOL, DetailNAT, DetailSecured, DetailFEC, DetailAudio, DetailAddresses))
 
virtual void PrintDetail (ostream &strm, const char *prefix=NULL, Details details=Details::All()) const
 
 ~OpalMediaStream ()
 

Protected Member Functions

virtual void InternalClose ()
 
virtual bool InternalSetJitterBuffer (const OpalJitterBuffer::Init &init) const
 
- Protected Member Functions inherited from OpalMediaStream
void IncrementTimestamp (PINDEX size)
 
bool InternalWriteData (const BYTE *data, PINDEX length, PINDEX &written)
 
OpalMediaPatchPtr InternalSetPatchPart1 (OpalMediaPatch *newPatch)
 
void InternalSetPatchPart2 (const OpalMediaPatchPtr &oldPatch)
 
 OpalMediaStream (OpalConnection &conn, const OpalMediaFormat &mediaFormat, unsigned sessionID, bool isSource)
 

Protected Attributes

PSafePtr< OpalMixerNodem_node
 
bool m_listenOnly
 
unsigned m_mixedVideoWidth
 
unsigned m_mixedVideoHeight
 
- Protected Attributes inherited from OpalMediaStream
OpalConnectionconnection
 
unsigned sessionID
 
WORD m_sequenceNumber
 
PString identifier
 
OpalMediaFormat mediaFormat
 
bool m_paused
 
bool m_isSource
 
bool m_isOpen
 
PINDEX m_defaultDataSize
 
unsigned timestamp
 
bool 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

Mixer media stream. This class represents a media stream that will send/get media from a mixer.

Constructor & Destructor Documentation

OpalMixerMediaStream::OpalMixerMediaStream ( OpalConnection conn,
const OpalMediaFormat mediaFormat,
unsigned  sessionID,
bool  isSource,
PSafePtr< OpalMixerNode node,
bool  listenOnly 
)

Construct a new media stream for mixer.

Parameters
connConnection for media stream
mediaFormatMedia format for stream
sessionIDSession number for stream
isSourceIs a source stream
nodeMixer node to send data
listenOnlyEffectively initial pause state
OpalMixerMediaStream::~OpalMixerMediaStream ( )

Destroy stream.

Member Function Documentation

bool OpalMixerMediaStream::CheckMixedVideoSize ( unsigned  width,
unsigned  height 
)
PSafePtr<OpalMixerNode> OpalMixerMediaStream::GetNode ( )
inline

Get the mixer node for this stream.

References m_node.

virtual void OpalMixerMediaStream::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 OpalMixerMediaStream::InternalSetJitterBuffer ( const OpalJitterBuffer::Init init) const
protectedvirtual

Reimplemented from OpalMediaStream.

virtual PBoolean OpalMixerMediaStream::IsSynchronous ( ) const
virtual

Indicate if the media stream is synchronous. Returns true for LID streams.

Implements OpalMediaStream.

virtual PBoolean OpalMixerMediaStream::Open ( )
virtual

Open the media stream using the media format.

Reimplemented from OpalMediaStream.

virtual PBoolean OpalMixerMediaStream::RequiresPatchThread ( ) const
virtual

Indicate if the media stream requires a OpalMediaPatch thread (active patch). This is called on the source/sink stream and is passed the sink/source stream that the patch will initially be using. The function could conditionally require the patch thread to execute a thread reading and writing data, or prevent it from doing so as it can do so in hardware in some way.

The default behaviour returns true if a sink stream. If source stream then threading is from the mixer class.

Reimplemented from OpalMediaStream.

virtual PBoolean OpalMixerMediaStream::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 OpalMixerMediaStream::WritePacket ( RTP_DataFrame packet)
virtual

Write an RTP frame of data to the sink media stream. The default behaviour simply calls WriteData() on the data portion of the RTP_DataFrame and and sets the internal timestamp and marker from the member variables of the media stream class.

Reimplemented from OpalMediaStream.

Field Documentation

bool OpalMixerMediaStream::m_listenOnly
protected
unsigned OpalMixerMediaStream::m_mixedVideoHeight
protected
unsigned OpalMixerMediaStream::m_mixedVideoWidth
protected
PSafePtr<OpalMixerNode> OpalMixerMediaStream::m_node
protected

Referenced by GetNode().


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