[{"id":4036,"web_url":"https://patchwork.libcamera.org/comment/4036/","msgid":"<20200316160217.GM2260535@oden.dyn.berto.se>","date":"2020-03-16T16:02:17","subject":"Re: [libcamera-devel] [PATCH 5/8] libcamera: v4l2_videodevice:\n\tExpose the device capabilities","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Laurent,\n\nThanks for your work.\n\nOn 2020-03-14 01:38:53 +0200, Laurent Pinchart wrote:\n> Add a caps() function that exposes the V4L2 capabilities for the device.\n> This is useful for generic code that can't hardcode any a priori\n> knowledge of the device, such as in a simple pipeline handler.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n>  src/libcamera/include/v4l2_videodevice.h | 2 ++\n>  src/libcamera/v4l2_videodevice.cpp       | 6 ++++++\n>  2 files changed, 8 insertions(+)\n> \n> diff --git a/src/libcamera/include/v4l2_videodevice.h b/src/libcamera/include/v4l2_videodevice.h\n> index 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);\n> diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\n> index 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> -- \n> Regards,\n> \n> Laurent Pinchart\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lf1-x141.google.com (mail-lf1-x141.google.com\n\t[IPv6:2a00:1450:4864:20::141])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0DCB76041A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 16 Mar 2020 17:02:19 +0100 (CET)","by mail-lf1-x141.google.com with SMTP id a28so2693659lfr.13\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 16 Mar 2020 09:02:19 -0700 (PDT)","from localhost (h-200-138.A463.priv.bahnhof.se. [176.10.200.138])\n\tby smtp.gmail.com with ESMTPSA id\n\tt207sm244088lff.72.2020.03.16.09.02.17\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 16 Mar 2020 09:02:17 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=ygxytCgGItXuDnX/bsSA4TidDsRiFmVrwDcibmULBwI=;\n\tb=TFO8aUecLdWdNE+o40E55+wWX/woaa1dJkC2y3XXOV8BaWAV0nO8GmFO2pu9hW5ETW\n\tOfLDCLjStmgThbyQieuOhVxKpfeMghZ5YLGC1WBwsIO7C9QH8Jhx6iq6cbkzWakNSoHd\n\tru+WyrcMFTHQuMXXImggi5n9HUcyo8r2D+nEHNS3D/WMXbuXBxAzwSxstoH+8B0H6olW\n\tEVSh94L3JEkV/nyGtX1tC96loxk5IHFGkvFxvAwYM2KbtDBEydb3xNfReoC8WwzRB27j\n\t1WUNhHo4D3l95vdyCuNbi8KSoHG1h4zimrW3tLq4d1YKQD+ZzWjV+mSNY/PGt8833C8c\n\tNZzQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=ygxytCgGItXuDnX/bsSA4TidDsRiFmVrwDcibmULBwI=;\n\tb=LbKPf9aTX9quz3f7T8zUfnVwv0hj+tRrQS1yBz5RexTXlXF5CUFGYnusNziC63awtR\n\t1+c2B5SO35kctB+pDxS5EQIKnEQNH4yoZTP9LhoDp36HWdKFbOFd/RrseSiZ3WBZvVXM\n\t8Cud1kqx03y6aauLYtCTT8h6pEKIq/CZ6qL4xOKe6EAL0x55mmMb2En7Ujp8sgD+AMwg\n\tNcAJq7EjdxtDoYs9toHJaYcRheQns1bO9vb38T48IfSsvuay5wguN+Szvjx790qH5G5L\n\t5/YRo28DcxfqqQEl5VJJ2Q054ip3PvZLBbIZs8NqoLHB5sQxLhFa2ifrfglQN5+Ms9V7\n\tw/3w==","X-Gm-Message-State":"ANhLgQ2++jVUqSeCFi29iqHVvCc0NryA7aKOXWq5or393k53VPg1bP13\n\t0pa84y1tKKre9acq5Bj2IEJjaA==","X-Google-Smtp-Source":"ADFU+vtzTsijqYNApNVyMRahgR+ZiKdA+PFt6dvp2jUKSfthi0mznvDgDcmbzV4uX4DweRz9H5vfuA==","X-Received":"by 2002:a19:c188:: with SMTP id r130mr68273lff.148.1584374538432;\n\tMon, 16 Mar 2020 09:02:18 -0700 (PDT)","Date":"Mon, 16 Mar 2020 17:02:17 +0100","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org, Martijn Braam <martijn@brixit.nl>, \n\tMickael GUENE <mickael.guene@st.com>,\n\tBenjamin GAIGNARD <benjamin.gaignard@st.com>","Message-ID":"<20200316160217.GM2260535@oden.dyn.berto.se>","References":"<20200313233856.25202-1-laurent.pinchart@ideasonboard.com>\n\t<20200313233856.25202-6-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20200313233856.25202-6-laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 5/8] libcamera: v4l2_videodevice:\n\tExpose the 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":"Mon, 16 Mar 2020 16:02:19 -0000"}}]