The IMemoryData interface contains methods that set and retrieve memory data on audio data objects. Audio data objects provide the underlying data which stream samples access. This interface provides a way to initialize memory buffers and to set actual amounts of audio data in the objects. Additionally, the GetInfo method can be used to retrieve audio memory data.
Implement this interface on underlying audio data objects that audio stream sample objects will access.
Typically these methods are called by the IAudioMediaStream or IAudioStreamSample object, rather than by the application.
IUnknown methods Description QueryInterface Retrieves pointers to supported interfaces. AddRef Increments the reference count. Release Decrements the reference count. IMemoryData methods Description SetBuffer Initializes a memory buffer with a pointer to memory and length. GetInfo Retrieves information describing an audio data object. SetActual Sets the amount of audio data currently in the object, in bytes.
Retrieves information describing an audio data object.
Syntax
HRESULT GetInfo(
DWORD *pdwLength,
BYTE **ppbData,
DWORD *pcbActualData );
Parameters
- pdwLength
- [out] Length of memory in bytes, if non-NULL.
- ppbData
- [out] Pointer to the memory, if non-NULL.
- pcbActualData
- [out] Length of data in bytes, if non-NULL.
Return Value
Returns an HRESULT value.
Remarks
This method determines how much data the object currently contains as last set by SetActual.
Sets the amount of audio data currently in the object.
Syntax
HRESULT SetActual(
DWORD cbDataValid
);
Parameters
- cbDataValid
- [in] Amount of data, in bytes.
Return Value
Returns S_OK if successful or E_POINTER if the required parameter is NULL.
Remarks
This method is usually called by the IAudioMediaStream or IAudioStreamSample object, rather than by the application.
Initializes a memory buffer with a pointer to memory and length.
Syntax
HRESULT SetBuffer(
DWORD cbSize,
BYTE *pbData,
DWORD dwFlags );
Parameters
- cbSize
- [in] Size of memory pointed to by pbData, in bytes.
- pbData
- [in] Pointer to memory that this object will use.
- dwFlags
- [in] Reserved for flag data. Must be zero.
Return Value
Returns S_OK if successful or E_INVALIDARG if cbSize is zero or pbData is NULL.
Remarks
This method can be called as often as needed. When using IStreamSample::Update to update samples asynchronously, make sure that SetBuffer is never called before an update is completed.
Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.