This topic has not yet been rated - Rate this topic

IVMRSurfaceAllocator::AllocateSurface method

Applies to: desktop apps only

The AllocateSurface method allocates a DirectDraw surface.

Syntax

HRESULT AllocateSurface(
  [in]   DWORD_PTR dwUserID,
  [in]   VMRALLOCATIONINFO *lpAllocInfo,
  [in]   DWORD *lpdwActualBuffers,
  [out]  LPDIRECTDRAWSURFACE7 *lplpSurface
);

Parameters

dwUserID [in]

An application-defined DWORD_PTR cookie that uniquely identifies this instance of the VMR for use in scenarios when one instance of the allocator-presenter is used with multiple VMR instances.

lpAllocInfo [in]

Specifies the VMRALLOCATIONINFO structure. See Remarks.

lpdwActualBuffers [in]

[out] On input this parameter is used to request the number of buffers desired. On output it receives the actual number of buffers created.

lplpSurface [out]

Address of a pointer that receives the Direct3D surface.

Return value

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

Return codeDescription
E_POINTER

One of the pointers is invalid.

E_INVALIDARG

In dwFlags, the AMAP_3D_TARGET was combined with AMAP_FORCE_SYSMEM or AMAP_ALLOW_SYSMEM.

E_FAIL

One or more members of the BITMAPINFOHEADER structure specified by lpAllocInfo->lpHdr is incorrect.

 

Remarks

Before calling AllocateSurface explicitly, a client application should call IVMRSurfaceAllocator::FreeSurface to be sure that the DirectDraw decoding surface front buffer is NULL. If it is not NULL at the time an application calls AllocateSurface, the debug version of quartz.dll will cause an assertion.

When implementing this method in a custom allocator-presenter, you must examine the value of lpAllocInfo->lpHdr->biBitCount. If biBitCount is zero, then you must set it to the pixel depth for the current display. If BiBitCount is left at zero, the surface allocation will fail and a new (default) VMR will be created.

Requirements

Minimum supported client

Windows XP with SP1

Minimum supported server

Windows Server 2003

Header

Strmif.h (include Dshow.h)

Library

Strmiids.lib

See also

Error and Success Codes
Using the Video Mixing Renderer
IVMRSurfaceAllocator Interface

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Typo
Under "Syntax" the parameter lpdwActualBuffers is marked as [in], while itis actually [in, out].