The IMemoryData interface contains methods which 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 which will be accessed by audio stream sample objects.
When to Use
Typically these methods are usually 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 including how much data is actually in the object at the moment as last set by SetActual. |
SetActual | Sets the actual amount of audio data now in the object, in bytes. |
Retrieves information describing an audio data object including how much data is actually in the object at the moment as last set by SetActual.
HRESULT GetInfo(
DWORD *pdwLength,
BYTE **ppbData,
DWORD *pcbActualData );
Returns S_OK if successful.
Sets the actual amount of audio data now in the object, in bytes.
HRESULT SetActual(
DWORD cbDataValid
);
Returns S_OK if successful or E_POINTER if required parameters 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 either the cbSize is 0 or pbData is NULL.
This method can be called more than once but should not be called when owned by a sample being processed by the IStreamSample::Update method.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.