Patch Detail
Show a patch.
GET /api/1.1/patches/14365/?format=api
{ "id": 14365, "url": "https://patchwork.libcamera.org/api/1.1/patches/14365/?format=api", "web_url": "https://patchwork.libcamera.org/patch/14365/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20211027120713.2240563-1-kieran.bingham@ideasonboard.com>", "date": "2021-10-27T12:07:13", "name": "[libcamera-devel] libcamera: v4l2_videodevice: provide hasMediaController()", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "0190420057b3540d126d3c06676e76846afbdeb2", "submitter": { "id": 4, "url": "https://patchwork.libcamera.org/api/1.1/people/4/?format=api", "name": "Kieran Bingham", "email": "kieran.bingham@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/14365/mbox/", "series": [ { "id": 2662, "url": "https://patchwork.libcamera.org/api/1.1/series/2662/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2662", "date": "2021-10-27T12:07:13", "name": "[libcamera-devel] libcamera: v4l2_videodevice: provide hasMediaController()", "version": 1, "mbox": "https://patchwork.libcamera.org/series/2662/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/14365/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/14365/checks/", "tags": {}, "headers": { "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>", "X-Original-To": "parsemail@patchwork.libcamera.org", "Delivered-To": "parsemail@patchwork.libcamera.org", "Received": [ "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id D847FBF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 27 Oct 2021 12:07:18 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 380F66487F;\n\tWed, 27 Oct 2021 14:07:18 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 96BC060123\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Oct 2021 14:07:17 +0200 (CEST)", "from Monstersaurus.local\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2F289596;\n\tWed, 27 Oct 2021 14:07:17 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"I+57oqWo\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1635336437;\n\tbh=slMtmDuAj5Z6tGnsaQJ0kUi/oJseJzdm6qRYl2c6TC0=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=I+57oqWowaCoNBJSgWcE6BquR6ea3Hr4TVJfRdZw+4A3+YK+wNDA4wlg+op1iDHri\n\tEmFQghKTx25ZmRJ/utKc3mHpa2Sog/4dyRDGMsfGQxZZrtNnLUclLNSc7kTwZzWMeh\n\t0MU/5v23JvckD/sRhncWpudQ0kmf6emkaU2fa5G8=", "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>", "To": "libcamera devel <libcamera-devel@lists.libcamera.org>", "Date": "Wed, 27 Oct 2021 13:07:13 +0100", "Message-Id": "<20211027120713.2240563-1-kieran.bingham@ideasonboard.com>", "X-Mailer": "git-send-email 2.30.2", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH] libcamera: v4l2_videodevice: provide\n\thasMediaController()", "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>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "The V4L2Capability has helpers to interogate the capabilities\nof a device.\n\nV4L2VideoDevice::enumPixelformats accesses the raw capabilites to check\nif the device is supported by a MediaController device.\n\nProvide a helper, and update the usage.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n---\nThis might also be used in the upcoming RPi MediaController series, but\nshouldn't block integration of that ...\n---\n include/libcamera/internal/v4l2_videodevice.h | 4 ++++\n src/libcamera/v4l2_videodevice.cpp | 2 +-\n 2 files changed, 5 insertions(+), 1 deletion(-)", "diff": "diff --git a/include/libcamera/internal/v4l2_videodevice.h b/include/libcamera/internal/v4l2_videodevice.h\nindex efe34d47e72b..a1c458e45088 100644\n--- a/include/libcamera/internal/v4l2_videodevice.h\n+++ b/include/libcamera/internal/v4l2_videodevice.h\n@@ -109,6 +109,10 @@ struct V4L2Capability final : v4l2_capability {\n \t{\n \t\treturn device_caps() & V4L2_CAP_STREAMING;\n \t}\n+\tbool hasMediaController() const\n+\t{\n+\t\treturn device_caps() & V4L2_CAP_IO_MC;\n+\t}\n };\n \n class V4L2BufferCache\ndiff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\nindex 0cc622f91f2d..0fbf32bcfc00 100644\n--- a/src/libcamera/v4l2_videodevice.cpp\n+++ b/src/libcamera/v4l2_videodevice.cpp\n@@ -1019,7 +1019,7 @@ std::vector<V4L2PixelFormat> V4L2VideoDevice::enumPixelformats(uint32_t code)\n \tstd::vector<V4L2PixelFormat> formats;\n \tint ret;\n \n-\tif (code && !(caps_.device_caps() & V4L2_CAP_IO_MC)) {\n+\tif (code && !(caps_.hasMediaController())) {\n \t\tLOG(V4L2, Error)\n \t\t\t<< \"Media bus code filtering not supported by the device\";\n \t\treturn {};\n", "prefixes": [ "libcamera-devel" ] }