16 #define WIN32_LEAN_AND_MEAN 20 #include <os/OsMutex.h> 21 #include <os/OsCallback.h> 22 #include <utl/UtlSList.h> 23 #include <utl/UtlVoidPtr.h> 32 #define DEFAULT_N_OUTPUT_BUFS 32 35 #if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0600) 36 # define DONTUSE_SLIST 49 struct IMMNotificationClient;
108 unsigned samplesPerSec,
110 OsCallback &frameTicker);
116 OsStatus
pushFrame(
unsigned int numSamples,
124 virtual OsStatus
signal(
const intptr_t eventData);
172 void* dwParam1,
void* dwParam2);
211 #ifndef DONTUSE_SLIST 212 struct WinAudioDataChain
215 SLIST_ENTRY ItemEntry;
217 WAVEHDR* mCbParamHdr;
220 SLIST_HEADER mPoolSignaled;
221 SLIST_HEADER mPoolFree;
268 #endif // _MpodWinMM_h_ OsStatus enableDevice(unsigned samplesPerFrame, unsigned samplesPerSec, MpFrameTime currentFrameTime, OsCallback &frameTicker)
Definition: MpodWinMM.cpp:505
WAVEHDR * initWaveHeader(int n)
Zero out a wave header, so it is ready to be filled in by us.
Definition: MpodWinMM.cpp:1214
DWORD mTotSampleCount
A count of the samples coming in via pushFrame.
Definition: MpodWinMM.h:201
High-precision periodic timer (MultiMedia timer) base class.
Definition: MpMMTimer.h:44
int mUnderrunLength
Length of underrun, taking place now (in frames).
Definition: MpodWinMM.h:200
virtual OsStatus signal(const intptr_t eventData)
callback used by MpMMTimer when output device is not providing ticks
Definition: MpodWinMM.cpp:1127
WAVEHDR * mpWaveHeaders
Array of nNumInBuffers wave headers.
Definition: MpodWinMM.h:194
uint32_t MpFrameTime
Definition: MpTypes.h:53
Structure used to pass WMM message data to processing thread.
Definition: MpodWinMM.h:224
int mWinMMDeviceId
Definition: MpodWinMM.h:186
OsStatus pushFrame(unsigned int numSamples, const MpAudioSample *samples, MpFrameTime frameTime)
Send data to output device.
Definition: MpodWinMM.cpp:798
OsStatus switchToMMTimer()
Switch to use MMTimer for Media subsystem ticks instead of output device.
Definition: MpodWinMM.cpp:1040
MpMMTimer * mpTickerTimer
Definition: MpodWinMM.h:208
OsStatus resetDevice()
Definition: MpodWinMM.cpp:746
MpOutputDeviceManager * mpOutputManger
output manager this device will belong to.
Definition: MpodWinMM.h:184
OsAtomicLightBool mExitFlag
Should processing thread finish its execution?
Definition: MpodWinMM.h:207
UtlSList mListSignaled
Queue of WMM messages signaled for processing.
Definition: MpodWinMM.h:233
UtlSList mEmptyHeaderList
Definition: MpodWinMM.h:196
UtlSList mUnusedVPtrList
Definition: MpodWinMM.h:198
static void CALLBACK waveOutCallbackStatic(HWAVEOUT hwo, UINT uMsg, void *dwInstance, void *dwParam1, void *dwParam2)
callback used by wave output multimedia interface
Definition: MpodWinMM.cpp:1356
WAVEHDR * mCbParamHdr
Definition: MpodWinMM.h:230
int16_t MpAudioSample
Definition: MpTypes.h:44
MpodWinMM & operator=(const MpodWinMM &rhs)
Assignment operator (not implemented for this class)
unsigned mNumOutBuffers
Definition: MpodWinMM.h:190
MpodWinMM(const UtlString &name, MpOutputDeviceManager *outputManger, unsigned nOutputBuffers=DEFAULT_N_OUTPUT_BUFS)
Default constructor.
Definition: MpodWinMM.cpp:281
HANDLE mCallbackEvent
Event to signal that WMM message is available for processing.
Definition: MpodWinMM.h:206
static DWORD WINAPI ThreadMMProc(LPVOID lpMessage)
WMM messages processing thread.
Definition: MpodWinMM.cpp:1278
void finalizeProcessedHeader(WAVEHDR *pWaveHdr)
Adds a header/buffer to the empty header list and notifies for a new frame.
Definition: MpodWinMM.cpp:1238
Definition: MpodWinMM.cpp:73
OsMutex mEmptyHdrVPtrListsMutex
Mutex to serialize access to vptr and empty header lists.
Definition: MpodWinMM.h:185
LPSTR * mpWaveBuffers
Array of nNumInBuffers wave buffers.
Definition: MpodWinMM.h:195
UtlBoolean isDeviceValid()
Inquire if the windows device is valid.
Definition: MpodWinMM.h:263
IMMNotificationClient * mWinAudioDeviceChangeCallback
device state changes.
Definition: MpodWinMM.h:202
UtlSList mListFree
Pool of WMM messages.
Definition: MpodWinMM.h:234
OsStatus internalPushFrame(unsigned int numSamples, const MpAudioSample *samples, MpFrameTime frameTime)
internal method to handle final writing of audio to the output device
Definition: MpodWinMM.cpp:901
HANDLE mCallbackThread
Handle of thread which processes WMM messages.
Definition: MpodWinMM.h:205
Container for Microsoft Windows device specific output driver.
Definition: MpodWinMM.h:69
Container of output devices.
Definition: MpOutputDeviceManager.h:66
static UtlString getDefaultDeviceName()
get the windows name of the default wave output device.
Definition: MpodWinMM.cpp:1178
IMMDeviceEnumerator * mDeviceEnumeratorPtr
Definition: MpodWinMM.h:204
unsigned mWaveBufSize
Definition: MpodWinMM.h:192
UINT mCbParamMsg
Definition: MpodWinMM.h:229
~MpodWinMM()
Destructor.
Definition: MpodWinMM.cpp:399
MpFrameTime mCurFrameTime
The current frame time for this device.
Definition: MpodWinMM.h:189
OsStatus disableDevice()
Uninitialize device driver.
Definition: MpodWinMM.cpp:679
WinAudioData()
Definition: MpodWinMM.h:227
#define DEFAULT_N_OUTPUT_BUFS
Definition: MpodWinMM.h:32
Container for device specific output driver.
Definition: MpOutputDeviceDriver.h:53
HWAVEOUT mDevHandle
The Microsoft handle for this audio input device.
Definition: MpodWinMM.h:188