Android - SurfaceTexture.updateTexImage 和 MediaPlayer

Android - SurfaceTexture.updateTexImage and MediaPlayer

我使用 mediaPlayer 播放视频并使用 surfaceTexture 和 OpenGL ES 2.0 对其进行修改。

在文档中,它说

surfaceTexture.updateTexImage();

将"update the texture image to the most recent frame from the image stream"。

所以如果我调用2次updateTexImage,纹理图像不一定是视频的第2帧?

如果是这样的话,我想是没有办法用媒体播放器和OpenGL来控制视频的速度吧?

是的,如果调用 2 次 updateTexImage,它可能不是视频的第 2 帧。 没有办法比输入固定(增加 fps)视频。但是,随着 updateTexImage 的计时,您可以减慢速度(降低 fps),跳帧。