MFInitMediaTypeFromWaveFormatEx

Initializes a media type from a WAVEFORMATEX structure.

Syntax

HRESULT MFInitMediaTypeFromWaveFormatEx(
         IMFMediaType *pMFType,
         const WAVEFORMATEX *pWaveFormat,
         UINT32 cbBufSize
)  

Parameters

pMFType
Type: IMFMediaType *

[in]

Pointer to the IMFMediaType interface of the media type to initialize. To create the uninitialized media type object, call MFCreateMediaType.

pWaveFormat
Type: WAVEFORMATEX *

[in]

Pointer to a WAVEFORMATEX structure that describes the media type. The caller must fill in the structure members before calling this function.

cbBufSize
Type: UINT32 

[in]

Size of the WAVEFORMATEX structure, in bytes.

Return value

Type: HRESULT 

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

Return codes
Return code Description
S_OK The function succeeded.

Refer to Media Foundation return codes.

Requirements

Header: Declared in mfapi.h.

Library: Use mfplat.lib.