ReactOS  0.4.14-dev-593-g1793dcc
capturebuffer.c File Reference
#include "precomp.h"
Include dependency graph for capturebuffer.c:

Go to the source code of this file.

Classes

struct  CDirectSoundCaptureBufferImpl
 

Typedefs

typedef struct CDirectSoundCaptureBufferImplLPCDirectSoundCaptureBufferImpl
 

Functions

DWORD WINAPI MixerThreadRoutine (LPVOID lpParameter)
 
HRESULT WINAPI IDirectSoundCaptureBufferImpl_QueryInterface (LPDIRECTSOUNDCAPTUREBUFFER8 iface, IN REFIID riid, LPVOID *ppobj)
 
ULONG WINAPI IDirectSoundCaptureBufferImpl_AddRef (LPDIRECTSOUNDCAPTUREBUFFER8 iface)
 
ULONG WINAPI IDirectSoundCaptureBufferImpl_Release (LPDIRECTSOUNDCAPTUREBUFFER8 iface)
 
HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetCaps (LPDIRECTSOUNDCAPTUREBUFFER8 iface, LPDSCBCAPS lpDSCBCaps)
 
HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetCurrentPosition (LPDIRECTSOUNDCAPTUREBUFFER8 iface, LPDWORD lpdwCapturePosition, LPDWORD lpdwReadPosition)
 
HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetFormat (LPDIRECTSOUNDCAPTUREBUFFER8 iface, LPWAVEFORMATEX lpwfxFormat, DWORD dwSizeAllocated, LPDWORD lpdwSizeWritten)
 
HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetStatus (LPDIRECTSOUNDCAPTUREBUFFER8 iface, LPDWORD lpdwStatus)
 
HRESULT WINAPI IDirectSoundCaptureBufferImpl_Initialize (LPDIRECTSOUNDCAPTUREBUFFER8 iface, LPDIRECTSOUNDCAPTURE lpDSC, LPCDSCBUFFERDESC lpcDSCBDesc)
 
HRESULT WINAPI IDirectSoundCaptureBufferImpl_Lock (LPDIRECTSOUNDCAPTUREBUFFER8 iface, DWORD dwOffset, DWORD dwBytes, LPVOID *ppvAudioPtr1, LPDWORD pdwAudioBytes1, LPVOID *ppvAudioPtr2, LPDWORD pdwAudioBytes2, DWORD dwFlags)
 
HRESULT WINAPI IDirectSoundCaptureBufferImpl_Start (LPDIRECTSOUNDCAPTUREBUFFER8 iface, DWORD dwFlags)
 
HRESULT WINAPI IDirectSoundCaptureBufferImpl_Stop (LPDIRECTSOUNDCAPTUREBUFFER8 iface)
 
HRESULT WINAPI IDirectSoundCaptureBufferImpl_Unlock (LPDIRECTSOUNDCAPTUREBUFFER8 iface, LPVOID lpvAudioPtr1, DWORD dwAudioBytes1, LPVOID lpvAudioPtr2, DWORD dwAudioBytes2)
 
HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetObjectInPath (LPDIRECTSOUNDCAPTUREBUFFER8 iface, REFGUID rguidObject, DWORD dwIndex, REFGUID rguidInterface, LPVOID *ppObject)
 
HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetFXStatus (LPDIRECTSOUNDCAPTUREBUFFER8 iface, DWORD dwFXCount, LPDWORD pdwFXStatus)
 
HRESULT NewDirectSoundCaptureBuffer (LPDIRECTSOUNDCAPTUREBUFFER8 *OutBuffer, LPFILTERINFO Filter, LPCDSCBUFFERDESC lpcDSBufferDesc)
 

Variables

const GUID KSINTERFACESETID_Standard = {0x1A8766A0L, 0x62CE, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}}
 
const GUID KSMEDIUMSETID_Standard = {0x4747B320L, 0x62CE, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}}
 
const GUID KSDATAFORMAT_TYPE_AUDIO = {0x73647561L, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}
 
const GUID KSDATAFORMAT_SPECIFIER_WAVEFORMATEX = {0x05589f81L, 0xc356, 0x11ce, {0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a}}
 
const GUID KSPROPSETID_Connection = {0x1D58C920L, 0xAC9B, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}}
 
const GUID KSEVENTSETID_LoopedStreaming = {0x4682B940L, 0xC6EF, 0x11D0, {0x96, 0xD8, 0x00, 0xAA, 0x00, 0x51, 0xE5, 0x1D}}
 
static IDirectSoundCaptureBuffer8Vtbl vt_DirectSoundCaptureBuffer8
 

Typedef Documentation

◆ LPCDirectSoundCaptureBufferImpl

Function Documentation

◆ IDirectSoundCaptureBufferImpl_AddRef()

ULONG WINAPI IDirectSoundCaptureBufferImpl_AddRef ( LPDIRECTSOUNDCAPTUREBUFFER8  iface)

Definition at line 191 of file capturebuffer.c.

193 {
194  ULONG ref;
196 
197  /* increment reference count */
198  ref = InterlockedIncrement(&This->ref);
199 
200  return ref;
201 
202 }
struct CDirectSoundCaptureBufferImpl * LPCDirectSoundCaptureBufferImpl
Definition: send.c:47
GLenum GLint ref
Definition: glext.h:6028
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1

◆ IDirectSoundCaptureBufferImpl_GetCaps()

HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetCaps ( LPDIRECTSOUNDCAPTUREBUFFER8  iface,
LPDSCBCAPS  lpDSCBCaps 
)

Definition at line 249 of file capturebuffer.c.

