diff options
author | Jacopo Mondi <jacopo@jmondi.org> | 2021-06-29 17:37:35 +0200 |
---|---|---|
committer | Jacopo Mondi <jacopo@jmondi.org> | 2021-10-15 09:32:31 +0200 |
commit | 8c2d135300b3fb839ddf6d6c537833e06887804c (patch) | |
tree | 48d85cd40baf21a5e0bf95e150e455fc0e31ce3d /src/android/camera_capabilities.cpp | |
parent | 02f47869151fafb8252c6bd64fcebd161fc548b8 (diff) |
android: capabilties: Correctly populate STALL durations
We currently hardcode 2560x1920@30FPS as the only stalling frame duration.
This is of course not correct, and all the required information to
properly populate the ANDROID_SCALER_AVAILABLE_STALL_DURATIONS static
metadata are available from initializeStaticMetadata().
Use the collected stalling durations and sizes to properly popoulate the
static property.
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/android/camera_capabilities.cpp')
-rw-r--r-- | src/android/camera_capabilities.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp index bf6135cc..b92af5de 100644 --- a/src/android/camera_capabilities.cpp +++ b/src/android/camera_capabilities.cpp @@ -1285,12 +1285,6 @@ int CameraCapabilities::initializeStaticMetadata() staticMetadata_->addEntry(ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS, availableStreamConfigurations); - std::vector<int64_t> availableStallDurations = { - ANDROID_SCALER_AVAILABLE_FORMATS_BLOB, 2560, 1920, 33333333, - }; - staticMetadata_->addEntry(ANDROID_SCALER_AVAILABLE_STALL_DURATIONS, - availableStallDurations); - std::vector<int64_t> minFrameDurations; minFrameDurations.reserve(streamConfigurations_.size() * 4); for (const auto &entry : streamConfigurations_) { @@ -1302,6 +1296,19 @@ int CameraCapabilities::initializeStaticMetadata() staticMetadata_->addEntry(ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS, minFrameDurations); + std::vector<int64_t> availableStallDurations; + for (const auto &entry : streamConfigurations_) { + if (entry.androidFormat != HAL_PIXEL_FORMAT_BLOB) + continue; + + availableStallDurations.push_back(entry.androidFormat); + availableStallDurations.push_back(entry.resolution.width); + availableStallDurations.push_back(entry.resolution.height); + availableStallDurations.push_back(entry.minFrameDurationNsec); + } + staticMetadata_->addEntry(ANDROID_SCALER_AVAILABLE_STALL_DURATIONS, + availableStallDurations); + uint8_t croppingType = ANDROID_SCALER_CROPPING_TYPE_CENTER_ONLY; staticMetadata_->addEntry(ANDROID_SCALER_CROPPING_TYPE, croppingType); |