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

abstract void

Called after the VideoFrameProcessor has rendered its final output frame.

abstract void

Called when an exception occurs during asynchronous video frame processing.

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

Called when the VideoFrameProcessor finishes registering an input stream.

abstract void
onOutputFrameAvailableForRendering(long presentationTimeUs)

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

abstract void
onOutputSizeChanged(int width, int height)

Called when the output size changes.

Public methods

onEnded

abstract void onEnded()

Called after the VideoFrameProcessor has rendered its final output frame.

onError

abstract 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

abstract 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

abstract 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

abstract 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.