Most visited

Recently visited

Added in API level 23

MediaCodec.OnFrameRenderedListener

public static interface MediaCodec.OnFrameRenderedListener

android.media.MediaCodec.OnFrameRenderedListener


在输出表面上渲染输出帧时调用侦听器

也可以看看:

Summary

Public methods

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

在输出表面上渲染输出帧时调用。

Public methods

onFrameRendered

Added in API level 23
void onFrameRendered (MediaCodec codec, 
                long presentationTimeUs, 
                long nanoTime)

在输出表面上渲染输出帧时调用。

注意:此回调仅用于提供信息:获取精确的渲染时间采样,并且可以显着延迟和批处理。 即使没有生成回调,某些帧可能已经被渲染。

Parameters
codec MediaCodec: the MediaCodec instance
presentationTimeUs long: 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 long: The system time when the frame was rendered.

也可以看看:

Hooray!