Rediger

Del via


CDynamicOutputPin.DynamicReconnect method

[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 DynamicReconnect method performs a dynamic reconnection with a new media type. The reconnection can occur while the filter graph is running.

Syntax

HRESULT DynamicReconnect(
   const CMediaType *pmt
);

Parameters

pmt

Pointer to an AM_MEDIA_TYPE structure that specifies the media type.

Return value

Returns an HRESULT value. Possible values include those shown in the following table.

Return code Description
S_OK
Success.
E_FAIL
Failure. Possibly the owning filter did not call the CDynamicOutputPin::SetConfigInfo method.

Remarks

This method must be called from the same thread that delivers data to the pin. Once this method is called, samples with the old media type cannot be delivered. The caller must ensure that no old samples are pending.

Call CDynamicOutputPin::StartUsingOutputPin before calling this method.

Requirements

Requirement Value
Header
Amfilter.h (include Streams.h)
Library
Strmbase.lib (retail builds);
Strmbasd.lib (debug builds)

See also

CDynamicOutputPin Class