FakeFrameProcessor


@ExperimentalApi
public class FakeFrameProcessor implements FrameProcessor


A fake FrameProcessor implementation.

Summary

Nested types

A factory for FakeFrameProcessor implementations.

A fake FrameProcessor.Listener implementation for tests.

Public methods

void

Blocks until all resources are released.

boolean

Attempts to queue a List of frames for processing.

void

Notifies this processor that the current stream has ended.

void

Simulates a video frame processing error by notifying the listener.

Inherited methods

From java.lang.AutoCloseable
abstract void

Public fields

closed

public final AtomicBoolean closed

eosSignaled

public final AtomicBoolean eosSignaled

output

public final FrameWriter output

queuedFramesCount

public int queuedFramesCount

Public methods

close

public void close()

Blocks until all resources are released.

queue

public boolean queue(List<AsyncFrame> frames)

Attempts to queue a List of frames for processing.

All frames provided in a single invocation of this method represent the exact same point in time.

If this consumer is at capacity, this method returns false and the onWakeup will be invoked when capacity becomes available.

If this method returns true, onFrameProcessed must be called once with every input frame instance queued, once the FrameProcessor has finished processing the frames.

Parameters
List<AsyncFrame> frames

The frames to queue.

Returns
boolean

true if the frames were queued, false if the consumer is at capacity.

signalEndOfStream

public void signalEndOfStream()

Notifies this processor that the current stream has ended.

More frames may be queued after calling this method, if the current stream changes.

triggerError

public void triggerError(VideoFrameProcessingException exception)

Simulates a video frame processing error by notifying the listener.