MFCreate2DMediaBuffer

Creates a system-memory buffer object to hold 2D image data.

Syntax

HRESULT MFCreate2DMediaBuffer(
         DWORD dwWidth,
         DWORD dwHeight,
         DWORD dwFourCC,
         BOOL fBottomUp,
         IMFMediaBuffer **ppBuffer
)  

Parameters

dwWidth
Type: DWORD 

[in] Width of the image, in pixels.

dwHeight
Type: DWORD 

[in] Height of the image, in pixels.

dwFourCC
Type: DWORD 

[in] A FOURCC code or D3DFORMAT value that specifies the video format. If you have a video subtype GUID, you can use the first DWORD of the subtype.

fBottomUp
Type: BOOL 

[in] 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.

ppBuffer
Type: IMFMediaBuffer **

[out] Receives a pointer to the IMFMediaBuffer interface.

Return value

Type: HRESULT 

Return codes
Return code Description
S_OK Success.
MF_E_INVALIDMEDIATYPE Unrecognized video format.

Refer to Media Foundation return codes.

Remarks

The returned buffer object also exposes the IMF2DBuffer2 interface.

Requirements

Header: Declared in mfapi.h.

Library: Use Mfplat.lib.