为了确定给定设备和 AR 会话是否进行帧缓冲(还要
称为帧延迟),请使用 adb logcat 输出:
# Camera frame buffering is turned off when frame delay is zero.adblogcat|grep'Update Frame Delay'…Inative:session.cc:3141UpdateFrameDelayto0frames.
# Camera frame buffering is turned on when frame count is non-zero.# Note: The size of the buffer can vary over time.adblogcat|grep'Update Frame Delay'…Inative:session.cc:3141UpdateFrameDelayto6frames.……Inative:session.cc:3141UpdateFrameDelayto4frames.……Inative:session.cc:3141UpdateFrameDelayto2frames.
内存
每增加一个缓冲的相机帧就会增加内存利用率。例如:
一个 1080p 纹理会占用大约 6 MB 的内存(通过将
1920 x 1080 x 3 个字节的 RGB 数据)。
[null,null,["最后更新时间 (UTC):2024-10-14。"],[[["ARCore's camera frame buffering, enabled by default for some features or manually by the app, enhances rendering by storing multiple camera frames."],["Buffering improves rendering performance and reduces stutter, especially in apps with multithreaded rendering pipelines, but it increases memory usage."],["ARCore dynamically adjusts the buffer size, and the `adb logcat` output reveals whether frame delay (buffering) is enabled and the current buffer size."],["Performance gains from buffering depend on factors like the app's rendering pipeline, threading model, device, and OS, so thorough testing on target devices is crucial."],["Apps can enable buffering and manage textures through specific ARCore functions, ensuring the efficient utilization of camera frames for rendering."]]],["ARCore 1.17.0 supports buffering multiple camera frames in a texture queue to enhance rendering performance, particularly for multithreaded pipelines. Buffering is enabled by providing multiple texture IDs via `ArSession_setCameraTextureNames(ids)`, or when certain ARCore features like Augmented Images or Faces are active, or on some specific ARCore devices. Frame delay, indicating active buffering, can be monitored via `adb logcat`. Each additional buffered frame increases memory use. Apps can use `ArFrame_getCameraTextureName()` to get the texture ID. The frame rate improvement depends on device and app design.\n"]]