Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Collapse the table of content
Expand the table of content

MFInitVideoFormat_RGB function

[This API is not supported and may be altered or unavailable in the future. Applications should avoid using the MFVIDEOFORMAT structure, and use media type attributes instead. For more information, see Video Media Types.]

Initializes an MFVIDEOFORMAT structure for an uncompressed RGB video format.


HRESULT MFInitVideoFormat_RGB(
  _In_ MFVIDEOFORMAT *pVideoFormat,
  _In_ DWORD         dwWidth,
  _In_ DWORD         dwHeight,
  _In_ DWORD         D3Dfmt


pVideoFormat [in]

A pointer to an MFVIDEOFORMAT structure. The functions fills in the structure members with the format information.

dwWidth [in]

The width of the video, in pixels.

dwHeight [in]

The height of the video, in pixels.

D3Dfmt [in]

A D3DFORMAT value that specifies the RGB format.

Return value

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.


This function fills in some reasonable default values for the specified RGB format.

Developers are encouraged to use media type attributes instead of using the MFVIDEOFORMAT structure. See Media Type Attributes.

In general, you should avoid calling this function. If you know all of the format details, you can fill in the MFVIDEOFORMAT structure without this function. If you do not know all of the format details, attributes are preferable to using the MFVIDEOFORMAT structure.

Note  Prior to Windows 7, this function was exported from evr.dll. Starting in Windows 7, this function is exported from mfplat.dll, and evr.dll exports a stub function that calls into mfplat.dll. For more information, see Library Changes in Windows 7.


Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]







See also

Media Foundation Functions
Media Types
Uncompressed Video Media Types
Video Media Types



Community Additions

© 2015 Microsoft