FakeFrameProcessor


@RequiresApi(value = 26)
@ExperimentalApi
class FakeFrameProcessor : FrameProcessor


A no-op FrameProcessor that holds a reference to all queued frames for testing.

Summary

Nested types

Marker class representing a signalEndOfStream call.

Marker interface for ordering frames and EOS signals.

A factory for FakeFrameProcessor implementations.

Holds the frames queued in a queue call.

Public functions

Unit

Blocks until all resources are released.

ImmutableList<ImmutableList<Long!>!>!

Returns an ImmutableList of content timestamps for all queued frames.

ImmutableList<FakeFrameProcessor.Event!>!

Returns an ImmutableList of all queued events.

Boolean

Returns true if the last Event queued was an EosEvent.

Boolean

Attempts to queue a List of frames for processing.

Unit

Notifies this processor that the current stream has ended.

Unit

Simulates a video frame processing error by notifying the listener.

Public properties

(Mutable)List<AsyncFrame!>?

Inherited functions

From java.lang.AutoCloseable
abstract Unit

Public functions

close

fun close(): Unit

Blocks until all resources are released.

getQueuedContentTimesUs

fun getQueuedContentTimesUs(): ImmutableList<ImmutableList<Long!>!>!

Returns an ImmutableList of content timestamps for all queued frames. EOS frames return TIME_UNSET.

getQueuedEvents

fun getQueuedEvents(): ImmutableList<FakeFrameProcessor.Event!>!

Returns an ImmutableList of all queued events.

isEnded

fun isEnded(): Boolean

Returns true if the last Event queued was an EosEvent.

queue

fun queue(frames: (Mutable)List<AsyncFrame!>!): Boolean

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
frames: (Mutable)List<AsyncFrame!>!

The frames to queue.

Returns
Boolean

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

signalEndOfStream

fun signalEndOfStream(): Unit

Notifies this processor that the current stream has ended.

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

triggerError

fun triggerError(exception: VideoFrameProcessingException!): Unit

Simulates a video frame processing error by notifying the listener.

Public properties

lastFrames

val lastFrames: (Mutable)List<AsyncFrame!>?