IMFTransform::SetOutputType Method

Sets, tests, or clears the media type for an output stream on this Media Foundation transform (MFT).

Syntax

public:
HRESULT SetOutputType(
         DWORD dwOutputStreamID,
         IMFMediaType *pType,
         DWORD dwFlags
)  

Parameters

dwOutputStreamID
Type: DWORD 

Output stream identifier. To get the list of stream identifiers, call IMFTransform::GetStreamIDs.

pType
Type: IMFMediaType *

[in, optional] Pointer to the IMFMediaType interface, or NULL.

dwFlags
Type: DWORD 

Zero or more flags from the _MFT_SET_TYPE_FLAGS enumeration.

Return value

Type: HRESULT 

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return codes
Return code Description
S_OK The method succeeded.
MF_E_INVALIDMEDIATYPE The transform cannot use the proposed media type.
MF_E_INVALIDSTREAMNUMBER Invalid stream identifier.
MF_E_INVALIDTYPE The proposed type is not valid. This error code indicates that the media type itself is not configured correctly; for example, it might contain mutually contradictory flags.
MF_E_TRANSFORM_CANNOT_CHANGE_MEDIATYPE_WHILE_PROCESSING The MFT cannot switch types while processing data. Try draining or flushing the MFT.
MF_E_TRANSFORM_TYPE_NOT_SET You must set the input types before setting the output types.
MF_E_UNSUPPORTED_D3D_TYPE The MFT could not find a suitable DirectX Video Acceleration (DXVA) configuration.

Refer to Media Foundation return codes.

Remarks

This method can be used to set, test without setting, or clear the media type:

Setting the media type on one stream may change the acceptable types on another stream.

An MFT may require the caller to set one or more input types before setting the output type. If so, the method returns MF_E_TRANSFORM_TYPE_NOT_SET.

If the MFT supports DirectX Video Acceleration (DXVA) but is unable to find a suitable DXVA configuration (for example, if the graphics driver does not have the right capabilities), the method should return MF_E_UNSUPPORTED_D3D_TYPE. For more information, see Supporting DXVA 2.0 in Media Foundation.

If MFT_UNIQUE_METHOD_NAMES is defined before including mftransform.h, this method is renamed MFTSetOutputType. See Creating Hybrid DMO/MFT Objects.

Requirements

Header: Declared in mftransform.h.

Library: Use Mfuuid.lib.