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 |
---|---|
|
Success. |
|
NULL pointer argument. |
|
The pin is already connected. |
|
Cannot connect while filter is active. |
|
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:
- Store the media type, and return the same type in the IPin::ConnectionMediaType method.
- Store the output pin's IPin interface (pConnector), and return this pointer in the IPin::ConnectedTo method.
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 |