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

A DMO can designate some of its output streams as discardable or optional:

  • A discardablestream contains data that the application can discard, either completely or on occasional samples.

  • An optionalstream is a secondary stream that not all applications will need or that contains additional information about a primary stream.

To query whether a stream is discardable or optional, call the IMediaObject::GetOutputStreamInfomethod and check the pdwFlagsparameter.

The DMO_OUTPUT_STREAMF_DISCARDABLE flag indicates the stream is discardable.

The DMO_OUTPUT_STREAMF_OPTIONAL flag indicates that the stream is optional.

In general, at least one stream should be nonoptional.

When you call the IMediaObject::ProcessOutputmethod, you can discard data from one or more streams by setting the DMO_PROCESS_OUTPUT_DISCARD_WHEN_NO_BUFFER flag in the dwFlagsparameter. For each stream that you want to discard, set the pBuffermember of the DMO_OUTPUT_DATA_BUFFERstructure to NULL.

The following list shows the two ways the DMO attempts to discard the data from those streams:

  • If the stream is discardable or optional, the DMO is guaranteed to discard the data.

  • Otherwise, the DMO discards the data if possible. However, there is no guarantee that it can do so.

If a pBuffermember is NULL but you do not set the DMO_PROCESS_OUTPUT_DISCARD_WHEN_NO_BUFFER flag, the DMO does not discard the data, even if the stream is discardable or optional.

If pBufferis NULL but no data was discarded, the DMO signals the DMO_OUTPUT_DATA_BUFFERF_INCOMPLETE flag to indicate that the stream still has data.

If you do not process an output stream, but do not discard it, the DMO might be unable to generate data for other output streams.

If you never use an optional stream, you do not have to set its media type. The same is not true for discardable streams; you must always set the media type on a discardable stream. This is the only functional difference between optional and discardable streams.

See Also