android: camera_device: Save capture settings unconditionally
As the Android framework sends to the camera device settings incrementally (only the ones that change are updated), the CameraDevice class in the Android camera HAL keeps a copy of the last received settings to be able to apply controls to the libcamera Camera and to populate metadata correctly. When a valid 'camera3Request->settings' is provided, it gets saved to 'lastSettings_' but 'descriptor->settings_' is not initialized until the next frame (assuming it does not contain more settings). Fix this by assigning to 'descriptor->settings_' the last saved settings unconditionally. Signed-off-by: Fang Hui <hui.fang@nxp.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Tested-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
This commit is contained in:
parent
ed632bf37e
commit
edef303bbe
1 changed files with 4 additions and 2 deletions
|
@ -952,8 +952,8 @@ int CameraDevice::processCaptureRequest(camera3_capture_request_t *camera3Reques
|
|||
*/
|
||||
if (camera3Request->settings)
|
||||
lastSettings_ = camera3Request->settings;
|
||||
else
|
||||
descriptor->settings_ = lastSettings_;
|
||||
|
||||
descriptor->settings_ = lastSettings_;
|
||||
|
||||
LOG(HAL, Debug) << "Queueing request " << descriptor->request_->cookie()
|
||||
<< " with " << descriptor->buffers_.size() << " streams";
|
||||
|
@ -1108,6 +1108,8 @@ int CameraDevice::processCaptureRequest(camera3_capture_request_t *camera3Reques
|
|||
}
|
||||
|
||||
if (state_ == State::Stopped) {
|
||||
lastSettings_ = {};
|
||||
|
||||
ret = camera_->start();
|
||||
if (ret) {
|
||||
LOG(HAL, Error) << "Failed to start camera";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue