Microsoft Windows CE 3.0  

IDsCaptureDriverBuffer::GetPosition

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The IDsCaptureDriverBuffer::GetPositionmethod is called when DirectSound is querying the current position of the specified sound capture buffer.

HRESULT GetCurrentPosition(
LPDWORD
lpdwCurrentCaptureCursor
,
LPDWORD
lpdwCurrentWriteCursor
);

Parameters

lpdwCurrentCaptureCursor
Pointer to a doubleword into which the driver should write the current capture cursor.
lpdwCurrentWriteCursor
Pointer to a doubleword into which the driver should write the current write cursor.

Return Values

Returns DS_OK if successful, or one of the following error values otherwise:

  • DSERR_INVALIDCALL
  • DSERR_INVALIDPARAM

    Remarks

    The driver returns two values: the current capture cursor, and the current write cursor. The capture cursor is the position which is currently being captured. The write cursor is the next position at which it is acceptable to write new data into the buffer. The write cursor should be as close as possible to the capture cursor — preferably within one or two samples. Note that DirectSound does not return these exact values to applications; instead it adds a buffer zone of about 10 milliseconds to the write cursor to cover multi-tasking delays, and so on.

    Some hardware may not be able to notify DirectSound when a one-shot buffer has finished capturing. Therefore, if the driver returns a position that is equal to the length of the buffer, DirectSound assumes that the buffer has finished capturing and should stop. DirectSound then calls IDsCaptureDriverBuffer::Stopon that buffer. This should only happen for one-shot secondary buffers.



     Last updated on Tuesday, July 13, 2004

    © 2004 Microsoft Corporation. All rights reserved.