为了确定给定设备和 AR 会话是否进行帧缓冲(还要
称为帧延迟),请使用 adb logcat 输出:
# Camera frame buffering is turned off when frame delay is zero. adb logcat | grep 'Update Frame Delay' … I native : session.cc:3141UpdateFrameDelay to 0 frames.
# Camera frame buffering is turned on when frame count is non-zero. # Note: The size of the buffer can vary over time. adb logcat | grep 'Update Frame Delay' … I native : session.cc:3141UpdateFrameDelay to 6 frames. … … I native : session.cc:3141UpdateFrameDelay to 4 frames. … … I native : session.cc:3141UpdateFrameDelay to 2 frames.
内存
每增加一个缓冲的相机帧就会增加内存利用率。例如:
一个 1080p 纹理会占用大约 6 MB 的内存(通过将
1920 x 1080 x 3 个字节的 RGB 数据)。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2024-08-22。"],[[["ARCore 1.17.0 introduces camera frame buffering, allowing apps to store multiple camera frames in a queue for improved rendering performance."],["Buffering can be enabled by the app, required by specific ARCore features (like Augmented Images or Augmented Faces), or automatically enabled on certain devices."],["Each buffered frame increases memory consumption; for example, a 1080p texture requires ~6MB of memory."],["Performance improvements from buffering and multithreaded rendering are not guaranteed and depend on factors like the app's pipeline, device, and OS."],["To enable buffering, use `Session.setCameraTextureNames(ids)` to provide texture IDs, and `Frame.getCameraTextureName()` to retrieve the ID for the current frame."]]],[]]