12 #ifndef _MpAudioOutputConnection_h_ 13 #define _MpAudioOutputConnection_h_ 20 #include <utl/UtlInt.h> 21 #include <os/OsMutex.h> 22 #include <os/OsCallback.h> 78 unsigned samplesPerSec,
143 OsStatus
pushFrame(
unsigned int numSamples,
258 OsStatus
mixFrame(
unsigned frameOffset,
261 unsigned numSamples);
276 unsigned numSamples)
const;
375 unsigned numSamples)
const 381 return OS_LIMIT_REACHED;
386 #endif // _MpAudioOutputConnection_h_ MpFrameTime getCurrentFrameTime() const
Definition: MpAudioOutputConnection.cpp:329
unsigned getUseCount() const
Return number of external entities, referring to this connection.
Definition: MpAudioOutputConnection.h:364
unsigned mMixerBufferBegin
Index of first available sample in mixer buffer.
Definition: MpAudioOutputConnection.h:325
virtual ~MpAudioOutputConnection()
Destructor.
Definition: MpAudioOutputConnection.cpp:93
MpAudioOutputConnection & operator=(const MpAudioOutputConnection &rhs)
Assignment operator (not implemented for this class)
uint32_t MpFrameTime
Definition: MpTypes.h:53
OsStatus freeMixerBuffer()
Free mixer buffer and set all related member variables to zero.
Definition: MpAudioOutputConnection.cpp:368
unsigned mMixerBufferLength
Length of mixer buffer (in samples).
Definition: MpAudioOutputConnection.h:322
MpAudioOutputConnection(MpOutputDeviceHandle deviceId, MpOutputDeviceDriver *deviceDriver)
Default constructor.
Definition: MpAudioOutputConnection.cpp:77
unsigned increaseUseCount()
Add one more reference to this connection.
Definition: MpAudioOutputConnection.h:344
unsigned decreaseUseCount()
Remove one reference to this connection.
Definition: MpAudioOutputConnection.h:349
OsStatus advanceMixerBuffer(unsigned numSamples)
Pull frame from mixer buffer.
Definition: MpAudioOutputConnection.cpp:431
MpFrameTime getMixerBufferLength() const
Return length of mixer buffer in milliseconds.
Definition: MpAudioOutputConnection.h:359
int mUseCount
Use counter, used to implement safe delete.
Definition: MpAudioOutputConnection.h:316
unsigned getSamplesPerSec() const
Get number of samples per second.
Definition: MpOutputDeviceDriver.h:239
OsStatus initMixerBuffer(unsigned mixerBufferLength)
Allocate mixer buffer and initialize all related member variables.
Definition: MpAudioOutputConnection.cpp:345
OsMutex mMutex
Mutex to synchronize access to connection.
Definition: MpAudioOutputConnection.h:315
int16_t MpAudioSample
Definition: MpTypes.h:44
MpOutputDeviceDriver * mpDeviceDriver
connection.
Definition: MpAudioOutputConnection.h:318
unsigned getSamplesPerFrame() const
Return number of samples per frame, this driver expect from flowgraph.
Definition: MpAudioOutputConnection.h:369
OsStatus pushFrame(unsigned int numSamples, const MpAudioSample *samples, MpFrameTime frameTime)
Send data frame to output device.
Definition: MpAudioOutputConnection.cpp:254
int MpOutputDeviceHandle
Definition: MpTypes.h:50
OsStatus enableFlowgraphTicker(OsNotification *pFlowgraphTicker)
Use this device to signal frame processing interval start.
Definition: MpAudioOutputConnection.cpp:181
OsStatus disableDevice()
Uninitialize device driver.
Definition: MpAudioOutputConnection.cpp:157
OsStatus disableFlowgraphTicker()
Stop using this device to signal frame processing interval start.
Definition: MpAudioOutputConnection.cpp:200
unsigned getSamplesPerFrame() const
Get number of samples in a frame.
Definition: MpOutputDeviceDriver.h:234
OsStatus enableDevice(unsigned samplesPerFrame, unsigned samplesPerSec, MpFrameTime currentFrameTime, MpFrameTime mixerBufferLength)
Initialize device driver and mixer buffer.
Definition: MpAudioOutputConnection.cpp:99
OsNotification * mpFlowgraphTicker
when it should process next frame.
Definition: MpAudioOutputConnection.h:330
MpOutputDeviceDriver * getDeviceDriver() const
Return device driver contained in this connection.
Definition: MpAudioOutputConnection.h:354
OsStatus isLateToMix(unsigned frameOffset, unsigned numSamples) const
Check whether it's too late to mix this frame in or not (does not check for too early).
Definition: MpAudioOutputConnection.h:374
MpFrameTime mCurrentFrameTime
Frame time of the mixer buffer begin.
Definition: MpAudioOutputConnection.h:320
static void readyForDataCallback(const intptr_t userData, const intptr_t eventData)
Call this when driver become ready for the next frame.
Definition: MpAudioOutputConnection.cpp:469
OsCallback readyForDataCallbackNotf
Definition: MpAudioOutputConnection.h:327
OsStatus mixFrame(unsigned frameOffset, const MpAudioSample *samples, unsigned numSamples)
Mix frame to mixer buffer.
Definition: MpAudioOutputConnection.cpp:381
OsStatus pushFrameBeginning(unsigned int numSamples, const MpAudioSample *samples, MpFrameTime &frameTime)
Send data frame to the beginning of mixer buffer and return frame time.
Definition: MpAudioOutputConnection.cpp:219
MpAudioSample * mpMixerBuffer
several media streams.
Definition: MpAudioOutputConnection.h:323
Container for device specific output driver.
Definition: MpOutputDeviceDriver.h:53
Private container class for MpOutputDeviceDriver pointer and mixer buffer.
Definition: MpAudioOutputConnection.h:49