[libcamera-devel] [PATCH 3/3] android: CameraDevice: Deny non ROTATION_0 stream configuration

Hirokazu Honda hiroh at chromium.org
Thu Mar 25 06:19:31 CET 2021


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 at chromium.org>
---
 src/android/camera_device.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index d24b0b23..3aab643d 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -1657,6 +1657,13 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)
 		if (!format.isValid())
 			return -EINVAL;

+		/* \todo Support crop_rotate_scale_degrees. */
+		if (stream->crop_rotate_scale_degrees != CAMERA3_STREAM_ROTATION_0) {
+			LOG(HAL, Error)
+				<< "crop_rotate_scale_degrees is not supported";
+			return -EINVAL;
+		}
+
 		/* Defer handling of MJPEG streams until all others are known. */
 		if (stream->format == HAL_PIXEL_FORMAT_BLOB) {
 			if (jpegStream) {
--
2.31.0.291.g576ba9dcdaf-goog


More information about the libcamera-devel mailing list