{"id":2394,"url":"https://patchwork.libcamera.org/api/patches/2394/?format=json","web_url":"https://patchwork.libcamera.org/patch/2394/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20191204132106.21582-11-jacopo@jmondi.org>","date":"2019-12-04T13:21:06","name":"[libcamera-devel,10/10] DO NOT MERGE: Reports camera properties in cam","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"6dcf3b0fb7ba6f727f1846008af12c361f79ef52","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/2394/mbox/","series":[{"id":581,"url":"https://patchwork.libcamera.org/api/series/581/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=581","date":"2019-12-04T13:20:56","name":"Introduce camera properties","version":1,"mbox":"https://patchwork.libcamera.org/series/581/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/2394/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/2394/checks/","tags":{},"headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay10.mail.gandi.net (relay10.mail.gandi.net\n\t[217.70.178.230])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 752B361D27\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  4 Dec 2019 14:21:25 +0100 (CET)","from uno.lan (93-34-114-233.ip49.fastwebnet.it [93.34.114.233])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay10.mail.gandi.net (Postfix) with ESMTPSA id 1902124000E;\n\tWed,  4 Dec 2019 13:21:24 +0000 (UTC)"],"From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Wed,  4 Dec 2019 14:21:06 +0100","Message-Id":"<20191204132106.21582-11-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.23.0","In-Reply-To":"<20191204132106.21582-1-jacopo@jmondi.org>","References":"<20191204132106.21582-1-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 10/10] DO NOT MERGE: Reports camera\n\tproperties in cam","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, 04 Dec 2019 13:21:25 -0000"},"content":"Running cam -l lists the camera properties registered by the pipeline\nhandler.\n\nIn example, for the VIMC pipelinehandler:\n\nAvailable cameras:\n1: Integrated Camera: Integrated C\n2: VIMC Sensor B\nRotation: 0\nLocation: 0\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/cam/main.cpp | 11 +++++++++++\n 1 file changed, 11 insertions(+)","diff":"diff --git a/src/cam/main.cpp b/src/cam/main.cpp\nindex a38cca959aca..8d37754773af 100644\n--- a/src/cam/main.cpp\n+++ b/src/cam/main.cpp\n@@ -11,6 +11,7 @@\n #include <string.h>\n \n #include <libcamera/libcamera.h>\n+#include <libcamera/property_ids.h>\n \n #include \"capture.h\"\n #include \"event_loop.h\"\n@@ -309,6 +310,16 @@ int CamApp::run()\n \t\tfor (const std::shared_ptr<Camera> &cam : cm_->cameras()) {\n \t\t\tstd::cout << index << \": \" << cam->name() << std::endl;\n \t\t\tindex++;\n+\n+\t\t\tconst ControlList &properties = cam->properties();\n+\t\t\tfor (const auto &prop : properties) {\n+\t\t\t\tauto it = properties::properties.find(prop.first);\n+\t\t\t\tif (it == properties::properties.end())\n+\t\t\t\t\tcontinue;\n+\n+\t\t\t\tstd::cout << it->second->name() << \": \" <<\n+\t\t\t\t\tprop.second.get<int32_t>() << \"\\n\";\n+\t\t\t}\n \t\t}\n \t}\n \n","prefixes":["libcamera-devel","10/10"]}