Patch Detail
Show a patch.
GET /api/patches/2446/?format=api
{ "id": 2446, "url": "https://patchwork.libcamera.org/api/patches/2446/?format=api", "web_url": "https://patchwork.libcamera.org/patch/2446/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/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": "<20191223072620.13022-4-paul.elder@ideasonboard.com>", "date": "2019-12-23T07:26:17", "name": "[libcamera-devel,v3,3/6] libcamera: pipeline_handler: uvcvideo: register all Cameras along with a devnum", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "c44be33817ff1879c28bf8111de8cf4b938bb598", "submitter": { "id": 17, "url": "https://patchwork.libcamera.org/api/people/17/?format=api", "name": "Paul Elder", "email": "paul.elder@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/2446/mbox/", "series": [ { "id": 592, "url": "https://patchwork.libcamera.org/api/series/592/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=592", "date": "2019-12-23T07:26:14", "name": "V4L2 compatibility layer", "version": 3, "mbox": "https://patchwork.libcamera.org/series/592/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/2446/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/2446/checks/", "tags": {}, "headers": { "Return-Path": "<paul.elder@ideasonboard.com>", "Received": [ "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 45F57605D0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 23 Dec 2019 08:26:50 +0100 (CET)", "from neptunite.amanokami.net (173-16-160-11.client.mchsi.com\n\t[173.16.160.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 35E8E330;\n\tMon, 23 Dec 2019 08:26:49 +0100 (CET)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1577086010;\n\tbh=XjPedv3ULegMUBy6xhhY2mZExTaVM1tfjZZagdkETd8=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=eHLoH71bpLxokfRZ7RvZ9BjdAwamgMJ9UHpQN1i5qxX+vpB6EfHqg2Tq8jakDa6C7\n\ti0Ay7bHcEQRGoambVdRu7zYCv+fjRfXgfmGhzaAQFuUS2RG15/eWZVgqOtPbBDUqYS\n\tmj6eMyh/94Quxky4mGJicA/jE9G8MfCsN+6+YCwk=", "From": "Paul Elder <paul.elder@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 23 Dec 2019 01:26:17 -0600", "Message-Id": "<20191223072620.13022-4-paul.elder@ideasonboard.com>", "X-Mailer": "git-send-email 2.23.0", "In-Reply-To": "<20191223072620.13022-1-paul.elder@ideasonboard.com>", "References": "<20191223072620.13022-1-paul.elder@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v3 3/6] libcamera: pipeline_handler:\n\tuvcvideo: register all Cameras along with a devnum", "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, 23 Dec 2019 07:26:50 -0000" }, "content": "Register all UVC Cameras along with its device number, to eventually\nallow the V4L2 compatibility layer to match against it.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n\n---\nNew in v3\n---\n src/libcamera/pipeline/uvcvideo.cpp | 7 +++++--\n 1 file changed, 5 insertions(+), 2 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo.cpp\nindex 3043366b..096c1c09 100644\n--- a/src/libcamera/pipeline/uvcvideo.cpp\n+++ b/src/libcamera/pipeline/uvcvideo.cpp\n@@ -7,6 +7,7 @@\n \n #include <algorithm>\n #include <iomanip>\n+#include <sys/sysmacros.h>\n #include <tuple>\n \n #include <libcamera/camera.h>\n@@ -294,17 +295,19 @@ bool PipelineHandlerUVC::match(DeviceEnumerator *enumerator)\n \t\treturn false;\n \n \tstd::unique_ptr<UVCCameraData> data = utils::make_unique<UVCCameraData>(this);\n+\tdev_t devnum = 0;\n \n \t/* Locate and initialise the camera data with the default video node. */\n \tfor (MediaEntity *entity : media->entities()) {\n \t\tif (entity->flags() & MEDIA_ENT_FL_DEFAULT) {\n \t\t\tif (data->init(entity))\n \t\t\t\treturn false;\n+\t\t\tdevnum = makedev(entity->deviceMajor(), entity->deviceMinor());\n \t\t\tbreak;\n \t\t}\n \t}\n \n-\tif (!data) {\n+\tif (!data || !devnum) {\n \t\tLOG(UVC, Error) << \"Could not find a default video device\";\n \t\treturn false;\n \t}\n@@ -312,7 +315,7 @@ bool PipelineHandlerUVC::match(DeviceEnumerator *enumerator)\n \t/* Create and register the camera. */\n \tstd::set<Stream *> streams{ &data->stream_ };\n \tstd::shared_ptr<Camera> camera = Camera::create(this, media->model(), streams);\n-\tregisterCamera(std::move(camera), std::move(data));\n+\tregisterCamera(std::move(camera), std::move(data), devnum);\n \n \t/* Enable hot-unplug notifications. */\n \thotplugMediaDevice(media);\n", "prefixes": [ "libcamera-devel", "v3", "3/6" ] }