[libcamera-devel] [PATCH 08/16] android: capabilties: Correctly populate STALL durations
paul.elder at ideasonboard.com
paul.elder at ideasonboard.com
Wed Sep 1 10:14:45 CEST 2021
Hi Jacopo,
On Fri, Aug 27, 2021 at 02:07:49PM +0200, Jacopo Mondi wrote:
> We currently only record 2560x1920 at 30FPS as 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 at jmondi.org>
Reviewed-by: Paul Elder <paul.elder at ideasonboard.com>
> ---
> src/android/camera_capabilities.cpp | 19 +++++++++++++------
> 1 file changed, 13 insertions(+), 6 deletions(-)
>
> diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp
> index 061e65241806..23a9a3fbec50 100644
> --- a/src/android/camera_capabilities.cpp
> +++ b/src/android/camera_capabilities.cpp
> @@ -1263,12 +1263,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_) {
> @@ -1280,6 +1274,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);
>
> --
> 2.32.0
>
More information about the libcamera-devel
mailing list