다음을 통해 공유


IFilterGraph2::ReconnectEx

 
Microsoft DirectShow 9.0

IFilterGraph2::ReconnectEx

The ReconnectEx method breaks the existing pin connection and reconnects it to the same pin, using a specified media type.

Applications should not call this method. It is called by filters during the graph building process.

Syntax

  HRESULT ReconnectEx(
  IPin *ppin,
  const AM_MEDIA_TYPE *pmt
);

Parameters

ppin

[in] Pointer to the pin to disconnect and reconnect.

pmt

[in] Pointer to the media type to reconnect with. Specify NULL to use the existing media type.

Return Values

Returns an HRESULT value. Possible values include the following.

Value Description
S_OK Success.
S_FALSE Pin was not connected. No error.
E_FAIL Failure.
E_POINTER Null pointer argument.
VFW_E_NOT_STOPPED The filter is not stopped, but it does not support reconnection while in a running state.

Remarks

Filters can call this method in order to renegotiate a pin connection. The method executes on a separate thread. Before calling this method, call IPin::QueryAccept on the other pin to ensure that the reconnnection attempt will succeed. Do not call this method unless QueryAccept returns S_OK. Otherwise, because the reconnection is performed asynchronously, the reconnection might fail even though the ReconnectEx method succeeds, leaving the filter graph in an inconsistent state.

This method improves on the IFilterGraph::Reconnect method by specifying a media type. This makes the reconnection more likely to succeed.

Requirements

Header: Declared in Strmif.h; include Dshow.h.

Library: Use Strmiids.lib.

See Also