简体   繁体   English

在OpenGLES中缓冲或保留帧

[英]Buffering or holding back frames in OpenGLES

I am trying to buffer upto 10 frames in GLES on Android. 我正在尝试在Android上的GLES中最多缓冲10个帧。 The incoming frames come from a camera to a surfacetexture and I process the image using OpenGles. 传入的帧从相机到surfacetexture纹理,我使用OpenGles处理图像。 I'm attempting to do this because I'm applying several gles filters causing the GPU to choke, and so I'm losing frame rate. 我正在尝试执行此操作,因为我应用了多个gles过滤器,导致GPU阻塞,因此丢失了帧速率。 (A 30 FPS camera ends up giving 25 frames). (一台30 FPS的相机最终会显示25帧)。 My thinking is if I'm able to hold back a few frames and implement a circular buffer I should be able to delay the frames by a fixed amount (add latency), but still give a consistent frame-rate (throughput). 我的想法是,如果我能够保留一些帧并实现循环缓冲区,则我应该能够将帧延迟固定量(增加延迟),但仍能提供一致的帧率(吞吐量)。

Any ideas on how this could be done? 关于如何做到这一点的任何想法?

You probably can't - you get no direct control over the window surface management in OpenGL ES on Android - you'll get as many buffers in the swap chain as the system is configured to give (normally three). 您可能无法-您无法直接控制Android上的OpenGL ES中的窗口表面管理-您将在交换链中获得与系统配置的缓冲区一样多的缓冲区(通常为三个)。

It is unlikely that adding more than three will really help improve frame rate consistency because you're tied to display vsync limits anyway. 添加三个以上的值不太可能真正有助于提高帧速率的一致性,因为无论如何您还是会受到显示垂直同步限制的限制。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM