IPin::ReceiveConnection method (strmif.h)

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

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(
  [in] IPin                *pConnector,
  [in] const AM_MEDIA_TYPE *pmt
);

Parameters

[in] pConnector

Pointer to the connecting pin's IPin interface.

[in] pmt

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.

Return code 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

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header strmif.h (include Dshow.h)
Library Strmiids.lib

See also

Error and Success Codes

How Filters Connect

IPin Interface