summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinghui Tan <mhtan@google.com>2022-03-16 00:13:00 -0700
committerMinghui Tan <mhtan@google.com>2022-03-16 22:13:04 +0000
commitc790cc2930e24fc34b24b3e129e2664aa8c0fa6a (patch)
treea2f94d68c15f0e214e50f66cdee1fc30131fd8fb
parent0dd7eae42978cc816f6b8387da0de681171c30cc (diff)
downloadcamera-c790cc2930e24fc34b24b3e129e2664aa8c0fa6a.tar.gz
Process pending result for frames with error.
Bug: 224831316 Test: IG re-open camera after video record Change-Id: I85bb9c72cc033d092b3d76af6dcabf4cb97c653d
-rw-r--r--common/hal/google_camera_hal/realtime_zsl_result_request_processor.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/common/hal/google_camera_hal/realtime_zsl_result_request_processor.cc b/common/hal/google_camera_hal/realtime_zsl_result_request_processor.cc
index 498d681..24d73cd 100644
--- a/common/hal/google_camera_hal/realtime_zsl_result_request_processor.cc
+++ b/common/hal/google_camera_hal/realtime_zsl_result_request_processor.cc
@@ -123,6 +123,20 @@ void RealtimeZslResultRequestProcessor::ProcessResult(
// Return directly for frames with errors.
if (pending_error_frames_.find(result->frame_number) !=
pending_error_frames_.end()) {
+ // Also need to process pending buffers and metadata for the frame if exists.
+ if (pending_frame_number_to_requests_.find(result->frame_number) !=
+ pending_frame_number_to_requests_.end()) {
+ auto& entry = pending_frame_number_to_requests_[result->frame_number];
+ if (!entry->output_buffers.empty()) {
+ result->output_buffers = entry->output_buffers;
+ result->input_buffers = entry->input_buffers;
+ }
+ if (entry->settings != nullptr) {
+ result->result_metadata =
+ HalCameraMetadata::Clone(entry->settings.get());
+ }
+ pending_frame_number_to_requests_.erase(result->frame_number);
+ }
pending_error_frames_.erase(result->frame_number);
process_capture_result_(std::move(result));
return;