IMFMediaTypeHandler::IsMediaTypeSupported Method

Queries whether the object supports a specified media type.

Syntax

public:
HRESULT IsMediaTypeSupported(
         IMFMediaType *pMediaType,
         _Outptr_opt_result_maybenull_ IMFMediaType **ppMediaType
)  

Parameters

pMediaType
Type: IMFMediaType *

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

ppMediaType
Type: Outptr_opt_result_maybenull IMFMediaType **

Receives a pointer to the IMFMediaType interface of the closest matching media type, or receives the value NULL. If non-NULL, the caller must release the interface. This parameter can be NULL. See Remarks.

Return value

Type: HRESULT 

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

Return codes
Return code Description
S_OK The method succeeded.
MF_E_INVALIDMEDIATYPE The object does not support this media type.

Refer to Media Foundation return codes.

Remarks

If the object supports the media type given in pMediaType, the method returns S_OK. For a media source, it means the source can generate data that conforms to that media type. For a media sink, it means the sink can receive data that conforms to that media type. If the object does not support the media type, the method fails.

The ppMediaType parameter is optional. If the method fails, the object might use ppMediaType to return a media type that the object does support, and which closely matches the one given in pMediaType. The method is not guaranteed to return a media type in ppMediaType. If no type is returned, this parameter receives a NULL pointer. If the method succeeds, this parameter receives a NULL pointer. If the caller sets ppMediaType to NULL, this parameter is ignored.

Requirements

Header: Declared in mfidl.h.

Library: Use mfuuid.lib.