10 #ifndef _MpOutputDeviceDriver_h_ 11 #define _MpOutputDeviceDriver_h_ 15 #include <os/OsStatus.h> 16 #include <os/OsAtomics.h> 17 #include <utl/UtlString.h> 82 unsigned samplesPerSec,
84 OsCallback &frameTicker) = 0;
127 OsStatus
pushFrame(
unsigned int numSamples,
172 unsigned samplesPerSec);
183 virtual OsStatus
canEnable() {
return(OS_SUCCESS);};
228 unsigned samplesPerSec)
230 assert(samplesPerSec);
231 return(samplesPerSec ? ((1000*samplesPerFrame)/samplesPerSec) : 0);
249 #endif // _MpOutputDeviceDriver_h_ virtual OsStatus enableDevice(unsigned samplesPerFrame, unsigned samplesPerSec, MpFrameTime currentFrameTime, OsCallback &frameTicker)=0
Initialize device driver and state.
OsAtomicLightUInt mSamplesPerSec
of samples per second.
Definition: MpOutputDeviceDriver.h:204
virtual UtlBoolean isEnabled() const
Inquire if this driver is enabled.
Definition: MpOutputDeviceDriver.cpp:48
virtual OsStatus disableDevice()=0
Uninitialize device driver.
uint32_t MpFrameTime
Definition: MpTypes.h:53
OsAtomicLightUInt mSamplesPerFrame
number of samples.
Definition: MpOutputDeviceDriver.h:202
const UtlString & getDeviceName() const
Get device name.
Definition: MpOutputDeviceDriver.h:244
unsigned getSamplesPerSec() const
Get number of samples per second.
Definition: MpOutputDeviceDriver.h:239
OsAtomicLightBool mIsEnabled
Whether this device driver is enabled or not.
Definition: MpOutputDeviceDriver.h:201
int16_t MpAudioSample
Definition: MpTypes.h:44
MpFrameTime getFramePeriod() const
Calculate the number of milliseconds that a frame occupies in time.
Definition: MpOutputDeviceDriver.h:222
virtual OsStatus pushFrame(unsigned int numSamples, const MpAudioSample *samples, MpFrameTime frameTime)=0
Send data to output device.
unsigned getSamplesPerFrame() const
Get number of samples in a frame.
Definition: MpOutputDeviceDriver.h:234
virtual OsStatus canEnable()
Check if this device can connect.
Definition: MpOutputDeviceDriver.h:184
OsCallback * mpTickerNotification
is ready to accept more data. See enableDevice() for details.
Definition: MpOutputDeviceDriver.h:206
virtual ~MpOutputDeviceDriver()
Destructor.
Definition: MpOutputDeviceDriver.cpp:37
MpOutputDeviceDriver & operator=(const MpOutputDeviceDriver &rhs)
Assignment operator (not implemented for this class)
MpOutputDeviceDriver(const UtlString &name)
Default constructor.
Definition: MpOutputDeviceDriver.cpp:28
Container for device specific output driver.
Definition: MpOutputDeviceDriver.h:53