Rediger

Del via


CDynamicOutputPin.Block 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 Block method blocks or unblocks the flow of data from the pin. This method implements the IPinFlowControl::Block method.

Syntax

HRESULT Block(
   DWORD  dwBlockFlags,
   HANDLE hEvent
);

Parameters

dwBlockFlags

Flag that indicates whether to block or unblock the pin. Must be one of the following values:

Zero: Unblock data flow from the pin.

AM_PIN_FLOW_CONTROL_BLOCK: Block data flow from the pin.

hEvent

Handle to an event object, or NULL.

Return value

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

Return code Description
S_FALSE
Pin is already unblocked.
S_OK
Success.
E_INVALIDARG
Invalid argument.
VFW_E_PIN_ALREADY_BLOCKED
Pin is already blocked on another thread.
VFW_E_PIN_ALREADY_BLOCKED_ON_THIS_THREAD
Pin is already blocked on the calling thread.

Remarks

For more information about this method, see IPinFlowControl::Block. Internally, this method calls one of the following protected methods:

Unblocking is always performed synchronously.

Requirements

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

See also

CDynamicOutputPin Class