VideoGraph.Listener


interface VideoGraph.Listener


Listener for video frame processing events.

Summary

Public functions

Unit
onEnded(finalFramePresentationTimeUs: Long)

Called after the VideoGraph has rendered its final output frame.

Unit

Called when an exception occurs during video frame processing.

Unit
onOutputFrameAvailableForRendering(
    framePresentationTimeUs: Long,
    isRedrawnFrame: Boolean
)

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

Unit

Called when the output frame rate changes.

Unit
onOutputSizeChanged(width: Int, height: Int)

Called when the output size changes.

Public functions

onEnded

fun onEnded(finalFramePresentationTimeUs: Long): Unit

Called after the VideoGraph has rendered its final output frame.

Parameters
finalFramePresentationTimeUs: Long

The timestamp of the last output frame, in microseconds.

onError

fun onError(exception: VideoFrameProcessingException!): Unit

Called when an exception occurs during video frame processing.

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

onOutputFrameAvailableForRendering

fun onOutputFrameAvailableForRendering(
    framePresentationTimeUs: Long,
    isRedrawnFrame: Boolean
): Unit

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

Parameters
framePresentationTimeUs: Long

The presentation time of the frame, in microseconds.

isRedrawnFrame: Boolean

Whether the frame is a frame that is redrawn, redrawn frames are rendered directly thus renderOutputFrame must not be called on such frames.

onOutputFrameRateChanged

fun onOutputFrameRateChanged(frameRate: Float): Unit

Called when the output frame rate changes.

Parameters
frameRate: Float

The output frame rate in frames per second, or NO_VALUE if unknown.

onOutputSizeChanged

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

Called when the output size changes.

Parameters
width: Int

The new output width in pixels.

height: Int

The new output width in pixels.