Microsoft DirectX 8.1 (C++)

Reconnecting Pins

During a pin connection, a filter might need to disconnect and reconnect one of its other pins. For example:

To reconnect, the filter calls IFilterGraph::Reconnect or IFilterGraph2::ReconnectEx on the Filter Graph Manager. The Filter Graph Manager asynchronously disconnects and reconnects the pins. The ReconnectEx method is preferable, because it specifies a media type. Otherwise, the filter that initiates the reconnection must store the intended media type internally.

The filter must not attempt a reconnection unless the new connection is guaranteed to succeed. Otherwise, the pin will be left disconnected, causing graph errors. If the filter reconnects with a new media type, it must specify a media type known to be valid. If in doubt, call the IPin::QueryAccept method.

Also, the filter should request the reconnection from inside the IPin::Connect method, on the same thread. If the IPin::Connect method returns on one thread, while another thread makes the reconnection request, the Filter Graph Manager might run the graph before it makes the reconnection, causing graph errors.