Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

MFCreate2DMediaBuffer function

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

Syntax


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

Parameters

dwWidth [in]

Width of the image, in pixels.

dwHeight [in]

Height of the image, in pixels.

dwFourCC [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 [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 [out]

Receives a pointer to the IMFMediaBuffer interface.

Return value

This function can return one of these values.

Return codeDescription
S_OK

Success.

MF_E_INVALIDMEDIATYPE

Unrecognized video format.

 

Remarks

The returned buffer object also exposes the IMF2DBuffer2 interface.

Requirements

Minimum supported client

Windows 8 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2012 [desktop apps | Windows Store apps]

Minimum supported phone

Windows Phone 8

Header

Mfapi.h

Library

Mfplat.lib

DLL

Mfplat.dll

See also

Media Foundation Functions

 

 

Show:
© 2016 Microsoft