Gets an available media type for an output stream on this Media Foundation transform (MFT).
public:
HRESULT GetOutputAvailableType(
DWORD dwOutputStreamID,
DWORD dwTypeIndex,
IMFMediaType **ppType
)
dwOutputStreamID
Type: DWORD
Output stream identifier. To get the list of stream identifiers, call IMFTransform::GetStreamIDs.
dwTypeIndex
Type: DWORD
Index of the media type to retrieve. Media types are indexed from zero and returned in approximate order of preference.
ppType
Type: IMFMediaType **
[out, optional] Receives a pointer to the IMFMediaType interface. The caller must release the interface.
Type: HRESULT
The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.
| Return code | Description |
|---|---|
| S_OK | The method succeeded. |
| E_NOTIMPL | The MFT does not have a list of available output types. |
| MF_E_INVALIDSTREAMNUMBER | Invalid stream identifier. |
| MF_E_NO_MORE_TYPES | The dwTypeIndex parameter is out of range. |
| MF_E_TRANSFORM_TYPE_NOT_SET | You must set the input types before setting the output types. |
Refer to Media Foundation return codes.
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:
If MFT_UNIQUE_METHOD_NAMES is defined before including mftransform.h, this method is renamed MFTGetOutputAvailableType. See Creating Hybrid DMO/MFT Objects.
If the MFT stores a media type internally, the MFT should return a clone of the media type, not a pointer to the original type. Otherwise, the caller might modify the type and alter the internal state of the MFT.
Header: Declared in mftransform.h.
Library: Use Mfuuid.lib.