ProcessBoundAnalyzerLoop

This kind of AnalyzerLoop will process data until the result handler indicates that it has reached a terminal state and is no longer listening.

Data can be added to a queue for processing by a camera or other producer. It will be consumed by FILO. If no data is available, the analyzer pauses until data becomes available.

If the enqueued data exceeds the allowed memory size, the bottom of the data stack will be dropped and will not be processed. This alleviates memory pressure when producers are faster than the consuming analyzer.

Parameters

analyzerPool

: A pool of analyzers to use in this loop.

resultHandler

: A result handler that will be called with the results from the analyzers in this loop.

analyzerLoopErrorListener

: An error handler for this loop

Constructors

Link copied to clipboard
constructor(analyzerPool: AnalyzerPool<DataFrame, in State, Output>, resultHandler: StatefulResultHandler<DataFrame, out State, Output, Boolean>, analyzerLoopErrorListener: AnalyzerLoopErrorListener, statsName: String? = null)

Functions

Link copied to clipboard
open override fun getState(): State
Link copied to clipboard
open suspend override fun onResult(result: Output, data: DataFrame): Boolean
Link copied to clipboard
fun subscribeTo(flow: Flow<DataFrame>, processingCoroutineScope: CoroutineScope): Job?

Subscribe to a flow. Loops can only subscribe to a single flow at a time.

Link copied to clipboard

Unsubscribe from the flow.