252 {
254 
255  if (!lpDSCBCaps)
256  {
257  /* invalid parameter */
258  return DSERR_INVALIDPARAM;
259  }
260 
261  if (lpDSCBCaps->dwSize != sizeof(DSCBCAPS))
262  {
263  /* invalid parameter */
264  return DSERR_INVALIDPARAM;
265  }
266 
267  lpDSCBCaps->dwBufferBytes = This->BufferSize;
268  lpDSCBCaps->dwReserved = 0;
269  //lpDSCBCaps->dwFlags = DSCBCAPS_WAVEMAPPED;
270 
271  return DS_OK;
272 }
struct CDirectSoundCaptureBufferImpl * LPCDirectSoundCaptureBufferImpl
DWORD dwBufferBytes
Definition: dsound.h:380
#define DSERR_INVALIDPARAM
Definition: dsound.h:121
DWORD dwSize
Definition: dsound.h:378
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define DS_OK
Definition: dsound.h:116
DWORD dwReserved
Definition: dsound.h:381

◆ IDirectSoundCaptureBufferImpl_GetCurrentPosition()

HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetCurrentPosition ( LPDIRECTSOUNDCAPTUREBUFFER8  iface,
LPDWORD  lpdwCapturePosition,
LPDWORD  lpdwReadPosition 
)

Definition at line 276 of file capturebuffer.c.

