IResourceConsumer Interface

The IResourceConsumer interface implements a resource consumer that requests resources from a resource manager that supports the IResourceManager interface.

Implement this interface on any object that requests resources from a resource manager. (The filter graph manager acts as a resource manager for Microsoft® DirectShow®.) After implementing this interface, the object can register resources that it wants to use. It passes a pointer to this interface when it does this so that the resource manager can use methods on this interface to inform the object that a resource is available, or to release a resource that it is using.

A resource manager that implements the IResourceManager interface calls methods on this interface.

Methods in Vtable Order

IUnknown methodsDescription
QueryInterface Returns pointers to supported interfaces.
AddRef Increments the reference count.
Release Decrements the reference count.
IResourceManager methodsDescription
AcquireResource Notifies the resource consumer that a resource might be acquired.
ReleaseResource Requests the resource consumer to release the specified resource.

IResourceConsumer::AcquireResource

IResourceConsumer Interface

Notifies the resource consumer that a resource might be acquired.

Syntax

HRESULT AcquireResource(
  LONG idResource
  );

Parameters

idResource
[in] Resource identifier of the resource to be acquired.

Return Value

Returns one of the following values.
S_OK Consumer has successfully acquired the resource.
S_FALSE Consumer has not acquired the resource but will use IResourceManager::NotifyAcquire when it does.
VFW_S_RESOURCE_NOT_NEEDED Consumer no longer needs the resource.
Error Value Consumer tried to acquire the resource but failed.

IResourceConsumer::ReleaseResource

IResourceConsumer Interface

Requests the resource consumer to release the specified resource.

Syntax

HRESULT ReleaseResource(
  LONG idResource
  );

Parameters

idResource
[in] Resource identifier to be released.

Return Value

Returns S_OK if the consumer has released it and requires it again when it becomes available, or S_FALSE if the consumer has not released it but will use IResourceManager::NotifyRelease when it does.


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