Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

MFInitAMMediaTypeFromMFMediaType function

Initializes a DirectShow AM_MEDIA_TYPE structure from a Media Foundation media type.

Syntax


HRESULT MFInitAMMediaTypeFromMFMediaType(
  IMFMediaType *pMFType,
  GUID guidFormatBlockType,
  AM_MEDIA_TYPE *pAMType
);

Parameters

pMFType

Pointer to the IMFMediaType interface of the media type to convert.

guidFormatBlockType

Format type GUID. This value corresponds to the formattype member of the AM_MEDIA_TYPE structure and specifies the type of format block to allocate. If the value is GUID_NULL, the function attempts to deduce the correct format block, based on the major type and subtype.

pAMType

Pointer to an AM_MEDIA_TYPE structure. The function allocates memory for the format block. The caller must release the format block by calling CoTaskMemFree on the pbFormat member.

Return value

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

Return codeDescription
S_OK

The function succeeded.

MF_E_INVALIDMEDIATYPE

The media type is not valid.

 

Remarks

This function can also be used with the following format structures that are equivalent to AM_MEDIA_TYPE:

  • DMO_MEDIA_TYPE (DirectX Media Objects)
  • WM_MEDIA_TYPE (Windows Media Format SDK)

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Mfapi.h

Library

Mfplat.lib

DLL

Mfplat.dll

See also

Media Foundation Functions

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.