[libcamera-devel] [PATCH 1/2] android: camera_device: Fix sensor frame duration
Umang Jain
umang.jain at ideasonboard.com
Sat May 22 13:29:55 CEST 2021
Hi Paul,
On 5/21/21 4:25 PM, Paul Elder wrote:
> The sensor frame duration should be set by IPA. Get the information for
> the result metadata from libcamera.
>
> Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
> ---
> src/android/camera_device.cpp | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
> index b32e8be5..779ce554 100644
> --- a/src/android/camera_device.cpp
> +++ b/src/android/camera_device.cpp
> @@ -2252,6 +2252,16 @@ CameraDevice::getResultMetadata(const Camera3RequestDescriptor &descriptor) cons
> resultMetadata->addEntry(ANDROID_SENSOR_EXPOSURE_TIME, exposure);
> }
>
> + if (metadata.contains(controls::FrameDurations)) {
> + Span<const int64_t> durations =
> + metadata.get(controls::FrameDurations);
> + if (durations[0] == durations[1]) {
> + int64_t duration = durations[0] * 1000;
> + resultMetadata->addEntry(ANDROID_SENSOR_FRAME_DURATION,
> + duration);
> + }
> + }
> +
I wonder if the hard coding patch [2/2] should live here instead (as a
'else' fallback), with a \todo in ipa/ipu3.cpp ofcourse. Since, we have
two IPAs for IPU3 platform(one residing externally), we would need to
introduce [2/2] in the external IPA as well, I think, sooner down the
CTS line work. As far as I can see, there are already a few hard-coded
values in camera_device.cpp for resultMetadata entries. I think this
approach would serve a better "singular" place to look at regarding what
entries are hard-coded and which one aren't. What do you think?
> if (metadata.contains(controls::ScalerCrop)) {
> Rectangle crop = metadata.get(controls::ScalerCrop);
> int32_t cropRect[] = {
More information about the libcamera-devel
mailing list