public interface

VideoFrameProcessor.Listener

 androidx.media3.common.VideoFrameProcessor.Listener

Overview

Listener for asynchronous frame processing events.

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

Summary

Methods
public voidonEnded()

Called after the VideoFrameProcessor has rendered its final output frame.

public voidonError(VideoFrameProcessingException exception)

Called when an exception occurs during asynchronous video frame processing.

public voidonInputStreamRegistered(int inputType, java.util.List<Effect> effects, FrameInfo frameInfo)

Called when the VideoFrameProcessor finishes registering an input stream.

public voidonOutputFrameAvailableForRendering(long presentationTimeUs)

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

public voidonOutputSizeChanged(int width, int height)

Called when the output size changes.

Methods

public void onInputStreamRegistered(int inputType, java.util.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:

inputType: The VideoFrameProcessor.InputType of the new input stream.
effects: The list of effects to apply to the new input stream.
frameInfo: The FrameInfo of the new input stream.

public 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 VideoFrameProcessor.setOutputSurfaceInfo(SurfaceInfo).

public void onOutputFrameAvailableForRendering(long presentationTimeUs)

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

Parameters:

presentationTimeUs: The presentation time of the frame, in microseconds.

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

public void onEnded()

Called after the VideoFrameProcessor has rendered its final output frame.