{"id":3828,"url":"https://patchwork.libcamera.org/api/1.1/patches/3828/?format=json","web_url":"https://patchwork.libcamera.org/patch/3828/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20200520114812.440695-2-jacopo@jmondi.org>","date":"2020-05-20T11:48:12","name":"[libcamera-devel,v3,2/2] libcamera: camera_sensor: Update properties parsing","commit_ref":"c31785156bf9d6cbb5e4c41bf3f7344914bbb411","pull_url":null,"state":"accepted","archived":false,"hash":"9f13afe791b7c7751a9a89e4e6addc0a86b882dd","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/1.1/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/3828/mbox/","series":[{"id":917,"url":"https://patchwork.libcamera.org/api/1.1/series/917/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=917","date":"2020-05-20T11:48:11","name":"[libcamera-devel,v3,1/2] include: linux: Update v4l2 ctrls for properties","version":3,"mbox":"https://patchwork.libcamera.org/series/917/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/3828/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/3828/checks/","tags":{},"headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net\n\t[217.70.183.197])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0F664603F3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 20 May 2020 13:45:00 +0200 (CEST)","from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 53B451C0004;\n\tWed, 20 May 2020 11:44:59 +0000 (UTC)"],"X-Originating-IP":"2.224.242.101","From":"Jacopo Mondi <jacopo@jmondi.org>","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","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v3 2/2] libcamera: camera_sensor: Update\n\tproperties parsing","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Wed, 20 May 2020 11:45:00 -0000"},"content":"Update the properties parsing routine in the CameraSensor class to use\nthe newly defined V4L2 control V4L2_CID_CAMERA_ORIENTATION in place of\nthe downstream V4L2_CID_CAMERA_SENSOR_LOCATION which has now been\nremoved.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/camera_sensor.cpp | 17 ++++++++---------\n 1 file changed, 8 insertions(+), 9 deletions(-)","diff":"diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\nindex 174df17cfaef..b14b4051dca6 100644\n--- a/src/libcamera/camera_sensor.cpp\n+++ b/src/libcamera/camera_sensor.cpp\n@@ -210,24 +210,23 @@ int CameraSensor::init()\n \tint32_t propertyValue;\n \n \t/* Camera Location: default is front location. */\n-\tconst auto &locationControl = controls.find(V4L2_CID_CAMERA_SENSOR_LOCATION);\n-\tif (locationControl != controls.end()) {\n-\t\tint32_t v4l2Location =\n-\t\t\tlocationControl->second.def().get<int32_t>();\n+\tconst auto &orientation = controls.find(V4L2_CID_CAMERA_ORIENTATION);\n+\tif (orientation != controls.end()) {\n+\t\tint32_t v4l2Orientation = orientation->second.def().get<int32_t>();\n \n-\t\tswitch (v4l2Location) {\n+\t\tswitch (v4l2Orientation) {\n \t\tdefault:\n \t\t\tLOG(CameraSensor, Warning)\n \t\t\t\t<< \"Unsupported camera location \"\n-\t\t\t\t<< v4l2Location << \", setting to Front\";\n+\t\t\t\t<< v4l2Orientation << \", setting to Front\";\n \t\t\t/* Fall-through */\n-\t\tcase V4L2_LOCATION_FRONT:\n+\t\tcase V4L2_CAMERA_ORIENTATION_FRONT:\n \t\t\tpropertyValue = properties::CameraLocationFront;\n \t\t\tbreak;\n-\t\tcase V4L2_LOCATION_BACK:\n+\t\tcase V4L2_CAMERA_ORIENTATION_BACK:\n \t\t\tpropertyValue = properties::CameraLocationBack;\n \t\t\tbreak;\n-\t\tcase V4L2_LOCATION_EXTERNAL:\n+\t\tcase V4L2_CAMERA_ORIENTATION_EXTERNAL:\n \t\t\tpropertyValue = properties::CameraLocationExternal;\n \t\t\tbreak;\n \t\t}\n","prefixes":["libcamera-devel","v3","2/2"]}