AttemptConnection

CBasePin.AttemptConnection method

The AttemptConnection method connects to another pin using a specified media type.

Syntax


virtual HRESULT AttemptConnection(
         IPin       *pReceivePin,
   const CMediaType *pmt
);

Parameters

pReceivePin

Pointer to the receiving pin's IPin interface.

pmt

Pointer to a CMediaType object that specifies the media type.

Return value

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

Return codeDescription
S_OK

Success.

VFW_E_TYPE_NOT_ACCEPTED

The media type is not acceptable.

 

Remarks

This method attempts to connect the two pins with a specific media type. If the type is not acceptable, the method fails without trying other media types.

If the media type is acceptable, this method calls the receiving pin's IPin::ReceiveConnection method. Then it calls the CBasePin::CompleteConnect method to complete the connection.

Requirements

Header

Amfilter.h (include Streams.h)

Library

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

See also

CBasePin Class

 

 

Show:
© 2016 Microsoft