Microsoft Windows CE 3.0  

CBasePin::Connect

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Initiates a connection from this pin to the other pin.

HRESULT Connect(
IPin *
pReceivePin, 
const AM_MEDIA_TYPE *
pmt
);

Parameters

pReceivePin
Input pin to connect to.
pmt
Optional media type parameter.

Return Values

Returns one of the following arguments by default; if overridden, should return standard HRESULTvalues.

VFW_E_ALREADY_CONNECTED This output pin is already connected to another pin.
VFW_E_NOT_STOPPED The filter graph is not in a stopped state and connection can't be performed.
Other error value Returned from CBasePin::AgreeMediaTypeor CBasePin::CheckConnector overridden versions of these member functions.

Remarks

This member function implements the IPin::Connectmethod. IPin::Connectis implemented on the output pin and calls the IPin::ReceiveConnectionmethod for the connected input pin (implemented in the base classes as CBasePin::ReceiveConnection). This member function calls the virtual CBasePin::CheckConnectmember function, which can be overridden to verify that the connection is possible. CBasePin::CheckConnectthen calls CBasePin::AgreeMediaTypeto negotiate a common media type with the connected pin.

CBasePin::AgreeMediaTypecalls CBasePin::TryMediaTypestwice; once for this pin's media type enumerator and once for the receiving pin's media type enumerator. For each media type found, CBasePin::AttemptConnectionis called, which in turn calls the receiving pin's IPin::ReceiveConnectionmethod, and finally CBasePin::CompleteConnectif successful.