Gets an available media type for an output stream on this Media Foundation transform (MFT).
HRESULT GetOutputAvailableType( DWORD dwOutputStreamID, DWORD dwTypeIndex, IMFMediaType **ppType );
Output stream identifier. To get the list of stream identifiers, call IMFTransform::GetStreamIDs.
Index of the media type to retrieve. Media types are indexed from zero and returned in approximate order of preference.
Receives a pointer to the IMFMediaType interface. The caller must release the interface.
The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.
||The method succeeded.|
||The MFT does not have a list of available output types.|
||Invalid stream identifier.|
||The dwTypeIndex parameter is out of range.|
||You must set the input types before setting the output types.|
The MFT defines a list of available media types for each output stream and orders them by preference. This method enumerates the available media types for an output stream. To enumerate the available types, increment dwTypeIndex until the method returns MF_E_NO_MORE_TYPES.
Setting the media type on one stream can change the available types for another stream (or change the preference order). However, an MFT is not required to update the list of available types dynamically. The only guaranteed way to test whether you can set a particular input type is to call IMFTransform::SetOutputType.
In some cases, an MFT cannot return a list of output types until one or more input types are set. If so, the method returns MF_E_TRANSFORM_TYPE_NOT_SET.
An MFT is not required to implement this method. However, most MFTs should implement this method, unless the supported types are simple and can be discovered through the MFTGetInfo function.
This method can return a partial media type. A partial media type contains an incomplete description of a format, and is used to provide a hint to the caller. For example, a partial type might include just the major type and subtype GUIDs. However, after the client sets the input types on the MFT, the MFT should generally return at least one complete output type, which can be used without further modification. For more information, see Complete and Partial Media Types.
Some MFTs cannot provide an accurate list of output types until the MFT receives the first input sample. For example, the MFT might need to read the first packet header to deduce the format. An MFT should handle this situation as follows:
- Before the MFT receives any input, it offers a list of one or more output types that it could possibly produce. For example, an MPEG-2 decoder might return a media type that describes the MPEG-2 main profile/main level.
- The client selects one of these types (generally the first) and sets it on the output stream.
- The client delivers the first input sample by calling IMFTransform::ProcessInput.
- If the output type does not conform to the input data, the transform signals a format change in the ProcessOutput method. For more information about format changes, see IMFTransform::ProcessOutput.
- The calls GetOutputAvailableType again. At this point, the method should return an updated list of types that reflects the input data.
- The client selects a new output type from this list and calls SetOutputType.
|Minimum supported client||Windows Vista [desktop apps | UWP apps]|
|Minimum supported server||Windows Server 2008 [desktop apps | UWP apps]|