Partager via


IPin::ReceiveConnection

 
Microsoft DirectShow 9.0

IPin::ReceiveConnection

The ReceiveConnection method accepts a connection from another pin.

Applications should not call this method. This method is called by other filters during the pin connection process.

Syntax

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

Parameters

pConnector

[in] Pointer to the connecting pin's IPin interface.

pmt

[in] Pointer to an AM_MEDIA_TYPE structure that specifies the media type for the connection.

Return Value

Returns an HRESULT value. Possible values include the following.

Value Description
S_OK Success.
E_POINTER Null pointer argument.
VFW_E_ALREADY_CONNECTED The pin is already connected.
VFW_E_NOT_STOPPED Cannot connect while filter is active.
VFW_E_TYPE_NOT_ACCEPTED The specified media type is not acceptable.

Remarks

When an output pin connects, it calls this method on the input pin. The input pin should verify that the specified media type is acceptable. It may also need to check for other connection requirements specific to the owning filter. If the connection is suitable, the input pin should return S_OK, and also do the following:

If the connection is unsuitable, the pin should return an error code.

The CBasePin class implements the basic framework for this method, including storing the media type and IPin pointers.

Requirements

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

Library: Use Strmiids.lib.

See Also