[libcamera-devel,v3,4/4] android: CameraDevice: Deny non ROTATION_0 stream configuration
diff mbox series

Message ID 20210330052521.381550-5-hiroh@chromium.org
State Changes Requested
Headers show
Series
  • Regard crop_rotate_scale_degrees in configuration
Related show

Commit Message

Hirokazu Honda March 30, 2021, 5:25 a.m. UTC
libcamera doesn't handle crop_rotate_scale_degrees. Therefore,
if it is requested, that is, crop_rotate_scale_degrees is not
CAMERA3_STREAM_ROTATION_0, the configuration should fail.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
---
 src/android/camera_device.cpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Patch
diff mbox series

diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index e0eaa3b5..344522ba 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -1657,6 +1657,18 @@  int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)
 		if (!format.isValid())
 			return -EINVAL;
 
+		/* \todo Support rotation. */
+		if (stream->rotation != CAMERA3_STREAM_ROTATION_0) {
+			LOG(HAL, Error) << "Rotation is not supported";
+			return -EINVAL;
+		}
+#if defined(CHROMEOS)
+		if (stream->crop_rotate_scale_degrees != CAMERA3_STREAM_ROTATION_0) {
+			LOG(HAL, Error) << "Rotation is not supported";
+			return -EINVAL;
+		}
+#endif
+
 		/* Defer handling of MJPEG streams until all others are known. */
 		if (stream->format == HAL_PIXEL_FORMAT_BLOB) {
 			if (jpegStream) {