Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This method sets the media type on an output stream or tests whether a media type is acceptable.

Syntax

HRESULT SetOutputType(
  DWORD 
dwOutputStreamIndex,
  const DMO_MEDIA_TYPE* 
pmt,
  DWORD 
dwFlags
);

Parameters

dwOutputStreamIndex

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

pmt

[in] Pointer to a DMO_MEDIA_TYPEstructure that specifies the media type.

dwFlags

Bitwise combination of zero or more flags from the DMO_SET_TYPE_FLAGSenumeration.

Return Value

Returns an HRESULTvalue. Possible values include the following.

Value Description

S_OK

Success

S_FALSE

Media type is not acceptable

DMO_E_INVALIDSTREAMINDEX

Invalid stream index

DMO_E_TYPE_NOT_ACCEPTED

Media type was not accepted

Remarks

Call this method to test, set, or clear the media type on an output 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 dwFlagsto 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 pmtto 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, unless the stream is optional.

The media types that are currently set on other streams can affect whether the media type is acceptable.

Requirements

Header dmo.h
Library Dmoguid.lib
Windows Embedded CE Windows CE .NET 4.1 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also