Gets a format that is supported natively by the media source.
public:
HRESULT GetNativeMediaType(
DWORD dwStreamIndex,
DWORD dwMediaTypeIndex,
IMFMediaType **ppMediaType
)
dwStreamIndex
Type: DWORD
[in] Specifies which stream to query. The value can be any of the following.
dwMediaTypeIndex
Type: DWORD
[in] The zero-based index of the media type to retrieve.
ppMediaType
Type: IMFMediaType **
[out] 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. |
| MF_E_INVALIDSTREAMNUMBER | The dwStreamIndex parameter is invalid. |
| MF_E_NO_MORE_TYPES | The dwMediaTypeIndex parameter is out of range. |
Refer to Media Foundation return codes.
This method queries the underlying media source for its native output format. Potentially, each source stream can produce more than one output format. Use the dwMediaTypeIndex parameter to loop through the available formats. Generally, file sources offer just one format per stream, but capture devices might offer several formats.
The method returns a copy of the media type, so it is safe to modify the object received in the ppMediaType parameter.
To set the output type for a stream, call the IMFSourceReader::SetCurrentMediaType method.
This interface is available on Windows Vista if Platform Update Supplement for Windows Vista is installed.
Header: Declared in mfreadwrite.h.