IAMResourceControl Interface

The IAMResourceControl interface enables an application to open and hold an audio device resource before it's actually needed, so that playback can be guaranteed, or so that the application can learn in advance that a device is not available.

A filter can implement IAMResourceControl for use with a resource that might sometimes be unavailable. This interface is implemented on the Microsoft® DirectShow® Audio Capture and Audio Renderer filters.

Methods in Vtable Order

IUnknown methodsDescription
QueryInterface Retrieves pointers to supported interfaces.
AddRef Increments the reference count.
Release Decrements the reference count.
IAMResourceControl methodsDescription
Reserve Reserves or unreserves a device resource.

IAMResourceControl::Reserve

IAMResourceControl Interface

Reserves or unreserves a device resource.

Syntax

HRESULT Reserve(
    DWORD dwFlags
     PVOID pvReserved
);

Parameters

dwFlags
[in] Flag indicating whether to reserve or unreserve this device. For possible values, see Remarks.
pvReserved
[in] Must be NULL.

Return Value

Returns S_OK if the device was successfully reserved or unreserved, S_FALSE if the device is currently reserved and will continue to be held, or an an HRESULT error code if the device can't be reserved.

Remarks

The allowable values for dwFlags are defined in the AMRESCTL_RESERVEFLAGS enumeration.

Important  A resource can be reserved multiple times. The reserve count is incremented or decremented only if S_OK is returned. Each successful call (one that returns S_OK) to reserve a device must be matched by a call to unreserve it.


Top of Page Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.