IVMRSurfaceAllocatorNotify9::AllocateSurfaceHelper method

The AllocateSurfaceHelper method allocates a Direct3D surface based on application-specified parameters.

If you are implementing a custom allocator-presenter for the VMR-9, you can use this method to allocate the surfaces.

Syntax


HRESULT AllocateSurfaceHelper(
  [in]      VMR9AllocationInfo *lpAllocInfo,
  [in, out] DWORD              *lpNumBuffers,
  [out]     IDirect3DSurface9  **lplpSurface
);

Parameters

lpAllocInfo [in]

Pointer to a VMR9AllocationInfo structure that describes the surfaces to create.

lpNumBuffers [in, out]

On input, this parameter specifies the number of surfaces to create. On output, this parameter contains the number of surfaces that the method created.

lplpSurface [out]

Address of an array of IDirect3DSurface9 interface pointers. The size of the array must equal the value in lpNumBuffers. The method fills the array with valid IDirect3DSurface9 pointers for each Direct3D surface that it creates. The caller must release the interface pointers. (Do not put any valid pointers into the array before you call this method, because the method will overwrite them, causing a memory leak.)

Return value

The method returns an HRESULT. Possible values include those in the following table.

Return codeDescription
S_OK

The method succeeded.

 

Remarks

Include DShow.h and D3d9.h before Vmr9.h.

Requirements

Minimum supported client

Windows XP with SP2 [desktop apps only]

Minimum supported server

Windows Server 2003 R2 [desktop apps only]

Header

Vmr9.h

Library

Strmiids.lib

See also

Using the Video Mixing Renderer
IVMRSurfaceAllocatorNotify9 Interface

 

 

Show: