From patchwork Wed May 20 11:48:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 3828 Return-Path: Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0F664603F3 for ; Wed, 20 May 2020 13:45:00 +0200 (CEST) X-Originating-IP: 2.224.242.101 Received: from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 53B451C0004; Wed, 20 May 2020 11:44:59 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Wed, 20 May 2020 13:48:12 +0200 Message-Id: <20200520114812.440695-2-jacopo@jmondi.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200520114812.440695-1-jacopo@jmondi.org> References: <20200520114812.440695-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 2/2] libcamera: camera_sensor: Update properties parsing X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 11:45:00 -0000 Update the properties parsing routine in the CameraSensor class to use the newly defined V4L2 control V4L2_CID_CAMERA_ORIENTATION in place of the downstream V4L2_CID_CAMERA_SENSOR_LOCATION which has now been removed. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/libcamera/camera_sensor.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp index 174df17cfaef..b14b4051dca6 100644 --- a/src/libcamera/camera_sensor.cpp +++ b/src/libcamera/camera_sensor.cpp @@ -210,24 +210,23 @@ int CameraSensor::init() int32_t propertyValue; /* Camera Location: default is front location. */ - const auto &locationControl = controls.find(V4L2_CID_CAMERA_SENSOR_LOCATION); - if (locationControl != controls.end()) { - int32_t v4l2Location = - locationControl->second.def().get(); + const auto &orientation = controls.find(V4L2_CID_CAMERA_ORIENTATION); + if (orientation != controls.end()) { + int32_t v4l2Orientation = orientation->second.def().get(); - switch (v4l2Location) { + switch (v4l2Orientation) { default: LOG(CameraSensor, Warning) << "Unsupported camera location " - << v4l2Location << ", setting to Front"; + << v4l2Orientation << ", setting to Front"; /* Fall-through */ - case V4L2_LOCATION_FRONT: + case V4L2_CAMERA_ORIENTATION_FRONT: propertyValue = properties::CameraLocationFront; break; - case V4L2_LOCATION_BACK: + case V4L2_CAMERA_ORIENTATION_BACK: propertyValue = properties::CameraLocationBack; break; - case V4L2_LOCATION_EXTERNAL: + case V4L2_CAMERA_ORIENTATION_EXTERNAL: propertyValue = properties::CameraLocationExternal; break; }