IMFTransform::SetInputType method (mftransform.h)

Sets, tests, or clears the media type for an input stream on this Media Foundation transform (MFT).


HRESULT SetInputType(
  [in] DWORD        dwInputStreamID,
  [in] IMFMediaType *pType,
  [in] DWORD        dwFlags


[in] dwInputStreamID

Input stream identifier. To get the list of stream identifiers, call IMFTransform::GetStreamIDs.

[in] pType

Pointer to the IMFMediaType interface, or NULL.

[in] dwFlags

Zero or more flags from the _MFT_SET_TYPE_FLAGS enumeration.

Return value

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

Return code Description
The method succeeded.
The MFT cannot use the proposed media type.
Invalid stream identifier.
The proposed type is not valid. This error code indicates that the media type itself is not configured correctly; for example, it might contain mutually contradictory attributes.
The MFT cannot switch types while processing data. Try draining or flushing the MFT.
You must set the output types before setting the input types.
The MFT could not find a suitable DirectX Video Acceleration (DXVA) configuration.


This method can be used to set, test without setting, or clear the media type:

  • To set the media type, set dwFlags to zero and set pType to a non-NULL pointer that specifies the media type.
  • To test the media type without setting it, set dwFlags to MFT_SET_TYPE_TEST_ONLY and set pType to a non-NULL pointer that specifies the media type. If the media type is acceptable, the method return S_OK. Otherwise, it returns MF_E_INVALIDMEDIATYPE. Regardless of the return value, the current media type does not change.
  • To clear the media type, set pType to NULL.
Setting the media type on one stream may change the acceptable types on another stream.

An MFT may require the caller to set one or more output types before setting the input type. If so, the method returns MF_E_TRANSFORM_TYPE_NOT_SET.

If the MFT supports DirectX Video Acceleration (DXVA) but is unable to find a suitable DXVA configuration (for example, if the graphics driver does not have the right capabilities), the method should return MF_E_UNSUPPORTED_D3D_TYPE. For more information, see Supporting DXVA 2.0 in Media Foundation.

If MFT_UNIQUE_METHOD_NAMES is defined before including mftransform.h, this method is renamed MFTSetInputType. See Creating Hybrid DMO/MFT Objects.


Minimum supported client Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header mftransform.h
Library Mfuuid.lib

See also


Media Foundation Transforms