IVMRSurfaceAllocatorNotify::AdviseSurfaceAllocator

 
Microsoft DirectShow 9.0

IVMRSurfaceAllocatorNotify::AdviseSurfaceAllocator

The AdviseSurfaceAllocator method is called by an application to instruct the VMR to use a custom allocator-presenter.

Syntax

  HRESULT AdviseSurfaceAllocator(
  DWORD_PTR  dwUserID,
IVMRSurfaceAllocator*lpIVRMSurfaceAllocator
);

Parameters

dwUserID

[in] An application-defined DWORD_PTR that uniquely identifies this instance of the VMR in scenarios when multiple instances of the VMR are being used with a single instance of an allocator-presenter.

lpIVMRSurfaceAllocator

[in]  Specifies the IVMRSurfaceAllocator interface on the new allocator-presenter. If this value is NULL, then the VMR will release the client allocator-presenter and restore its default allocator-presenter.

Return Values

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

The method will cause the default allocator-presenter to be uninstalled and destroyed, and replaced with the specified new component. The new component must also support the IVMRImagePresenter interface.

This method can be called only once in the lifetime of the VMR. The VMR continues to use the allocator-presenter until the VMR is itself deleted. When the VMR is finally released, it releases its reference count on the custom allocator-presenter object, which allows that object to be freed.

Requirements

Header: Declared in Strmif.h; include Dshow.h.

Library: Use Strmiids.lib.

See Also