MFWrapMediaType

Creates a media type that wraps another media type.

Syntax

HRESULT MFWrapMediaType(
         IMFMediaType *pOrig,
         REFGUID MajorType,
         REFGUID SubType,
         IMFMediaType **ppWrap
)  

Parameters

pOrig
Type: IMFMediaType *

[in] A pointer to the IMFMediaType interface of the media type to wrap in a new media type.

MajorType
Type: REFGUID 

[in] A GUID that specifies the major type for the new media type. For a list of possible values, see Major Media Types.

SubType
Type: REFGUID 

[in] A GUID that specifies the subtype for the new media type. For possible values, see:

Applications can define custom subtype GUIDs.

ppWrap
Type: IMFMediaType **

[out] Receives a pointer to the IMFMediaType interface of the new media type that wraps the original media type. The caller must release the interface.

Return value

Type: HRESULT 

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

Refer to Media Foundation return codes.

Remarks

The original media type (pOrig) is stored in the new media type under the MF_MT_WRAPPED_TYPE attribute. To extract the original media type, call MFUnwrapMediaType.

Requirements

Header: Declared in mfapi.h.

Library: Use mfplat.lib.