{"id":3089,"url":"https://patchwork.libcamera.org/api/1.1/patches/3089/?format=json","web_url":"https://patchwork.libcamera.org/patch/3089/","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":"<20200313233856.25202-6-laurent.pinchart@ideasonboard.com>","date":"2020-03-13T23:38:53","name":"[libcamera-devel,5/8] libcamera: v4l2_videodevice: Expose the device capabilities","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"8ba4faad1f5760d5a1783609993c80cbdd19d03f","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/3089/mbox/","series":[{"id":718,"url":"https://patchwork.libcamera.org/api/1.1/series/718/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=718","date":"2020-03-13T23:38:48","name":"Simple pipeline handler","version":1,"mbox":"https://patchwork.libcamera.org/series/718/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/3089/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/3089/checks/","tags":{},"headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D0A5262938\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 14 Mar 2020 00:39:07 +0100 (CET)","from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 323EC184A;\n\tSat, 14 Mar 2020 00:39:07 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1584142747;\n\tbh=LrsspT9ELByFH4FEUA+hZP9TBMIXM+ke8hkA1+XUzkc=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=e6nDDcJVV1UIgTxlB0A4G+lZ6R5w7vI2+bKSKG5eXtdwf9on2glM6r5j6nqHtlefu\n\tDu/5I5SCd+iuqfIetbSvBHH23hfqnW5U+UK1ROKEcXfe6ILsG8A525Bp8vqwb1UUIp\n\t/fNIIyACI+93lXB+hJWpS0qUb2Y2XNjnjMoKA2QQ=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Martijn Braam <martijn@brixit.nl>,\n\tAndrey Konovalov <andrey.konovalov@linaro.org>,\n\tMickael GUENE <mickael.guene@st.com>,\n\tBenjamin GAIGNARD <benjamin.gaignard@st.com>","Date":"Sat, 14 Mar 2020 01:38:53 +0200","Message-Id":"<20200313233856.25202-6-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.24.1","In-Reply-To":"<20200313233856.25202-1-laurent.pinchart@ideasonboard.com>","References":"<20200313233856.25202-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 5/8] libcamera: v4l2_videodevice: Expose\n\tthe device capabilities","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":"Fri, 13 Mar 2020 23:39:08 -0000"},"content":"Add a caps() function that exposes the V4L2 capabilities for the device.\nThis is useful for generic code that can't hardcode any a priori\nknowledge of the device, such as in a simple pipeline handler.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/include/v4l2_videodevice.h | 2 ++\n src/libcamera/v4l2_videodevice.cpp       | 6 ++++++\n 2 files changed, 8 insertions(+)","diff":"diff --git a/src/libcamera/include/v4l2_videodevice.h b/src/libcamera/include/v4l2_videodevice.h\nindex 72e7a50e6c3d..b2e12608084a 100644\n--- a/src/libcamera/include/v4l2_videodevice.h\n+++ b/src/libcamera/include/v4l2_videodevice.h\n@@ -182,6 +182,8 @@ public:\n \tconst char *deviceName() const { return caps_.card(); }\n \tconst char *busName() const { return caps_.bus_info(); }\n \n+\tconst V4L2Capability &caps() const { return caps_; }\n+\n \tint getFormat(V4L2DeviceFormat *format);\n \tint setFormat(V4L2DeviceFormat *format);\n \tImageFormats formats(uint32_t code = 0);\ndiff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\nindex ccc5faba3c27..86b262ba2436 100644\n--- a/src/libcamera/v4l2_videodevice.cpp\n+++ b/src/libcamera/v4l2_videodevice.cpp\n@@ -625,6 +625,12 @@ void V4L2VideoDevice::close()\n  * \\return The string containing the device location\n  */\n \n+/**\n+ * \\fn V4L2VideoDevice::caps()\n+ * \\brief Retrieve the device V4L2 capabilities\n+ * \\return The device V4L2 capabilities\n+ */\n+\n std::string V4L2VideoDevice::logPrefix() const\n {\n \treturn deviceNode() + (V4L2_TYPE_IS_OUTPUT(bufferType_) ? \"[out]\" : \"[cap]\");\n","prefixes":["libcamera-devel","5/8"]}