summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-06-04 01:15:37 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-06-04 01:15:37 +0000
commit4e4e9d5a3ec515bc4b4f2ccfb274a89cebe4271d (patch)
tree3808d31db17e9d48190c6e085a285956506f1efe
parentf6ca229cc9f7f281b96aa7335d133200bf575c49 (diff)
parent92084c6ed634c784e58190822ad19eb5024359a3 (diff)
downloadcamera-4e4e9d5a3ec515bc4b4f2ccfb274a89cebe4271d.tar.gz
Snap for 6557098 from 92084c6ed634c784e58190822ad19eb5024359a3 to rvc-d1-release
Change-Id: I9d2e5de972a4e224586c5cc3915699d9b4be499a
-rw-r--r--common/hal/common/vendor_tag_defs.h6
-rw-r--r--common/hal/google_camera_hal/camera_device_session.cc9
-rw-r--r--common/hal/hwl_interface/zoom_ratio_mapper_hwl.h3
-rw-r--r--common/hal/utils/zoom_ratio_mapper.cc12
4 files changed, 24 insertions, 6 deletions
diff --git a/common/hal/common/vendor_tag_defs.h b/common/hal/common/vendor_tag_defs.h
index b2235fd..7d93d8d 100644
--- a/common/hal/common/vendor_tag_defs.h
+++ b/common/hal/common/vendor_tag_defs.h
@@ -61,7 +61,11 @@ enum class SmoothyMode : uint32_t {
// Tracks an object of interest and keeps it at frame's salient position, e.g.
// center.
- kTrackingMode
+ kTrackingMode,
+
+ // Uses UW camera with a larger margin. In this way, we get a better video
+ // stabilization quality, while preserving a similar FoV as the main camera.
+ kSuperstabMode
};
// Logical camera vendor tags
diff --git a/common/hal/google_camera_hal/camera_device_session.cc b/common/hal/google_camera_hal/camera_device_session.cc
index 75d024d..421f233 100644
--- a/common/hal/google_camera_hal/camera_device_session.cc
+++ b/common/hal/google_camera_hal/camera_device_session.cc
@@ -115,10 +115,6 @@ status_t CameraDeviceSession::UpdatePendingRequest(CaptureResult* result) {
return BAD_VALUE;
}
- if (result->result_metadata) {
- pending_results_.erase(result->frame_number);
- }
-
if (result->output_buffers.empty()) {
// Nothing to do if the result doesn't contain any output buffers.
return OK;
@@ -211,6 +207,11 @@ void CameraDeviceSession::ProcessCaptureResult(
buffers.insert(buffers.end(), result->output_buffers.begin(),
result->output_buffers.end());
+ if (result->result_metadata) {
+ std::lock_guard<std::mutex> lock(request_record_lock_);
+ pending_results_.erase(result->frame_number);
+ }
+
{
std::shared_lock lock(session_callback_lock_);
session_callback_.process_capture_result(std::move(result));
diff --git a/common/hal/hwl_interface/zoom_ratio_mapper_hwl.h b/common/hal/hwl_interface/zoom_ratio_mapper_hwl.h
index 019074c..edfc825 100644
--- a/common/hal/hwl_interface/zoom_ratio_mapper_hwl.h
+++ b/common/hal/hwl_interface/zoom_ratio_mapper_hwl.h
@@ -27,6 +27,9 @@ class ZoomRatioMapperHwl {
public:
virtual ~ZoomRatioMapperHwl() = default;
+ // Limit zoom ratio if concurrent mode is on
+ virtual void LimitZoomRatioIfConcurrent(float* zoom_ratio) const = 0;
+
// Apply zoom ratio to capture request
virtual void UpdateCaptureRequest(CaptureRequest* request) = 0;
diff --git a/common/hal/utils/zoom_ratio_mapper.cc b/common/hal/utils/zoom_ratio_mapper.cc
index a8f2f28..8171f0d 100644
--- a/common/hal/utils/zoom_ratio_mapper.cc
+++ b/common/hal/utils/zoom_ratio_mapper.cc
@@ -16,9 +16,11 @@
#define LOG_TAG "GCH_ZoomRatioMapper"
-#include "zoom_ratio_mapper.h"
#include <log/log.h>
+#include <cmath>
+
#include "utils.h"
+#include "zoom_ratio_mapper.h"
namespace android {
namespace google_camera_hal {
@@ -140,6 +142,14 @@ void ZoomRatioMapper::ApplyZoomRatio(const Dimension& active_array_dimension,
zoom_ratio = zoom_ratio_range_.max;
}
+ if (zoom_ratio_mapper_hwl_ != nullptr && is_request) {
+ zoom_ratio_mapper_hwl_->LimitZoomRatioIfConcurrent(&zoom_ratio);
+ }
+
+ if (fabs(zoom_ratio - entry.data.f[0]) > 1e-9) {
+ metadata->Set(ANDROID_CONTROL_ZOOM_RATIO, &zoom_ratio, entry.count);
+ }
+
for (auto tag_id : kRectToConvert) {
UpdateRects(zoom_ratio, tag_id, active_array_dimension, is_request,
metadata);