CBaseInputPin.ReceiveCanBlock method

[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 ReceiveCanBlock method determines whether calls to the IMemInputPin::Receive method might block. This method implements the IMemInputPin::ReceiveCanBlock method.

Syntax

HRESULT ReceiveCanBlock();

Parameters

This method has no parameters.

Return value

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

Return code Description
S_FALSE
The pin will not block on a call to Receive.
S_OK
The pin might block on a call to Receive.

Remarks

Return S_FALSE if calls to the Receive method are guaranteed not to block. Otherwise, return S_OK or an error code. If the Receive method calls Receive on a downstream pin, the downstream pin might block; ReceiveCanBlock must take that factor into account.

An upstream filter can use this method to determine its threading strategy. If the Receive method might block, the upstream filter might decide to use a worker thread that buffers data. See the COutputQueue class for an implementation of this strategy.

In the base class, this method returns S_OK when any of the following are true:

  • The filter has no output pins.
  • An input pin connected to this filter signals that it might block.
  • An input pin connected to this filter does not support the IMemInputPin interface.

Requirements

Requirement Value
Header
Amfilter.h (include Streams.h)
Library
Strmbase.lib (retail builds);
Strmbasd.lib (debug builds)

See also

CBaseInputPin Class