280 {
283  DWORD Result;
284  DWORD Value;
285 
287 
288  if (!This->hPin)
289  {
290  if (lpdwCapturePosition)
291  *lpdwCapturePosition = 0;
292 
293  if (lpdwReadPosition)
294  *lpdwReadPosition = 0;
295 
296  DPRINT("No Audio Pin\n");
297  return DS_OK;
298  }
299 
300  if (This->bMix)
301  {
302  /* read current position */
303  Value = InterlockedCompareExchange(&This->CurrentMixPosition, 0, 0);
304 
305  if (lpdwCapturePosition)
306  *lpdwCapturePosition = (DWORD)Value;
307 
308  if (lpdwReadPosition)
309  *lpdwReadPosition = (DWORD)Value;
310 
311  return DS_OK;
312  }
313 
314  /* setup audio position property request */
318 
319 
321 
322  if (Result != ERROR_SUCCESS)
323  {
324  DPRINT("GetPosition failed with %x\n", Result);
325  return DSERR_UNSUPPORTED;
326  }
327 
328  //DPRINT("Play %I64u Write %I64u \n", Position.PlayOffset, Position.WriteOffset);
329 
330  if (lpdwCapturePosition)
331  *lpdwCapturePosition = (DWORD)Position.PlayOffset;
332 
333  if (lpdwReadPosition)
334  *lpdwReadPosition = (DWORD)Position.WriteOffset;
335 
336  return DS_OK;
337 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KSPROPSETID_Audio
Definition: ksmedia.h:951
static COORD Position
Definition: mouse.c:34
struct CDirectSoundCaptureBufferImpl * LPCDirectSoundCaptureBufferImpl
#define InterlockedCompareExchange
Definition: interlocked.h:104
#define DWORD
Definition: nt_native.h:44
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
_In_ NDIS_HANDLE _In_ PNDIS_REQUEST Request
Definition: ndis.h:5173
smooth NULL
Definition: ftsmooth.c:416
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
void DPRINT(...)
Definition: polytest.cpp:61
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define DS_OK
Definition: dsound.h:116
if(!(yy_init))
Definition: macro.lex.yy.c:714
unsigned long DWORD
Definition: ntddk_ex.h:95
#define DSERR_UNSUPPORTED
Definition: dsound.h:127
DWORD SyncOverlappedDeviceIoControl(IN HANDLE Handle, IN DWORD IoControlCode, IN LPVOID InBuffer, IN DWORD InBufferSize, OUT LPVOID OutBuffer, IN DWORD OutBufferSize, OUT LPDWORD BytesTransferred OPTIONAL)
Definition: misc.c:298

◆ IDirectSoundCaptureBufferImpl_GetFormat()

HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetFormat ( LPDIRECTSOUNDCAPTUREBUFFER8  iface,
LPWAVEFORMATEX  lpwfxFormat,
DWORD  dwSizeAllocated,
LPDWORD  lpdwSizeWritten 
)

Definition at line 342 of file capturebuffer.c.

347 {
348  DWORD FormatSize;
350 
351  FormatSize = sizeof(WAVEFORMATEX) + This->Format->cbSize;
352 
353  if (!lpwfxFormat && !lpdwSizeWritten)
354  {
355  /* invalid parameter */
356  return DSERR_INVALIDPARAM;
357  }
358 
359  if (!lpwfxFormat)
360  {
361  /* return required format size */
362  *lpdwSizeWritten = FormatSize;
363  return DS_OK;
364  }
365  else
366  {
367  if (dwSizeAllocated >= FormatSize)
368  {
369  /* copy format */
370  CopyMemory(lpwfxFormat, This->Format, FormatSize);
371 
372  if (lpdwSizeWritten)
373  *lpdwSizeWritten = FormatSize;
374 
375  return DS_OK;
376  }
377  /* buffer too small */
378  if (lpdwSizeWritten)
379  *lpdwSizeWritten = 0;
380  return DSERR_INVALIDPARAM;
381  }
382 }
struct CDirectSoundCaptureBufferImpl * LPCDirectSoundCaptureBufferImpl
struct tWAVEFORMATEX WAVEFORMATEX
Definition: austream.idl:23
#define DSERR_INVALIDPARAM
Definition: dsound.h:121
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define DS_OK
Definition: dsound.h:116
if(!(yy_init))
Definition: macro.lex.yy.c:714
#define CopyMemory
Definition: winbase.h:1640
unsigned long DWORD
Definition: ntddk_ex.h:95

◆ IDirectSoundCaptureBufferImpl_GetFXStatus()

HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetFXStatus ( LPDIRECTSOUNDCAPTUREBUFFER8  iface,
DWORD  dwFXCount,
LPDWORD  pdwFXStatus 
)

Definition at line 650 of file capturebuffer.c.

654 {
656  return DSERR_INVALIDPARAM;
657 }
#define DSERR_INVALIDPARAM
Definition: dsound.h:121
#define UNIMPLEMENTED
Definition: debug.h:114

◆ IDirectSoundCaptureBufferImpl_GetObjectInPath()

HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetObjectInPath ( LPDIRECTSOUNDCAPTUREBUFFER8  iface,
REFGUID  rguidObject,
DWORD  dwIndex,
REFGUID  rguidInterface,
LPVOID ppObject 
)

Definition at line 637 of file capturebuffer.c.

643 {
645  return DSERR_INVALIDPARAM;
646 }
#define DSERR_INVALIDPARAM
Definition: dsound.h:121
#define UNIMPLEMENTED
Definition: debug.h:114

◆ IDirectSoundCaptureBufferImpl_GetStatus()

HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetStatus ( LPDIRECTSOUNDCAPTUREBUFFER8  iface,
LPDWORD  lpdwStatus 
)

Definition at line 386 of file capturebuffer.c.

389 {
391 
392  if (!lpdwStatus)
393  {
394  /* invalid parameter */
395  return DSERR_INVALIDPARAM;
396  }
397 
398  /* reset flags */
399  *lpdwStatus = 0;
400 
401  /* check if pin is running */
402  if (This->State == KSSTATE_RUN)
403  *lpdwStatus |= DSCBSTATUS_CAPTURING;
404 
405  /* check if a looped buffer is used */
406  if (This->bLoop)
407  *lpdwStatus |= DSCBSTATUS_LOOPING;
408 
409  /* done */
410  return DS_OK;
411 }
struct CDirectSoundCaptureBufferImpl * LPCDirectSoundCaptureBufferImpl
#define DSERR_INVALIDPARAM
Definition: dsound.h:121
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define DS_OK
Definition: dsound.h:116
#define DSCBSTATUS_CAPTURING
Definition: dsound.h:396
#define DSCBSTATUS_LOOPING
Definition: dsound.h:397

◆ IDirectSoundCaptureBufferImpl_Initialize()

HRESULT WINAPI IDirectSoundCaptureBufferImpl_Initialize ( LPDIRECTSOUNDCAPTUREBUFFER8  iface,
LPDIRECTSOUNDCAPTURE  lpDSC,
LPCDSCBUFFERDESC  lpcDSCBDesc 
)

Definition at line 415 of file capturebuffer.c.

419 {
420  /* capture buffer is already initialized */
422 }
#define DSERR_ALREADYINITIALIZED
Definition: dsound.h:129

◆ IDirectSoundCaptureBufferImpl_Lock()

HRESULT WINAPI IDirectSoundCaptureBufferImpl_Lock ( LPDIRECTSOUNDCAPTUREBUFFER8  iface,
DWORD  dwOffset,
DWORD  dwBytes,
LPVOID ppvAudioPtr1,
LPDWORD  pdwAudioBytes1,
LPVOID ppvAudioPtr2,
LPDWORD  pdwAudioBytes2,
DWORD  dwFlags 
)

Definition at line 426 of file capturebuffer.c.

435 {
437 
438  DPRINT("This %p dwOffset %u dwBytes %u ppvAudioPtr1 %p pdwAudioBytes1 %p ppvAudioPtr2 %p pdwAudioBytes2 %p dwFlags %x This->BufferSize %u\n",
439  This, dwOffset, dwBytes, ppvAudioPtr1, pdwAudioBytes1, ppvAudioPtr2, pdwAudioBytes2, dwFlags, This->BufferSize);
440 
442  {
443  *ppvAudioPtr1 = (LPVOID)This->Buffer;
444  *pdwAudioBytes1 = This->BufferSize;
445  if (ppvAudioPtr2)
446  *ppvAudioPtr2 = NULL;
447  if (pdwAudioBytes2)
448  *pdwAudioBytes2 = 0;
449 
450  return DS_OK;
451  }
452  else
453  {
454  ASSERT(dwOffset < This->BufferSize);
455  ASSERT(dwBytes < This->BufferSize);
456  ASSERT(dwBytes + dwOffset <= This->BufferSize);
457 
458  *ppvAudioPtr1 = This->Buffer + dwOffset;
459  *pdwAudioBytes1 = dwBytes;
460  if (ppvAudioPtr2)
461  *ppvAudioPtr2 = NULL;
462  if (pdwAudioBytes2)
463  *pdwAudioBytes2 = 0;
464 
465  return DS_OK;
466  }
467 }
struct CDirectSoundCaptureBufferImpl * LPCDirectSoundCaptureBufferImpl
_In_ DWORD _In_ DWORD dwOffset
Definition: ntgdi.h:2032
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define DS_OK
Definition: dsound.h:116
if(!(yy_init))
Definition: macro.lex.yy.c:714
#define BufferSize
Definition: classpnp.h:419
#define LPVOID
Definition: nt_native.h:45
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define DSBLOCK_ENTIREBUFFER
Definition: dsound.h:204

◆ IDirectSoundCaptureBufferImpl_QueryInterface()

HRESULT WINAPI IDirectSoundCaptureBufferImpl_QueryInterface ( LPDIRECTSOUNDCAPTUREBUFFER8  iface,
IN REFIID  riid,
LPVOID ppobj 
)

Definition at line 143 of file capturebuffer.c.

147 {
148  LPOLESTR pStr;
150 
151  /* check if requested interface is supported */
152  if (IsEqualIID(riid, &IID_IUnknown) ||
153  IsEqualIID(riid, &IID_IDirectSoundCaptureBuffer) ||
154  IsEqualIID(riid, &IID_IDirectSoundCaptureBuffer8))
155  {
156  *ppobj = (LPVOID)&This->lpVtbl;
157  InterlockedIncrement(&This->ref);
158  return S_OK;
159  }
160 
161  /* check if the interface is supported */
162  if (IsEqualIID(riid, &IID_IDirectSoundNotify))
163  {
164  if (!This->Notify)
165  {
166  HRESULT hr = NewDirectSoundNotify(&This->Notify, This->bLoop, This->bMix, This->hPin, This->BufferSize);
167  if (FAILED(hr))
168  return hr;
169 
170  *ppobj = (LPVOID)This->Notify;
171  return S_OK;
172  }
173 
174  /* increment reference count on existing notify object */
176  *ppobj = (LPVOID)This->Notify;
177  return S_OK;
178  }
179 
180  /* interface not supported */
181  if (SUCCEEDED(StringFromIID(riid, &pStr)))
182  {
183  DPRINT("No Interface for class %s\n", pStr);
184  CoTaskMemFree(pStr);
185  }
186  return E_NOINTERFACE;
187 }
#define E_NOINTERFACE
Definition: winerror.h:2364
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
struct CDirectSoundCaptureBufferImpl * LPCDirectSoundCaptureBufferImpl
static LPOLESTR
Definition: stg_prop.c:27
void DPRINT(...)
Definition: polytest.cpp:61
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
_Check_return_ HRESULT WINAPI StringFromIID(_In_ REFIID rclsid, _Outptr_ LPOLESTR *lplpsz)
#define IDirectSoundNotify_AddRef(p)
Definition: dsound.h:893
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IUnknown
#define LPVOID
Definition: nt_native.h:45
#define S_OK
Definition: intsafe.h:59
#define InterlockedIncrement
Definition: armddk.h:53
HRESULT NewDirectSoundNotify(LPDIRECTSOUNDNOTIFY *Notify, BOOL bLoop, BOOL bMix, HANDLE hPin, DWORD BufferSize)
Definition: notify.c:232
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ IDirectSoundCaptureBufferImpl_Release()

ULONG WINAPI IDirectSoundCaptureBufferImpl_Release ( LPDIRECTSOUNDCAPTUREBUFFER8  iface)

Definition at line 206 of file capturebuffer.c.

208 {
209  ULONG ref;
211 
212  /* release reference count */
213  ref = InterlockedDecrement(&(This->ref));
214 
215  if (!ref)
216  {
217  if (This->hPin)
218  {
219  /* close pin handle */
220  CloseHandle(This->hPin);
221  }
222 
223  if (This->hStopEvent)
224  {
225  /* close stop event handle */
226  CloseHandle(This->hStopEvent);
227  }
228 
229  if (This->MixBuffer)
230  {
231  /* free mix buffer */
232  HeapFree(GetProcessHeap(), 0, This->MixBuffer);
233  }
234 
235  /* free capture buffer */
236  HeapFree(GetProcessHeap(), 0, This->Buffer);
237  /* free wave format */
238  HeapFree(GetProcessHeap(), 0, This->Format);
239  /* free capture buffer */
241  }
242 
243  return ref;
244 }
#define CloseHandle
Definition: compat.h:406
struct CDirectSoundCaptureBufferImpl * LPCDirectSoundCaptureBufferImpl
Definition: send.c:47
GLenum GLint ref
Definition: glext.h:6028
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define GetProcessHeap()
Definition: compat.h:403
#define InterlockedDecrement
Definition: armddk.h:52
unsigned int ULONG
Definition: retypes.h:1
#define HeapFree(x, y, z)
Definition: compat.h:402

◆ IDirectSoundCaptureBufferImpl_Start()

HRESULT WINAPI IDirectSoundCaptureBufferImpl_Start ( LPDIRECTSOUNDCAPTUREBUFFER8  iface,
DWORD  dwFlags 
)

Definition at line 471 of file capturebuffer.c.

474 {
477  DWORD Result, BytesTransferred;
478  OVERLAPPED Overlapped;
479  KSSTATE State;
480  HANDLE hThread;
481 
483 
484  DPRINT("IDirectSoundCaptureBufferImpl_Start Flags %x\n", dwFlags);
486 
487  /* check if pin is already running */
488  if (This->State == KSSTATE_RUN)
489  return DS_OK;
490 
491 
492  /* check if there is a pin instance */
493  if (!This->hPin)
494  return DSERR_GENERIC;
495 
496  /* setup request */
500  State = KSSTATE_RUN;
501 
502  /* set pin to run */
503  Result = SyncOverlappedDeviceIoControl(This->hPin, IOCTL_KS_PROPERTY, (PVOID)&Property, sizeof(KSPROPERTY), (PVOID)&State, sizeof(KSSTATE), &BytesTransferred);
504 
506 
507  if (Result == ERROR_SUCCESS)
508  {
509  /* store result */
510  This->State = State;
511  }
512 
513  /* initialize overlapped struct */
514  ZeroMemory(&Overlapped, sizeof(OVERLAPPED));
515  Overlapped.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
516 
517  /* clear stream header */
518  ZeroMemory(&Header, sizeof(KSSTREAM_HEADER));
519 
520  /* initialize stream header */
521  Header.FrameExtent = This->BufferSize;
522  Header.DataUsed = 0;
523  Header.Data = (This->bMix ? This->MixBuffer : This->Buffer);
524  Header.Size = sizeof(KSSTREAM_HEADER);
525  Header.PresentationTime.Numerator = 1;
526  Header.PresentationTime.Denominator = 1;
527 
528  Result = DeviceIoControl(This->hPin, IOCTL_KS_WRITE_STREAM, NULL, 0, &Header, sizeof(KSSTREAM_HEADER), &BytesTransferred, &Overlapped);
529 
530  if (Result != ERROR_SUCCESS)
531  {
532  DPRINT("Failed submit buffer with %lx\n", Result);
533  return DSERR_GENERIC;
534  }
535 
536  if (This->bMix)
537  {
538  if (!This->hStopEvent)
539  {
540  /* create stop event */
541  This->hStopEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
542  if (!This->hStopEvent)
543  {
544  DPRINT1("Failed to create event object with %x\n", GetLastError());
545  return DSERR_GENERIC;
546  }
547  }
548 
549  /* set state to stop false */
550  This->StopMixerThread = FALSE;
551 
553  if (!hThread)
554  {
555  DPRINT1("Failed to create thread with %x\n", GetLastError());
556  return DSERR_GENERIC;
557  }
558 
559  /* close thread handle */
561  }
562 
563 
564  return DS_OK;
565 }
#define CreateEvent
Definition: winbase.h:3582
#define DSERR_GENERIC
Definition: dsound.h:123
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
#define IOCTL_KS_WRITE_STREAM
Definition: ks.h:139
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:406
#define ERROR_SUCCESS
Definition: deptool.c:10
const GUID KSPROPSETID_Connection
Definition: capturebuffer.c:17
struct CDirectSoundCaptureBufferImpl * LPCDirectSoundCaptureBufferImpl
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define ZeroMemory
Definition: winbase.h:1642
Definition: Header.h:8
HANDLE hEvent
Definition: winbase.h:792
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
smooth NULL
Definition: ftsmooth.c:416
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
void DPRINT(...)
Definition: polytest.cpp:61
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define DS_OK
Definition: dsound.h:116
unsigned long DWORD
Definition: ntddk_ex.h:95
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define DSCBSTART_LOOPING
Definition: dsound.h:393
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
DWORD SyncOverlappedDeviceIoControl(IN HANDLE Handle, IN DWORD IoControlCode, IN LPVOID InBuffer, IN DWORD InBufferSize, OUT LPVOID OutBuffer, IN DWORD OutBufferSize, OUT LPDWORD BytesTransferred OPTIONAL)
Definition: misc.c:298
_In_ DWORD Property
Definition: setupapi.h:1545
enum State_ State
Definition: pofuncs.h:54
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: deviceio.c:136
KSSTATE
Definition: ks.h:1214
DWORD WINAPI MixerThreadRoutine(LPVOID lpParameter)
Definition: capturebuffer.c:48
HANDLE hThread
Definition: wizard.c:27
#define DPRINT1
Definition: precomp.h:8
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43

◆ IDirectSoundCaptureBufferImpl_Stop()

HRESULT WINAPI IDirectSoundCaptureBufferImpl_Stop ( LPDIRECTSOUNDCAPTUREBUFFER8  iface)

Definition at line 569 of file capturebuffer.c.

570 {
572  DWORD Result;
573  KSSTATE State;
574 
576 
577  if (This->State == KSSTATE_STOP)
578  {
579  /* stream has already been stopped */
580  return DS_OK;
581  }
582 
583  if (!This->hPin)
584  return DSERR_GENERIC;
585 
586  /* setup request */
591 
592 
593  /* set pin to stop */
595 
597 
598 
599  if (This->bMix)
600  {
601  /* sanity check */
602  ASSERT(This->hStopEvent);
603  /* reset event */
604  ResetEvent(This->hStopEvent);
605  /* signal event to stop */
606  This->StopMixerThread = TRUE;
607  /* Wait for the event to stop */
608  WaitForSingleObject(This->hStopEvent, INFINITE);
609  }
610 
611 
612  if (Result == ERROR_SUCCESS)
613  {
614  /* store result */
615  This->State = State;
616  return DS_OK;
617  }
618 
619  DPRINT("Failed to stop pin\n");
620  return DSERR_GENERIC;
621 }
#define DSERR_GENERIC
Definition: dsound.h:123
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
const GUID KSPROPSETID_Connection
Definition: capturebuffer.c:17
struct CDirectSoundCaptureBufferImpl * LPCDirectSoundCaptureBufferImpl
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
smooth NULL
Definition: ftsmooth.c:416
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
void DPRINT(...)
Definition: polytest.cpp:61
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define DS_OK
Definition: dsound.h:116
unsigned long DWORD
Definition: ntddk_ex.h:95
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
DWORD SyncOverlappedDeviceIoControl(IN HANDLE Handle, IN DWORD IoControlCode, IN LPVOID InBuffer, IN DWORD InBufferSize, OUT LPVOID OutBuffer, IN DWORD OutBufferSize, OUT LPDWORD BytesTransferred OPTIONAL)
Definition: misc.c:298
_In_ DWORD Property
Definition: setupapi.h:1545
enum State_ State
Definition: pofuncs.h:54
KSSTATE
Definition: ks.h:1214
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
Definition: synch.c:714
#define INFINITE
Definition: serial.h:102
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43

◆ IDirectSoundCaptureBufferImpl_Unlock()

HRESULT WINAPI IDirectSoundCaptureBufferImpl_Unlock ( LPDIRECTSOUNDCAPTUREBUFFER8  iface,
LPVOID  lpvAudioPtr1,
DWORD  dwAudioBytes1,
LPVOID  lpvAudioPtr2,
DWORD  dwAudioBytes2 
)

Definition at line 625 of file capturebuffer.c.

631 {
632  return DS_OK;
633 }
#define DS_OK
Definition: dsound.h:116

◆ MixerThreadRoutine()

DWORD WINAPI MixerThreadRoutine ( LPVOID  lpParameter)

Definition at line 48 of file capturebuffer.c.

50 {
53  DWORD Result, MixPosition, BufferPosition, BytesWritten, BytesRead, MixLength, BufferLength;
55 
56  /* setup audio position property request */
60 
61  MixPosition = 0;
62  BufferPosition = 0;
63  do
64  {
65  /* query current position */
67 
68  /* sanity check */
70 
71  /* FIXME implement samplerate conversion */
72  ASSERT(This->MixFormat.nSamplesPerSec == This->Format->nSamplesPerSec);
73 
74  /* FIXME implement bitrate conversion */
75  ASSERT(This->MixFormat.wBitsPerSample == This->Format->wBitsPerSample);
76 
77  /* sanity check */
78  ASSERT(BufferPosition <= This->BufferSize);
79  ASSERT(MixPosition <= This->MixBufferSize);
80 
81  if (BufferPosition == This->BufferSize)
82  {
83  /* restart from front */
84  BufferPosition = 0;
85  }
86 
87  if (MixPosition == This->MixBufferSize)
88  {
89  /* restart from front */
90  MixPosition = 0;
91  }
92 
93  if (This->MixFormat.nChannels != This->Format->nChannels)
94  {
95  if ((DWORD)Position.PlayOffset >= MixPosition)
96  {
97  /* calculate buffer position difference */
98  MixLength = Position.PlayOffset - MixPosition;
99  }
100  else
101  {
102  /* buffer overlap */
103  MixLength = This->MixBufferSize - MixPosition;
104  }
105 
106  BufferLength = This->BufferSize - BufferPosition;
107 
108  /* convert the format */
109  PerformChannelConversion(&This->MixBuffer[MixPosition], MixLength, &BytesRead, This->MixFormat.nChannels, This->Format->nChannels, This->Format->wBitsPerSample, &This->Buffer[BufferPosition], BufferLength, &BytesWritten);
110 
111  /* update buffer offsets */
112  MixPosition += BytesRead;
113  BufferPosition += BytesWritten;
114  DPRINT("MixPosition %u BufferPosition %u BytesRead %u BytesWritten %u MixLength %u BufferLength %u\n", MixPosition, BufferPosition, BytesRead, BytesWritten, MixLength, BufferLength);
115  }
116 
117  /* Notify Events */
118  if (This->Notify)
119  {
120  DoNotifyPositionEvents(This->Notify, This->CurrentMixPosition, BufferPosition);
121  }
122 
123  /* update offset */
124  InterlockedExchange(&This->CurrentMixPosition, (LONG)BufferPosition);
125 
126  /* FIXME use timer */
127  Sleep(10);
128 
129  }while(InterlockedCompareExchange(&This->StopMixerThread, 0, 0) == 0);
130 
131 
132  /* signal stop event */
133  SetEvent(This->hStopEvent);
134 
135  /* done */
136  return 0;
137 }
VOID DoNotifyPositionEvents(LPDIRECTSOUNDNOTIFY iface, DWORD OldPosition, DWORD NewPosition)
Definition: notify.c:190
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
_Must_inspect_result_ _In_ PFILE_OBJECT _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ FLT_IO_OPERATION_FLAGS _Out_opt_ PULONG BytesWritten
Definition: fltkernel.h:1293
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KSPROPSETID_Audio
Definition: ksmedia.h:951
static COORD Position
Definition: mouse.c:34
struct CDirectSoundCaptureBufferImpl * LPCDirectSoundCaptureBufferImpl
#define InterlockedCompareExchange
Definition: interlocked.h:104
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
_In_ NDIS_HANDLE _In_ PNDIS_REQUEST Request
Definition: ndis.h:5173
long LONG
Definition: pedump.c:60
_In_ ULONG BufferLength
Definition: usbdlib.h:225
smooth NULL
Definition: ftsmooth.c:416
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
void DPRINT(...)
Definition: polytest.cpp:61
#define BufferSize
Definition: classpnp.h:419
unsigned long DWORD
Definition: ntddk_ex.h:95
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
LPVOID lpParameter
Definition: kernel32.h:241
DWORD SyncOverlappedDeviceIoControl(IN HANDLE Handle, IN DWORD IoControlCode, IN LPVOID InBuffer, IN DWORD InBufferSize, OUT LPVOID OutBuffer, IN DWORD OutBufferSize, OUT LPDWORD BytesTransferred OPTIONAL)
Definition: misc.c:298
#define InterlockedExchange
Definition: armddk.h:54
_Must_inspect_result_ _In_ PFILE_OBJECT _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ FLT_IO_OPERATION_FLAGS _Out_opt_ PULONG BytesRead
Definition: fltkernel.h:1255
VOID PerformChannelConversion(PUCHAR Buffer, ULONG BufferLength, PULONG BytesRead, ULONG OldChannels, ULONG NewChannels, ULONG BitsPerSample, PUCHAR Result, ULONG ResultLength, PULONG BytesWritten)
Definition: misc.c:18

Referenced by IDirectSoundCaptureBufferImpl_Start().

◆ NewDirectSoundCaptureBuffer()

HRESULT NewDirectSoundCaptureBuffer ( LPDIRECTSOUNDCAPTUREBUFFER8 OutBuffer,
LPFILTERINFO  Filter,
LPCDSCBUFFERDESC  lpcDSBufferDesc 
)

Definition at line 687 of file capturebuffer.c.

691 {
692  DWORD FormatSize, MixBufferSize;
693  ULONG DeviceId = 0, PinId;
695  WAVEFORMATEX MixFormat;
696 
698 
699  if (!This)
700  {
701  /* not enough memory */
702  return DSERR_OUTOFMEMORY;
703  }
704 
705  /* calculate format size */
706  FormatSize = sizeof(WAVEFORMATEX) + lpcDSBufferDesc->lpwfxFormat->cbSize;
707  /* allocate format struct */
708  This->Format = HeapAlloc(GetProcessHeap(), 0, FormatSize);
709  if (!This->Format)
710  {
711  /* not enough memory */
713  return DSERR_OUTOFMEMORY;
714  }
715 
716  /* sanity check */
717  ASSERT(lpcDSBufferDesc->dwBufferBytes);
718 
719  /* allocate capture buffer */
720  This->Buffer = HeapAlloc(GetProcessHeap(), 0, lpcDSBufferDesc->dwBufferBytes);
721  if (!This->Buffer)
722  {
723  /* not enough memory */
724  HeapFree(GetProcessHeap(), 0, This->Format);
726  return DSERR_OUTOFMEMORY;
727  }
728 
729  /* store buffer size */
730  This->BufferSize = lpcDSBufferDesc->dwBufferBytes;
731  ASSERT(lpcDSBufferDesc->lpwfxFormat->cbSize == 0);
732 
733  do
734  {
735  /* try all available recording pins on that filter */
736  PinId = GetPinIdFromFilter(Filter, TRUE, DeviceId);
737 
738  if (PinId == ULONG_MAX)
739  break;
740 
741  Result = OpenPin(Filter->hFilter, PinId, lpcDSBufferDesc->lpwfxFormat, &This->hPin, TRUE);
742  if (Result == ERROR_SUCCESS)
743  break;
744 
745  DeviceId++;
746  }while(TRUE);
747 
748  if (Result != ERROR_SUCCESS)
749  {
750  /* failed to instantiate the capture pin with the native format
751  * try to compute a compatible format and use that
752  * we could use the mixer api for this purpose but... the kmixer isnt working very good atm
753  */
754 
755  DeviceId = 0;
756  do
757  {
758  /* try all available recording pins on that filter */
759  PinId = GetPinIdFromFilter(Filter, TRUE, DeviceId);
760  DPRINT("PinId %u DeviceId %u\n", PinId, DeviceId);
761 
762  if (PinId == ULONG_MAX)
763  break;
764 
765  if (CreateCompatiblePin(Filter->hFilter, PinId, TRUE, lpcDSBufferDesc->lpwfxFormat, &MixFormat, &This->hPin))
766  {
767  This->bMix = TRUE;
768  CopyMemory(&This->MixFormat, &MixFormat, sizeof(WAVEFORMATEX));
769  break;
770  }
771 
772  DeviceId++;
773  }while(TRUE);
774 
775 
776  if (!This->bMix)
777  {
778  /* FIXME should not happen */
779  DPRINT("failed to compute a compatible format\n");
780  HeapFree(GetProcessHeap(), 0, This->MixBuffer);
781  HeapFree(GetProcessHeap(), 0, This->Buffer);
782  HeapFree(GetProcessHeap(), 0, This->Format);
784  return DSERR_GENERIC;
785  }
786 
787  MixBufferSize = lpcDSBufferDesc->dwBufferBytes;
788  MixBufferSize /= lpcDSBufferDesc->lpwfxFormat->nChannels;
789  MixBufferSize /= (lpcDSBufferDesc->lpwfxFormat->wBitsPerSample/8);
790 
791  MixBufferSize *= This->MixFormat.nChannels;
792  MixBufferSize *= (This->MixFormat.wBitsPerSample/8);
793 
794  /* allocate buffer for mixing */
795  This->MixBuffer = HeapAlloc(GetProcessHeap(), 0, MixBufferSize);
796  if (!This->Buffer)
797  {
798  /* not enough memory */
799  CloseHandle(This->hPin);
800  HeapFree(GetProcessHeap(), 0, This->Buffer);
801  HeapFree(GetProcessHeap(), 0, This->Format);
803  return DSERR_OUTOFMEMORY;
804  }
805  This->MixBufferSize = MixBufferSize;
806  DPRINT1("MixBufferSize %u BufferSize %u\n", MixBufferSize, This->BufferSize);
807  }
808 
809  /* initialize capture buffer */
810  This->ref = 1;
812  This->Filter = Filter;
813  This->State = KSSTATE_STOP;
814  This->bLoop = TRUE;
815 
816  RtlMoveMemory(This->Format, lpcDSBufferDesc->lpwfxFormat, FormatSize);
817 
818  *OutBuffer = (LPDIRECTSOUNDCAPTUREBUFFER8)&This->lpVtbl;
819  return DS_OK;
820 }
LPWAVEFORMATEX lpwfxFormat
Definition: dsound.h:361
#define DSERR_GENERIC
Definition: dsound.h:123
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:406
#define ERROR_SUCCESS
Definition: deptool.c:10
WORD nChannels
Definition: mmreg.h:79
DWORD dwBufferBytes
Definition: dsound.h:359
struct tWAVEFORMATEX WAVEFORMATEX
Definition: austream.idl:23
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define DSERR_OUTOFMEMORY
Definition: dsound.h:125
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
Definition: fltkernel.h:1802
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
void DPRINT(...)
Definition: polytest.cpp:61
ULONG GetPinIdFromFilter(LPFILTERINFO Filter, BOOL bCapture, ULONG Offset)
Definition: devicelist.c:13
DWORD OpenPin(HANDLE hFilter, ULONG PinId, LPWAVEFORMATEX WaveFormatEx, PHANDLE hPin, BOOL bLoop)
Definition: misc.c:212
#define DS_OK
Definition: dsound.h:116
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define CopyMemory
Definition: winbase.h:1640
BOOL CreateCompatiblePin(IN HANDLE hFilter, IN DWORD PinId, IN BOOL bLoop, IN LPWAVEFORMATEX WaveFormatEx, OUT LPWAVEFORMATEX WaveFormatOut, OUT PHANDLE hPin)
Definition: misc.c:517
unsigned long DWORD
Definition: ntddk_ex.h:95
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
WORD cbSize
Definition: mmreg.h:84
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define DPRINT1
Definition: precomp.h:8
WORD wBitsPerSample
Definition: mmreg.h:83
unsigned int ULONG
Definition: retypes.h:1
static IDirectSoundCaptureBuffer8Vtbl vt_DirectSoundCaptureBuffer8
struct IDirectSoundCaptureBuffer8 * LPDIRECTSOUNDCAPTUREBUFFER8
Definition: dsound.h:100
#define HeapFree(x, y, z)
Definition: compat.h:402
#define ULONG_MAX
Definition: limits.h:44

Referenced by CDirectSoundCapture_fnCreateCaptureBuffer().

Variable Documentation

◆ KSDATAFORMAT_SPECIFIER_WAVEFORMATEX

const GUID KSDATAFORMAT_SPECIFIER_WAVEFORMATEX = {0x05589f81L, 0xc356, 0x11ce, {0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a}}

Definition at line 16 of file capturebuffer.c.

◆ KSDATAFORMAT_TYPE_AUDIO

const GUID KSDATAFORMAT_TYPE_AUDIO = {0x73647561L, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}

Definition at line 15 of file capturebuffer.c.

◆ KSEVENTSETID_LoopedStreaming

const GUID KSEVENTSETID_LoopedStreaming = {0x4682B940L, 0xC6EF, 0x11D0, {0x96, 0xD8, 0x00, 0xAA, 0x00, 0x51, 0xE5, 0x1D}}

Definition at line 18 of file capturebuffer.c.

Referenced by IDirectSoundNotify_fnSetNotificationPositions().

◆ KSINTERFACESETID_Standard

const GUID KSINTERFACESETID_Standard = {0x1A8766A0L, 0x62CE, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}}

