IMFSinkWriter::SetInputMediaType method

Sets the input format for a stream on the sink writer.

Syntax


HRESULT SetInputMediaType(
  [in]  DWORD dwStreamIndex,
  [in]  IMFMediaType *pInputMediaType,
  [in]  IMFAttributes *pEncodingParameters
);

Parameters

dwStreamIndex [in]

The zero-based index of the stream. The index is received by the pdwStreamIndex parameter of the IMFSinkWriter::AddStream method.

pInputMediaType [in]

A pointer to the IMFMediaType interface of a media type. The media type specifies the input format.

pEncodingParameters [in]

A pointer to the IMFAttributes interface of an attribute store. Use the attribute store to configure the encoder. This parameter can be NULL.

Return value

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

Return codeDescription
S_OK

The method succeeded.

MF_E_INVALIDMEDIATYPE

The underlying media sink does not support the format, no conversion is possible, or a dynamic format change is not possible.

MF_E_INVALIDSTREAMNUMBER

The dwStreamIndex parameter is invalid.

MF_E_TOPO_CODEC_NOT_FOUND

Could not find an encoder for the encoded format.

 

Remarks

The input format does not have to match the target format that is written to the media sink. If the formats do not match, the method attempts to load an encoder that can encode from the input format to the target format.

After streaming begins—that is, after the first call to IMFSinkWriter::WriteSample—you can call this method at any time to change the input format. However, the underlying encoder and media sink must support dynamic format changes.

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 | Windows Store apps]

Minimum supported server

Windows Server 2008 R2 [desktop apps | Windows Store apps]

Header

Mfreadwrite.h

See also

Sink Writer
IMFSinkWriter

 

 

Community Additions

ADD
Show:
© 2014 Microsoft