IMFSourceReader::GetCurrentMediaType method

Gets the current media type for a stream.

Syntax

HRESULT GetCurrentMediaType(
  DWORD        dwStreamIndex,
  IMFMediaType **ppMediaType
);

Parameters

dwStreamIndex

The stream to query. 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.

ppMediaType

Receives a pointer to the IMFMediaType interface. The caller must release the interface.

Return Value

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.
MF_E_INVALIDSTREAMNUMBER
The dwStreamIndex parameter is invalid.

Remarks

This interface is available on Windows Vista if Platform Update Supplement for Windows Vista is installed.

Requirements

   
Minimum supported client Windows 7, Windows Vista and Platform Update Supplement for Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 R2 [desktop apps | UWP apps]
Target Platform Windows
Header mfreadwrite.h

See Also

IMFSourceReader

Source Reader