VideoFrameProcessor.Listener


public interface VideoFrameProcessor.Listener


Listener for asynchronous frame processing events.

All listener methods must be called from the Executor passed in at creation.

Summary

Public methods

default void

Called after the VideoFrameProcessor has rendered its final output frame.

default void

Called when an exception occurs during asynchronous video frame processing.

default void
onInputStreamRegistered(
    @VideoFrameProcessor.InputType int inputType,
    List<Effect> effects,
    FrameInfo frameInfo
)

Called when the VideoFrameProcessor finishes registering an input stream.

default void
onOutputFrameAvailableForRendering(long presentationTimeUs)

Called when an output frame with the given presentationTimeUs becomes available for rendering.

default void
onOutputSizeChanged(int width, int height)

Called when the output size changes.

Public methods

onEnded

default void onEnded()

Called after the VideoFrameProcessor has rendered its final output frame.

onError

default void onError(VideoFrameProcessingException exception)

Called when an exception occurs during asynchronous video frame processing.

If this is called, the calling VideoFrameProcessor must immediately be released.

onInputStreamRegistered

default void onInputStreamRegistered(
    @VideoFrameProcessor.InputType int inputType,
    List<Effect> effects,
    FrameInfo frameInfo
)

Called when the VideoFrameProcessor finishes registering an input stream.

The VideoFrameProcessor is now ready to accept new input frames, bitmaps or textures.

Parameters
@VideoFrameProcessor.InputType int inputType

The InputType of the new input stream.

List<Effect> effects

The list of effects to apply to the new input stream.

FrameInfo frameInfo

The FrameInfo of the new input stream.

onOutputFrameAvailableForRendering

default void onOutputFrameAvailableForRendering(long presentationTimeUs)

Called when an output frame with the given presentationTimeUs becomes available for rendering.

Parameters
long presentationTimeUs

The presentation time of the frame, in microseconds.

onOutputSizeChanged

default void onOutputSizeChanged(int width, int height)

Called when the output size changes.

The output size is the frame size in pixels after applying all effects.

The output size may differ from the size specified using setOutputSurfaceInfo.