summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2021-06-30 14:41:24 +0200
committerJacopo Mondi <jacopo@jmondi.org>2021-10-15 09:32:31 +0200
commit5d3d66646573b9b9610eb6ca0680eb1c68223ecf (patch)
tree2ea61ec2d2e3581534be60fd3308b29362d171c2 /src
parent8c2d135300b3fb839ddf6d6c537833e06887804c (diff)
android: capabilities: Collect absolute max frame durations
While building the list of supported stream configurations also collect the absolute max frame durations to be used to populate the sensor maximum frame duration. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r--src/android/camera_capabilities.cpp9
-rw-r--r--src/android/camera_capabilities.h1
2 files changed, 7 insertions, 3 deletions
diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp
index b92af5de..43ef2ee6 100644
--- a/src/android/camera_capabilities.cpp
+++ b/src/android/camera_capabilities.cpp
@@ -385,6 +385,7 @@ int CameraCapabilities::initialize(std::shared_ptr<Camera> camera,
orientation_ = orientation;
facing_ = facing;
rawStreamAvailable_ = false;
+ maxFrameDuration_ = 0;
/* Acquire the camera and initialize available stream configurations. */
int ret = camera_->acquire();
@@ -673,6 +674,9 @@ int CameraCapabilities::initializeStreamConfigurations()
});
maxJpegSize = std::max(maxJpegSize, res);
}
+
+ maxFrameDuration_ = std::max(maxFrameDuration_,
+ maxFrameDuration);
}
/*
@@ -1154,9 +1158,8 @@ int CameraCapabilities::initializeStaticMetadata()
staticMetadata_->addEntry(ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE,
timestampSource);
- if (maxFrameDurationNsec > 0)
- staticMetadata_->addEntry(ANDROID_SENSOR_INFO_MAX_FRAME_DURATION,
- maxFrameDurationNsec);
+ staticMetadata_->addEntry(ANDROID_SENSOR_INFO_MAX_FRAME_DURATION,
+ maxFrameDuration_);
/* Statistics static metadata. */
uint8_t faceDetectMode = ANDROID_STATISTICS_FACE_DETECT_MODE_OFF;
diff --git a/src/android/camera_capabilities.h b/src/android/camera_capabilities.h
index 6e55ddab..2cf97ae8 100644
--- a/src/android/camera_capabilities.h
+++ b/src/android/camera_capabilities.h
@@ -71,6 +71,7 @@ private:
int facing_;
int orientation_;
bool rawStreamAvailable_;
+ int64_t maxFrameDuration_;
camera_metadata_enum_android_info_supported_hardware_level hwLevel_;
std::set<camera_metadata_enum_android_request_available_capabilities> capabilities_;