KsGateCaptureThreshold function (ks.h)

The KsGateCaptureThreshold function is used to capture an ON input of an AND gate specified by Gate.

Syntax

BOOLEAN KsGateCaptureThreshold(
  [in] PKSGATE Gate
);

Parameters

[in] Gate

A pointer to a KSGATE structure representing the AND gate for which to capture an ON input synchronously.

Return value

KsGateCaptureThreshold returns TRUE if the AND gate was originally open. Note that returning TRUE implies that the gate was closed so that no other thread could simultaneously capture the gate and commence processing.

Remarks

KsGateCaptureThreshold checks the state of the given AND gate. If the gate is open, it turns off an input to the gate, thereby transitioning the gate to a closed state. If the gate is closed, the function does nothing. Unlike KsGateGetStateUnsafe, this call is done synchronously with respect to other gate state changes. It is the primary synchronization mechanism for processing based on gate control.

Despite its name, this function is only a valid call for AND gates, not gates in general. AVStream, however, does not verify whether Gate is an AND gate or an OR gate. It is the caller's responsibility to ensure that the call is only made on AND gates.

The call is made using interlocked functions and is thus synchronous with respect to any of the other gate state change functions; it is also a very efficient method of process control.

Requirements

Requirement Value
Minimum supported client Available in Microsoft Windows XP and later operating systems and DirectX 8.0 and later DirectX versions.
Target Platform Desktop
Header ks.h (include Ks.h)
IRQL Any level

See also

KsGateAddOffInputToAnd

KsGateAddOffInputToOr

KsGateAddOnInputToAnd

KsGateAddOnInputToOr

KsGateGetStateUnsafe

KsGateInitializeAnd

KsGateInitializeOr

KsGateRemoveOffInputFromAnd

KsGateRemoveOffInputFromOr

KsGateRemoveOnInputFromAnd

KsGateRemoveOnInputFromOr

KsGateTurnInputOff

KsGateTurnInputOn