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.
When to Implement
Implement this interface on underlying audio data objects that audio stream sample objects will access.
When to Use
Typically these methods are called by the IAudioMediaStream or IAudioStreamSample object, rather than by the application.
Methods in Vtable Order
| 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.
HRESULT GetInfo(
DWORD *pdwLength,
BYTE **ppbData,
DWORD *pcbActualData );
Returns S_OK if successful.
This method determines how much data is actually in the object at the moment as last set by SetActual.
Sets the amount of audio data currently in the object.
HRESULT SetActual(
DWORD cbDataValid
);
Returns S_OK if successful or E_POINTER if the required parameter is NULL.
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.
HRESULT SetBuffer(
DWORD cbSize,
BYTE *pbData,
DWORD dwFlags );
Returns S_OK if successful or E_INVALIDARG if cbSize is zero or pbData is NULL.
This method can be called more than once.
Do not call this method when the IStreamSample::Update method is processing a sample.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.