12 #ifndef _MpOutputDeviceManager_h_ 13 #define _MpOutputDeviceManager_h_ 18 #include <os/OsRWMutex.h> 19 #include <utl/UtlHashMap.h> 20 #include <utl/UtlHashBag.h> 21 #include <utl/UtlSList.h> 37 class OsMsgDispatcher;
77 unsigned defaultSamplesPerSecond,
145 uint32_t samplesPerSec = 0);
204 UtlBoolean initFrameTime =
FALSE);
253 OsNotification *pFlowgraphTicker);
338 uint32_t& samplesPerSec)
const;
436 #endif // _MpOutputDeviceManager_h_ UtlSList mNotifiers
Definition: MpOutputDeviceManager.h:424
MpFrameTime getCurrentFrameTime(MpOutputDeviceHandle deviceId) const
Get current frame timestamp.
Definition: MpOutputDeviceManager.cpp:543
uint32_t MpFrameTime
Definition: MpTypes.h:53
OsStatus removeNotificationDispatcher(OsMsgDispatcher *notifyDispatcher)
remove given notifier to disable posting of notification messages to the notifier ...
Definition: MpOutputDeviceManager.cpp:637
MpOutputDeviceHandle mLastDeviceId
Definition: MpOutputDeviceManager.h:416
int removeAllDevices()
Definition: MpOutputDeviceManager.cpp:148
MpOutputDeviceHandle addDevice(MpOutputDeviceDriver *newDevice)
Add a new input device for use.
Definition: MpOutputDeviceManager.cpp:78
virtual ~MpOutputDeviceManager()
Destructor.
Definition: MpOutputDeviceManager.cpp:65
OsStatus setFlowgraphTickerSource(MpOutputDeviceHandle deviceId, OsNotification *pFlowgraphTicker)
Set device that will be used to send frame start message to media task.
Definition: MpOutputDeviceManager.cpp:397
OsRWMutex mRwMutex
Definition: MpOutputDeviceManager.h:413
OsStatus getDeviceSamplesPerSec(MpOutputDeviceHandle deviceId, uint32_t &samplesPerSec) const
Get the sample rate that a particular device is running at.
Definition: MpOutputDeviceManager.cpp:562
MpOutputDeviceHandle mCurrentTickerDevice
Definition: MpOutputDeviceManager.h:423
MpOutputDeviceManager(unsigned defaultSamplesPerFrame, unsigned defaultSamplesPerSecond, MpFrameTime defaultMixerBufferLength)
Default constructor.
Definition: MpOutputDeviceManager.cpp:46
MpOutputDeviceDriver * removeDevice(MpOutputDeviceHandle deviceId)
Remove an existing input device.
Definition: MpOutputDeviceManager.cpp:105
OsStatus addNotificationDispatcher(OsMsgDispatcher *notifyDispatcher)
Add notifier to enable posting of notification messages.
Definition: MpOutputDeviceManager.cpp:621
OsStatus getDeviceSamplesPerFrame(MpOutputDeviceHandle deviceId, uint32_t &samplesPerFrame) const
Get the number of samples per frame that a particular device is running at.
Definition: MpOutputDeviceManager.cpp:589
OsStatus getDeviceId(const UtlString &deviceName, MpOutputDeviceHandle &deviceId) const
Get the device id for the given device driver name.
Definition: MpOutputDeviceManager.cpp:495
MpAudioOutputConnection * findConnectionBlocking(MpOutputDeviceHandle deviceId, int tries=10) const
Definition: MpOutputDeviceManager.cpp:696
int MpOutputDeviceHandle
Definition: MpTypes.h:50
OsTime mTimeZero
Definition: MpOutputDeviceManager.h:422
unsigned mDefaultSamplesPerSecond
Definition: MpOutputDeviceManager.h:418
UtlHashMap mConnectionsByDeviceName
Definition: MpOutputDeviceManager.h:420
Definition: MpResNotificationMsg.h:31
OsStatus getDeviceName(MpOutputDeviceHandle deviceId, UtlString &deviceName) const
Get the device driver name for the given device ID.
Definition: MpOutputDeviceManager.cpp:467
OsStatus getMixerBufferLength(MpOutputDeviceHandle deviceId, MpFrameTime &length) const
Get mixer buffer length (in milliseconds) for given device.
Definition: MpOutputDeviceManager.cpp:517
MpOutputDeviceManager & operator=(const MpOutputDeviceManager &rhs)
Assignment operator (not implemented for this class)
UtlBoolean isDeviceEnabled(MpOutputDeviceHandle deviceId) const
Inquire if device is enabled (e.g. consuming media data).
Definition: MpOutputDeviceManager.cpp:670
Smart pointer to MpBuf.
Definition: MpBuf.h:160
OsMsgDispatcher * getNotificationDispatcher()
Get notifier to enable posting of notification messages.
Definition: MpOutputDeviceManager.cpp:608
Container of output devices.
Definition: MpOutputDeviceManager.h:66
UtlHashBag mConnectionsByDeviceId
Definition: MpOutputDeviceManager.h:421
OsStatus disableAllDevicesExcept(int exceptCount=0, MpOutputDeviceHandle exceptIdArray[]=NULL)
Helper to disable all device drivers except the optional list of devices.
Definition: MpOutputDeviceManager.cpp:287
OsStatus pushFrame(MpOutputDeviceHandle deviceId, MpFrameTime frameTime, const MpBufPtr &frame)
Method for sending frame of data to output device with initialized frame time.
Definition: MpOutputDeviceManager.cpp:390
OsStatus pushFrameFirst(MpOutputDeviceHandle deviceId, MpFrameTime &frameTime, const MpBufPtr &frame, UtlBoolean initFrameTime=FALSE)
Method for sending frame of data to output device.
Definition: MpOutputDeviceManager.cpp:331
unsigned mDefaultSamplesPerFrame
Definition: MpOutputDeviceManager.h:417
MpFrameTime mDefaultBufferLength
Definition: MpOutputDeviceManager.h:419
#define FALSE
Definition: PlgDefsV1.h:37
OsStatus enableDevice(MpOutputDeviceHandle deviceId, MpFrameTime mixerBufferLength=0, uint32_t samplesPerFrame=0, uint32_t samplesPerSec=0)
Helper to enable device driver.
Definition: MpOutputDeviceManager.cpp:194
OsStatus disableDevice(MpOutputDeviceHandle deviceId)
Helper to disable device driver.
Definition: MpOutputDeviceManager.cpp:233
OsStatus postNotification(const MpResNotificationMsg &msg)
Most a message to the notifer to interested parties.
Definition: MpOutputDeviceManager.cpp:657
Container for device specific output driver.
Definition: MpOutputDeviceDriver.h:53
Private container class for MpOutputDeviceDriver pointer and mixer buffer.
Definition: MpAudioOutputConnection.h:49