OpalBaseMixer Class Reference
#include <opalmixer.h>
Detailed Description
Class base for a media mixer.
The mixer operates by re-buffering the input media into chunks each with an associated timestamp. A main mixer thread then reads from each stream at regular intervals, mixes the media and creates the output buffer.
Note the timestamps of the input media are extremely important as they are used so that breaks or too fast data in the input media is dealt with correctly.
Member Typedef Documentation
Constructor & Destructor Documentation
| OpalBaseMixer::OpalBaseMixer |
( |
bool |
pushThread, |
|
|
unsigned |
periodMS, |
|
|
unsigned |
periodTS | |
|
) |
| | |
- Parameters:
-
| pushThread | Indicate if the push thread should be started |
| periodMS | The output buffer time in milliseconds |
| periodTS | The output buffer time in RTP timestamp units |
| virtual OpalBaseMixer::~OpalBaseMixer |
( |
|
) |
[virtual] |
Member Function Documentation
| virtual bool OpalBaseMixer::AddStream |
( |
const Key_T & |
key |
) |
[virtual] |
Add a stream to mixer using the specified key.
- Parameters:
-
| virtual Stream* OpalBaseMixer::CreateStream |
( |
|
) |
[protected, pure virtual] |
| virtual size_t OpalBaseMixer::GetOutputSize |
( |
|
) |
const [protected, pure virtual] |
| unsigned OpalBaseMixer::GetPeriodTS |
( |
|
) |
const [inline] |
Get the period for mixing in RTP timestamp units.
References m_periodTS.
| virtual bool OpalBaseMixer::MixStreams |
( |
RTP_DataFrame & |
frame |
) |
[protected, pure virtual] |
| virtual bool OpalBaseMixer::OnMixed |
( |
RTP_DataFrame *& |
mixed |
) |
[virtual] |
Mixed data is now available. For a push model system, this is called with mixed data as returned by ReadMixed().
The "mixed" parameter is a reference to a pointer, so if the consumer wishes to take responsibility for deleting the pointer to an RTP data frame, then they can set it to NULL.
If false is returned then the push thread is exited.
- Parameters:
-
| mixed,Poitner | to mixed media. |
Reimplemented in OpalMixerNode::VideoMixer.
| virtual bool OpalBaseMixer::OnPush |
( |
|
) |
[protected, virtual] |
| void OpalBaseMixer::PushThreadMain |
( |
|
) |
[protected] |
| virtual bool OpalBaseMixer::ReadMixed |
( |
RTP_DataFrame & |
mixed |
) |
[virtual] |
Read media from mixer. A pull model system would call this function to get the mixed media from the mixer. Note the stream indicated by the streamToIgnore key is not included in the mixing operation, allowing for example, the member of a conference to not hear themselves.
Note this function is the function that does all the "heavy lifting" for the mixer.
| virtual void OpalBaseMixer::RemoveAllStreams |
( |
|
) |
[virtual] |
| virtual void OpalBaseMixer::RemoveStream |
( |
const Key_T & |
key |
) |
[virtual] |
Remove an input stream from mixer.
- Parameters:
-
Reimplemented in OpalAudioMixer.
| void OpalBaseMixer::StartPushThread |
( |
|
) |
|
Start the push thread. Normally called internally.
| void OpalBaseMixer::StopPushThread |
( |
bool |
lock = true |
) |
|
| virtual bool OpalBaseMixer::WriteStream |
( |
const Key_T & |
key, |
|
|
const RTP_DataFrame & |
input | |
|
) |
| | [virtual] |
Write an RTP data frame to mixer. A copy of the RTP data frame is created. This function is generally quite fast as the actual mixing is done in a different thread so minimal interference with the normal media stream processing occurs.
- Parameters:
-
| key | key for mixer stream |
| input | Input RTP data for media |
Referenced by OpalMixerNode::WriteAudio(), and OpalMixerNode::WriteVideo().
Field Documentation
The documentation for this class was generated from the following file: