Export (0) Print
Expand All

CBasePin.ReceiveConnection method

The ReceiveConnection method accepts a connection from another pin. This method implements the IPin::ReceiveConnection method.

Syntax


HRESULT ReceiveConnection(
  IPin *pConnector,
  AM_MEDIA_TYPE *pmt
);

Parameters

pConnector

Pointer to the connecting pin's IPin interface.

pmt

Pointer to an AM_MEDIA_TYPE structure that specifies the media type.

Return value

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

Return codeDescription
S_OK

Success.

E_POINTER

NULL pointer argument.

VFW_E_ALREADY_CONNECTED

The pin is already connected.

VFW_E_NOT_STOPPED

The filter is active and the pin does not support dynamic reconnection.

VFW_E_TYPE_NOT_ACCEPTED

The specified media type is not acceptable.

 

Remarks

The output pin calls this method on the input pin. If the input pin returns an error code, the connection fails.

In the base class, this method performs the following steps:

  • Checks whether the pin is already connected.
  • Checks whether the filter is stopped.
  • Calls the CBasePin::CheckConnect method to test whether the connecting pin is suitable.
  • Calls the CBasePin::CheckMediaType method to test whether the media type is acceptable.

If all of these steps succeed, the method calls the CBasePin::CompleteConnect and SetMediaType methods to complete the connection. These methods store the media type and a pointer to the output pin.

If CheckConnect or CheckMediaType fail, the base class calls the CBasePin::BreakConnect method to break the connection and then returns an error code from ReceiveConnection.

Requirements

Header

Amfilter.h (include Streams.h)

Library

Strmbase.lib (retail builds);
Strmbasd.lib (debug builds)

See also

CBasePin Class

 

 

Community Additions

ADD
Show:
© 2014 Microsoft