Android 10 Camera -- Single Producer Multiple Consumer Camera Buffer Transport

说明:转载自 Android Camera,不定期添加自己的学习思考。


Single Producer Multiple Consumer Camera Buffer Transport

This feature introduces a set of methods that allows camera clients to add and remove output surfaces dynamically while the capture session is active and camera streaming is ongoing. A new output can map to a specific, user-selected shared camera stream. After a surface is added, it can be removed at any time.

The general idea is to share the buffers associated with a particular camera stream within several output surfaces. An internal reference counter keeps track of the buffers as they become ready for further processing on the consumer side. When all consumers complete their respective tasks the buffer gets dequeued and is available for the camera.
在这里插入图片描述
Figure 1. Buffer sharing

Figure 1 depicts one example scenario where the buffers processed by camera stream 2 are dynamically attached and detached, reference counted, and managed by the stream splitter component inside a dedicated shared output stream within the camera service.

Examples and source


The core implementation of this feature can be found in the Camera3StreamSplitter module. Documentation on this feature can be found in the developer reference:

Implementation


No implementation is required on the Camera HAL side as this feature is implemented on the framework side.

Validation


Your implementation must pass CTS cases that cover this feature from the MultiViewTest module and the native JNI library for the native API.

发布了81 篇原创文章 · 获赞 31 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/xiaosaerjt/article/details/105586225