Definition at line 13 of file capturebuffer.c.

◆ KSMEDIUMSETID_Standard

const GUID KSMEDIUMSETID_Standard = {0x4747B320L, 0x62CE, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}}

Definition at line 14 of file capturebuffer.c.

◆ KSPROPSETID_Connection

const GUID KSPROPSETID_Connection = {0x1D58C920L, 0xAC9B, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}}

◆ vt_DirectSoundCaptureBuffer8

IDirectSoundCaptureBuffer8Vtbl vt_DirectSoundCaptureBuffer8
static
Initial value:
=
{
}
ULONG WINAPI IDirectSoundCaptureBufferImpl_AddRef(LPDIRECTSOUNDCAPTUREBUFFER8 iface)
HRESULT WINAPI IDirectSoundCaptureBufferImpl_Start(LPDIRECTSOUNDCAPTUREBUFFER8 iface, DWORD dwFlags)
HRESULT WINAPI IDirectSoundCaptureBufferImpl_Initialize(LPDIRECTSOUNDCAPTUREBUFFER8 iface, LPDIRECTSOUNDCAPTURE lpDSC, LPCDSCBUFFERDESC lpcDSCBDesc)
HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetFXStatus(LPDIRECTSOUNDCAPTUREBUFFER8 iface, DWORD dwFXCount, LPDWORD pdwFXStatus)
HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetStatus(LPDIRECTSOUNDCAPTUREBUFFER8 iface, LPDWORD lpdwStatus)
HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetCurrentPosition(LPDIRECTSOUNDCAPTUREBUFFER8 iface, LPDWORD lpdwCapturePosition, LPDWORD lpdwReadPosition)
HRESULT WINAPI IDirectSoundCaptureBufferImpl_Stop(LPDIRECTSOUNDCAPTUREBUFFER8 iface)
ULONG WINAPI IDirectSoundCaptureBufferImpl_Release(LPDIRECTSOUNDCAPTUREBUFFER8 iface)
HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetObjectInPath(LPDIRECTSOUNDCAPTUREBUFFER8 iface, REFGUID rguidObject, DWORD dwIndex, REFGUID rguidInterface, LPVOID *ppObject)
HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetFormat(LPDIRECTSOUNDCAPTUREBUFFER8 iface, LPWAVEFORMATEX lpwfxFormat, DWORD dwSizeAllocated, LPDWORD lpdwSizeWritten)
HRESULT WINAPI IDirectSoundCaptureBufferImpl_QueryInterface(LPDIRECTSOUNDCAPTUREBUFFER8 iface, IN REFIID riid, LPVOID *ppobj)
HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetCaps(LPDIRECTSOUNDCAPTUREBUFFER8 iface, LPDSCBCAPS lpDSCBCaps)
HRESULT WINAPI IDirectSoundCaptureBufferImpl_Unlock(LPDIRECTSOUNDCAPTUREBUFFER8 iface, LPVOID lpvAudioPtr1, DWORD dwAudioBytes1, LPVOID lpvAudioPtr2, DWORD dwAudioBytes2)
HRESULT WINAPI IDirectSoundCaptureBufferImpl_Lock(LPDIRECTSOUNDCAPTUREBUFFER8 iface, DWORD dwOffset, DWORD dwBytes, LPVOID *ppvAudioPtr1, LPDWORD pdwAudioBytes1, LPVOID *ppvAudioPtr2, LPDWORD pdwAudioBytes2, DWORD dwFlags)

Definition at line 660 of file capturebuffer.c.

Referenced by NewDirectSoundCaptureBuffer().