Поделиться через


CPullPin::Connect

 
Microsoft DirectShow 9.0

CPullPin::Connect

The Connect method completes a connection to the output pin.

Syntax

  HRESULT Connect(
    IUnknown *pUnk,
    IMemAllocator *pAlloc,
    BOOL bSync
);

Parameters

pUnk

Pointer to the IUnknown interface of the output pin.

pAlloc

Pointer to the IMemAllocator interface of the input pin's preferred allocator, or NULL.

bSync

Boolean value that specifies whether to use synchronous reads. If TRUE, the pin performs synchronous read operations on the output pin. If FALSE, the pin makes asynchronous read requests.

Return Values

Returns an HRESULT. Possible values include the following.

Return code Description
S_OK Success.
VFW_E_ALREADY_CONNECTED The input pin is already connected.
E_NOINTERFACE The output pin does not expose IAsyncReader.

Remarks

Call this method during the input pin's connection process. If the method fails, the pin should fail the connection.

This method queries the output pin for the IAsyncReader interface. If successful, it calls CPullPin::DecideAllocator to negotiate the allocator for the connection. If your input pin has a preferred allocator, specify it in the pAlloc parameter; the DecideAllocator method passes this pointer to the output pin's IAsyncReader::RequestAllocator method. Otherwise, set pAlloc to NULL.

If the value of bSync is TRUE, the CPullPin object makes synchronous read requests, by calling the output pin's IAsyncReader::SyncReadAligned. Otherwise, it calls the IAsyncReader::Request method to make overlapping read requests.

Requirements

**  Header:** Include Pullpin.h and Streams.h.

**  Library:** Use Strmbase.lib (retail builds) or Strmbasd.lib (debug builds).

See Also