GlTextureFrameConsumer


@ExperimentalApi
public interface GlTextureFrameConsumer extends AutoCloseable


Consumes a GlTextureFrame.

This interface aims at resembling FrameProcessor.

Summary

Nested types

Allowing outputting GlTextureFrame from the GlTextureFrameConsumer.

Public methods

abstract void
default boolean

Returns whether this consumer supports the provided Format.

abstract boolean
queue(
    GlTextureFrame frame,
    Executor listenerExecutor,
    Runnable wakeupListener
)

Attempts to queue a frame for processing.

abstract void

Notifies the current stream has ended.

Public methods

isOutputFormatSupported

default boolean isOutputFormatSupported(Format format)

Returns whether this consumer supports the provided Format.

Returns true by default.

queue

abstract boolean queue(
    GlTextureFrame frame,
    Executor listenerExecutor,
    Runnable wakeupListener
)

Attempts to queue a frame for processing.

If the consumer is at capacity, it returns false and the wakeupListener will be invoked on the listenerExecutor when capacity becomes available.

Parameters
GlTextureFrame frame

The input frame to process.

Executor listenerExecutor

The Executor to run the wakeupListener. Must not execute synchronously (e.g., must not be a direct executor) to avoid re-entrant calls to queue().

Runnable wakeupListener

The callback invoked when capacity is freed.

Returns
boolean

true if queued successfully, false if at capacity.

signalEndOfStream

abstract void signalEndOfStream()

Notifies the current stream has ended.