IMpeg2Demultiplexer::SetOutputPinMediaType method (strmif.h)

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The SetOutputPinMediaType method updates the media type of the specified output pin. (DirectX 9.0 and later.)

Syntax

HRESULT SetOutputPinMediaType(
  [in] LPWSTR        pszPinName,
  [in] AM_MEDIA_TYPE *pMediaType
);

Parameters

[in] pszPinName

The friendly name of the pin as specified when the pin was created in a call to CreateOutputPin.

[in] pMediaType

Pointer to an AM_MEDIA_TYPE structure that specifies the new media type information for the pin.

Return value

Returns S_OK if successful. If the method fails, it returns an HRESULT error code.

Remarks

Pins can be reconfigured at any time with a new media type. If no connection exists, the media type is simply updated. If the pin is connected, the success or failure of the call will depend on the downstream input pin's acceptance or rejection of the specified media type.

The media type is not interpreted in any way by the Demultiplexer filter. It is used only during connection negotiation by the output pin. It has no effect on the content of the media samples. Media sample content is defined when a PID is mapped via the MEDIA_SAMPLE_CONTENT parameter in the IMPEG2PIDMap::MapPID method, or via the defined values in an IMPEG2StreamIdMap::MapStreamId call.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header strmif.h (include Dshow.h)
Library Strmiids.lib

See also

Error and Success Codes

IMpeg2Demultiplexer Interface