IMFSourceReaderEx::GetTransformForStream method (mfreadwrite.h)

Gets a pointer to a Media Foundation transform (MFT) for a specified stream.

Syntax

HRESULT GetTransformForStream(
  [in]  DWORD        dwStreamIndex,
  [in]  DWORD        dwTransformIndex,
  [out] GUID         *pGuidCategory,
  [out] IMFTransform **ppTransform
);

Parameters

[in] dwStreamIndex

The stream to query for the MFT. The value can be any of the following.

Value Meaning
0–0xFFFFFFFB
The zero-based index of a stream.
MF_SOURCE_READER_FIRST_VIDEO_STREAM
0xFFFFFFFC
The first video stream.
MF_SOURCE_READER_FIRST_AUDIO_STREAM
0xFFFFFFFD
The first audio stream.

[in] dwTransformIndex

The zero-based index of the MFT to retrieve.

[out] pGuidCategory

Receives a GUID that specifies the category of the MFT. For a list of possible values, see MFT_CATEGORY.

[out] ppTransform

Receives a pointer to the IMFTransform interface of the MFT. The caller must release the interface.

Return value

This method can return one of these values.

Return code Description
S_OK
Success.
MF_E_INVALIDINDEX
The dwTransformIndex parameter is out of range.
MF_E_INVALIDSTREAMNUMBER
The dwStreamIndex parameter is invalid.

Remarks

You can use this method to configure an MFT after it is inserted into the processing chain. Do not use the pointer returned in ppTransform to set media types on the MFT or to process data. In particular, calling any of the following IMFTransform methods could have unexpected results.

If a decoder is present, it appears at index position zero.

To avoid losing any data, you should drain the source reader before calling this method. For more information, see Draining the Data Pipeline.

Requirements

Requirement Value
Minimum supported client Windows 8 [desktop apps | UWP apps]
Minimum supported server Windows Server 2012 [desktop apps | UWP apps]
Target Platform Windows
Header mfreadwrite.h

See also

IMFSourceReaderEx