MFCreateDXSurfaceBuffer function (mfapi.h)

Creates a media buffer object that manages a Direct3D 9 surface.

Syntax

HRESULT MFCreateDXSurfaceBuffer(
  [in]  REFIID         riid,
  [in]  IUnknown       *punkSurface,
  [in]  BOOL           fBottomUpWhenLinear,
  [out] IMFMediaBuffer **ppBuffer
);

Parameters

[in] riid

Identifies the type of Direct3D 9 surface. Currently this value must be IID_IDirect3DSurface9.

[in] punkSurface

A pointer to the IUnknown interface of the DirectX surface.

[in] fBottomUpWhenLinear

If TRUE, the buffer's IMF2DBuffer::ContiguousCopyTo method copies the buffer into a bottom-up format. The bottom-up format is compatible with GDI for uncompressed RGB images. If this parameter is FALSE, the ContiguousCopyTo method copies the buffer into a top-down format, which is compatible with DirectX.

For more information about top-down versus bottom-up images, see Image Stride.

[out] ppBuffer

Receives a pointer to the IMFMediaBuffer interface. The caller must release the buffer.

Return value

The function returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK
The method succeeded.
E_INVALIDARG
Invalid argument.

Remarks

This function creates a media buffer object that holds a pointer to the Direct3D surface specified in punkSurface. Locking the buffer gives the caller access to the surface memory. When the buffer object is destroyed, it releases the surface. For more information about media buffers, see Media Buffers.

Note  This function does not allocate the Direct3D surface itself.
 
The buffer object created by this function also exposes the IMF2DBuffer interface. For more information, see DirectX Surface Buffer.

This function does not support DXGI surfaces.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header mfapi.h
Library Evr.lib
DLL Evr.dll

See also

DirectX Surface Buffer

Media Buffers

Media Foundation Functions