Android APIs
Added in API level 23
public static interface

MediaCodec.OnFrameRenderedListener

android.media.MediaCodec.OnFrameRenderedListener

Class Overview

Listener to be called when an output frame has rendered on the output surface

Summary

Public Methods
abstract void onFrameRendered(MediaCodec codec, long presentationTimeUs, long nanoTime)
Called when an output frame has rendered on the output surface.

Public Methods

public abstract void onFrameRendered (MediaCodec codec, long presentationTimeUs, long nanoTime)

Added in API level 23

Called when an output frame has rendered on the output surface.

Note: This callback is for informational purposes only: to get precise render timing samples, and can be significantly delayed and batched. Some frames may have been rendered even if there was no callback generated.

Parameters
codec the MediaCodec instance
presentationTimeUs the presentation time (media time) of the frame rendered. This is usually the same as specified in queueInputBuffer(int, int, int, long, int); however, some codecs may alter the media time by applying some time-based transformation, such as frame rate conversion. In that case, presentation time corresponds to the actual output frame rendered.
nanoTime The system time when the frame was rendered.
See Also