前文回顾
上一篇文章,简单讲述 notify的过程
一、 process_capture_result流程
1.1 原文解析
* 10. After some pipeline delay, the HAL begins to return completed captures to
* the framework with camera3_callback_ops_t->process_capture_result(). These
* are returned in the same order as the requests were submitted. Multiple
* requests can be in flight at once, depending on the pipeline depth of the
* camera HAL device.
*
* >= CAMERA_DEVICE_API_VERSION_3_2:
*
* Once a buffer is returned by process_capture_result as part of the
* camera3_stream_buffer_t array, and the fence specified by release_fence
* has been signaled (this is a no-op for -1 fences), the ownership of that
* buffer is considered to be transferred back to the framework. After that,
* the HAL must no longer retain that particular buffer, and the
* framework may clean up the memory for it immediately.
*
* process_capture_result may be called multiple times for a single frame,
* each time with a new disjoint piece of metadata and/or set of gralloc
* buffers. The framework will accumulate these partial metadata results
* into one result.
*
* In particular, it is legal for a process_capture_result to be called
* simultaneously for both a frame N and a frame N+1 as long as the
* above rule holds for gralloc buffers (both input and output).10、上传处理result:经过一些pipeline延迟之后,HAL开始使用camera3_callback_ops返回处理后Capture给framewrok, camera3_callback_ops_t->process_capture_result()。返回的顺序与提交请求的顺序相同。根据camera HAL设备的pipeline深度,可以同时处理多个request。
API3.2->
(1)一旦process_capture_result返回buffer作为camera3_stream_buffer_t数组,release_fence指定的栅已经被触发(这是-1栅的无操作),该buffer的所有权被认为已转移回framework。之后,HAL必须不再保留该特定buffer,并且framework可以立即为其清除内存。(2)对于单个帧, 每次带有新的不相交的元数据和或一套gralloc buffer,可以多次调用process_capture_result.
(3)framework会将这些部分元数据result合并为一个result。 特别是,只要上述规则对于gralloc buffer(输入和输出)均成立,则同时为帧N和帧N + 1调用process_capture_result是合法的。
1.2 官网文档
《80-pc212-1_a_chi_api_specifications_for_qualcomm_spectra_2xx_camera.pdf》简单介绍process_result的过程
1.3 代码分析
//TODO,喝口水,远眺下,继续撸代码