Message ID | 20201210175939.166033-1-jacopo@jmondi.org |
---|---|
State | Accepted |
Delegated to: | Jacopo Mondi |
Headers | show |
Series |
|
Related | show |
Hi Jacopo, Thank you for the patch. On Thu, Dec 10, 2020 at 06:59:39PM +0100, Jacopo Mondi wrote: > The ChromeOS camera service, which is the current main user of the > Android Camera HAL, fails to start if the pixel array properties are > not registered. > > As the sensor driver for the Soraka test device have not yet been > updated to report their pixel array properties through the V4L2 > selection API, temporary fix the gap by re-establishing the default > properties values removed by commit 1889cdc2e91c ("android: camera_device: > Initialize pixel array properties") > > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> > --- > src/android/camera_device.cpp | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp > index e9fb23175d27..8b46e2d1e4ba 100644 > --- a/src/android/camera_device.cpp > +++ b/src/android/camera_device.cpp > @@ -735,6 +735,10 @@ const camera_metadata_t *CameraDevice::getStaticMetadata() > }; > staticMetadata_->addEntry(ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE, > data.data(), data.size()); > + } else { With /* * \todo Drop the default once the ov5670 and ov13858 drivers * are updated to report the pixel array size. */ (and possibly the same below), Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > + int32_t data[] = { 2592, 1944 }; > + staticMetadata_->addEntry(ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE, > + data, 2); > } > > if (properties.contains(properties::PixelArrayActiveAreas)) { > @@ -748,6 +752,10 @@ const camera_metadata_t *CameraDevice::getStaticMetadata() > }; > staticMetadata_->addEntry(ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE, > data.data(), data.size()); > + } else { > + int32_t data[] = { 0, 0, 2560, 1920 }; > + staticMetadata_->addEntry(ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE, > + data, 4); > } > > int32_t sensitivityRange[] = {
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index e9fb23175d27..8b46e2d1e4ba 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -735,6 +735,10 @@ const camera_metadata_t *CameraDevice::getStaticMetadata() }; staticMetadata_->addEntry(ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE, data.data(), data.size()); + } else { + int32_t data[] = { 2592, 1944 }; + staticMetadata_->addEntry(ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE, + data, 2); } if (properties.contains(properties::PixelArrayActiveAreas)) { @@ -748,6 +752,10 @@ const camera_metadata_t *CameraDevice::getStaticMetadata() }; staticMetadata_->addEntry(ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE, data.data(), data.size()); + } else { + int32_t data[] = { 0, 0, 2560, 1920 }; + staticMetadata_->addEntry(ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE, + data, 4); } int32_t sensitivityRange[] = {
The ChromeOS camera service, which is the current main user of the Android Camera HAL, fails to start if the pixel array properties are not registered. As the sensor driver for the Soraka test device have not yet been updated to report their pixel array properties through the V4L2 selection API, temporary fix the gap by re-establishing the default properties values removed by commit 1889cdc2e91c ("android: camera_device: Initialize pixel array properties") Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> --- src/android/camera_device.cpp | 8 ++++++++ 1 file changed, 8 insertions(+)