CBasePin::Connect

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 HRESULT values.

Value Description
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 cannot be performed.
Other error value Returned from CBasePin::AgreeMediaType or CBasePin::CheckConnect or overridden versions of these member functions.

Remarks

This member function implements the IPin::Connect method. IPin::Connect is implemented on the output pin and calls the IPin::ReceiveConnection method for the connected input pin (implemented in the base classes as CBasePin::ReceiveConnection). This member function calls the virtual CBasePin::CheckConnect member function, which can be overridden to verify that the connection is possible. CBasePin::CheckConnect then calls CBasePin::AgreeMediaType to negotiate a common media type with the connected pin.

CBasePin::AgreeMediaType calls CBasePin::TryMediaTypes twice; once for this pin's media type enumerator and once for the receiving pin's media type enumerator. For each media type found, CBasePin::AttemptConnection is called, which in turn calls the receiving pin's IPin::ReceiveConnection method, and finally CBasePin::CompleteConnect if successful.

Requirements

DirectShow applications and DirectShow filters have different include file and link library requirements. See Setting Up the Build Environment for more information.

OS Versions: Windows CE 2.12 and later. Version 2.12 requires DXPAK 1.0 or later.
Header:

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.