VideoFrameProcessor.Listener


interface VideoFrameProcessor.Listener


Listener for asynchronous frame processing events.

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

Summary

Public functions

Unit

Called after the VideoFrameProcessor has rendered its final output frame.

Unit

Called when an exception occurs during asynchronous video frame processing.

Unit
onInputStreamRegistered(
    @VideoFrameProcessor.InputType inputType: Int,
    effects: (Mutable)List<Effect!>!,
    frameInfo: FrameInfo!
)

Called when the VideoFrameProcessor finishes registering an input stream.

Unit

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

Unit
onOutputSizeChanged(width: Int, height: Int)

Called when the output size changes.

Public functions

onEnded

fun onEnded(): Unit

Called after the VideoFrameProcessor has rendered its final output frame.

onError

fun onError(exception: VideoFrameProcessingException!): Unit

Called when an exception occurs during asynchronous video frame processing.

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

onInputStreamRegistered

fun onInputStreamRegistered(
    @VideoFrameProcessor.InputType inputType: Int,
    effects: (Mutable)List<Effect!>!,
    frameInfo: FrameInfo!
): Unit

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 inputType: Int

The InputType of the new input stream.

effects: (Mutable)List<Effect!>!

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

frameInfo: FrameInfo!

The FrameInfo of the new input stream.

onOutputFrameAvailableForRendering

fun onOutputFrameAvailableForRendering(presentationTimeUs: Long): Unit

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

Parameters
presentationTimeUs: Long

The presentation time of the frame, in microseconds.

onOutputSizeChanged

fun onOutputSizeChanged(width: Int, height: Int): Unit

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.