IVMRSurfaceAllocator::PrepareSurface method (strmif.h)

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The PrepareSurface method prepares the DirectDraw surface to have the next video frame decoded into it.

Syntax

HRESULT PrepareSurface(
  [in] DWORD_PTR            dwUserID,
  [in] LPDIRECTDRAWSURFACE7 lpSurface,
  [in] DWORD                dwSurfaceFlags
);

Parameters

[in] dwUserID

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.

[in] lpSurface

Specifies the DirectDraw surface

[in] dwSurfaceFlags

Double word containing the surface flags. See Remarks.

Return value

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

Remarks

The only flag that the VMR currently checks here is AM_GBF_NOTASYNCPOINT (0x00000002), which indicates that you are not going to fill this buffer with a sync point (keyframe).

Requirements

Requirement Value
Minimum supported client Windows XP with SP1 [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header strmif.h (include Dshow.h)
Library Strmiids.lib

See also

IVMRSurfaceAllocator Interface

Using the Video Mixing Renderer