IMFCaptureSource::GetAvailableDeviceMediaType method

Gets a format that is supported by one of the capture streams.

Syntax


HRESULT GetAvailableDeviceMediaType(
  [in]  DWORD dwSourceStreamIndex,
  [in]  DWORD dwMediaTypeIndex,
  [in]  IMFMediaType **ppMediaType
);

Parameters

dwSourceStreamIndex [in]

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

ValueMeaning
0–0xFFFFFFFB

The zero-based index of a stream. To get the number of streams, call IMFCaptureSource::GetDeviceStreamCount.

MF_CAPTURE_ENGINE_FIRST_SOURCE_PHOTO_STREAM
0xFFFFFFFB

The first image stream.

MF_CAPTURE_ENGINE_FIRST_SOURCE_VIDEO_STREAM
0xFFFFFFFC

The first video stream.

MF_CAPTURE_ENGINE_FIRST_SOURCE_AUDIO_STREAM
0xFFFFFFFD

The first audio stream.

 

dwMediaTypeIndex [in]

The zero-based index of the media type to retrieve.

ppMediaType [in]

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

Return value

This method can return one of these values.

Return codeDescription
S_OK

Success.

MF_E_INVALIDSTREAMNUMBER

The dwSourceStreamIndex parameter is invalid.

MF_E_NO_MORE_TYPES

The dwMediaTypeIndex parameter is out of range.

 

Remarks

To enumerate all of the available formats on a stream, call this method in a loop while incrementing dwMediaTypeIndex, until the method returns MF_E_NO_MORE_TYPES.

Some cameras might support a range of frame rates. The minimum and maximum frame rates are stored in the MF_MT_FRAME_RATE_RANGE_MIN and MF_MT_FRAME_RATE_RANGE_MAX attributes on the media type.

Requirements

Minimum supported client

Windows 8 [desktop apps only]

Minimum supported server

Windows Server 2012 [desktop apps only]

Header

Mfcaptureengine.h

See also

IMFCaptureSource

 

 

Community Additions

ADD
Show:
© 2014 Microsoft