IMFSinkWriterEncoderConfig::SetTargetMediaType method (mfreadwrite.h)

Dynamically changes the target media type that Sink Writer is encoding to.

Syntax

HRESULT SetTargetMediaType(
  [in] DWORD         dwStreamIndex,
  [in] IMFMediaType  *pTargetMediaType,
  [in] IMFAttributes *pEncodingParameters
);

Parameters

[in] dwStreamIndex

Specifies the stream index.

[in] pTargetMediaType

The new media format to encode to.

[in] pEncodingParameters

The new set of encoding parameters to configure the encoder with. If not specified, previously provided parameters will be used.

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

The new media type must be supported by the media sink being used and by the encoder MFTs installed on the system.

Requirements

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

See also

IMFSinkWriter

IMFSinkWriterEncoderConfig

IMFSinkWriterEx