IMediaObject::SetInputType method

The SetInputType method sets the media type on an input stream, or tests whether a media type is acceptable.


HRESULT SetInputType(
  DWORD                dwInputStreamIndex,
  const DMO_MEDIA_TYPE *pmt,
  DWORD                dwFlags



Zero-based index of an input stream on the DMO.


Pointer to a DMO_MEDIA_TYPE structure that specifies the media type.


Bitwise combination of zero or more flags from the DMO_SET_TYPE_FLAGS enumeration.

Return value

Returns an HRESULT value. Possible values include those in the following table.

Return code Description
Invalid stream index
Media type was not accepted
Media type is not acceptable
Media type was set successfully, or is acceptable


Call this method to test, set, or clear the media type on an input stream:

  • To test the media type without setting it, use the DMO_SET_TYPEF_TEST_ONLY flag. If the media type is not acceptable, the method returns S_FALSE.
  • To set the media type, set dwFlags to zero. If the media type is not acceptable, the method returns DMO_E_TYPE_NOT_ACCEPTED.
  • To clear the current media type (if any), use the DMO_SET_TYPEF_CLEAR flag and set pmt to NULL. When the method returns, the stream no longer has a media type. The DMO cannot process samples until the application sets a new media type.
The media types that are currently set on other streams can affect whether the media type is acceptable.


Target Platform Windows
Header mediaobj.h (include Dmo.h)
Library Dmoguids.lib

See also

IMediaObject Interface