[libcamera-devel] [RFC PATCH v3 04/16] android, controls: Add and plumb MaxLatency control
Paul Elder
paul.elder at ideasonboard.com
Fri Jul 2 12:37:48 CEST 2021
Add a MaxLatency control, and plumb it into the HAL accordingly.
Bug: https://bugs.libcamera.org/show_bug.cgi?id=50
Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
Changes in v3:
- use v3 setMetadata
- add comment to explain 4
- remove todo
Changes in v2:
- use new setMetadata
- rebase on camera capabilities refactor
---
src/android/camera_capabilities.cpp | 13 +++++++++++--
src/libcamera/control_ids.yaml | 10 ++++++++++
2 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp
index 1d4c44ce..530167de 100644
--- a/src/android/camera_capabilities.cpp
+++ b/src/android/camera_capabilities.cpp
@@ -870,8 +870,17 @@ int CameraCapabilities::initializeStaticMetadata()
}
/* Sync static metadata. */
- int32_t maxLatency = ANDROID_SYNC_MAX_LATENCY_UNKNOWN;
- staticMetadata_->addEntry(ANDROID_SYNC_MAX_LATENCY, maxLatency);
+ int32_t maxLatency = setMetadata<int32_t, int32_t>(
+ staticMetadata_.get(), ANDROID_SYNC_MAX_LATENCY,
+ controlsInfo, &controls::draft::MaxLatency,
+ ControlRange::Def,
+ (int32_t)ANDROID_SYNC_MAX_LATENCY_UNKNOWN);
+ LOG(HAL, Info) << "Max sync latency is " << maxLatency;
+ /* CTS allows a sync latency of up to 4 for burst capture capability */
+ if (maxLatency < 0 || 4 < maxLatency)
+ capabilities.erase(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE);
+ if (maxLatency != 0)
+ hwLevels.erase(ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_FULL);
/* Flash static metadata. */
char flashAvailable = ANDROID_FLASH_INFO_AVAILABLE_FALSE;
diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml
index d92f29f5..9d4638ae 100644
--- a/src/libcamera/control_ids.yaml
+++ b/src/libcamera/control_ids.yaml
@@ -622,6 +622,16 @@ controls:
detection, additional format conversions etc) count as an additional
pipeline stage.
+ - MaxLatency:
+ type: int32_t
+ draft: true
+ description: |
+ The maximum number of frames that can occur after a request (different
+ than the previous) has been submitted, and before the result's state
+ becomes synchronized. A value of -1 indicates unknown latency, and 0
+ indicates per-frame control. Currently identical to
+ ANDROID_SYNC_MAX_LATENCY.
+
- TestPatternMode:
type: int32_t
draft: true
--
2.27.0
More information about the libcamera-devel
mailing list