{"id":2488,"url":"https://patchwork.libcamera.org/api/patches/2488/?format=json","web_url":"https://patchwork.libcamera.org/patch/2488/","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":"<20200103054120.30979-4-paul.elder@ideasonboard.com>","date":"2020-01-03T05:41:19","name":"[libcamera-devel,v5,3/4] libcamera: pipeline_handler: uvcvideo: register all Cameras along with a devnum","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"85ba6336c54d8ce326d57bb7c061a17ed261fb20","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/?format=json","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/2488/mbox/","series":[{"id":598,"url":"https://patchwork.libcamera.org/api/series/598/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=598","date":"2020-01-03T05:41:16","name":"V4L2 compatibility layer","version":5,"mbox":"https://patchwork.libcamera.org/series/598/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/2488/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/2488/checks/","tags":{},"headers":{"Return-Path":"<paul.elder@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 2CFA8605E4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  3 Jan 2020 06:41:30 +0100 (CET)","from neptunite.amanokami.net (unknown [96.44.9.94])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7AC73A3C;\n\tFri,  3 Jan 2020 06:41:29 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1578030089;\n\tbh=1wASivwnxnU3iV+3L4L+AzqzX/e/OiDAnamuv0xKi1k=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=OnvYbe77R2+36Cg1GHo7j29o005bngK4w/Q6Qr1bTGkYxzjiRXaz+lB3zjAG/5bPb\n\tin4G3A3euxVqgfgPpO9YGI96bSGqZMvXTeG5eF9oLDJ/sQid4pvPmfkOkA1OQECciZ\n\tKuBdrNTGZMaLW5qxwoQyUSeOcH+V83uDHh7zpfcU=","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri,  3 Jan 2020 00:41:19 -0500","Message-Id":"<20200103054120.30979-4-paul.elder@ideasonboard.com>","X-Mailer":"git-send-email 2.24.1","In-Reply-To":"<20200103054120.30979-1-paul.elder@ideasonboard.com>","References":"<20200103054120.30979-1-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v5 3/4] 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":"Fri, 03 Jan 2020 05:41:30 -0000"},"content":"This patch depends on patch \"libcamera: pipeline: uvcvideo: Fix crash\nwhen default entity is not found\".\n\nRegister all UVC Cameras along with their device numbers, to eventually\nallow the V4L2 compatibility layer to match against it.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n---\nChanges in v5:\n- rebased on \"libcamera: pipeline: uvcvideo: Fix crash when default\n  entity is not found\"\n\nNo change in v4\n\nNew in v3\n---\n src/libcamera/pipeline/uvcvideo.cpp | 6 +++++-\n 1 file changed, 5 insertions(+), 1 deletion(-)","diff":"diff --git a/src/libcamera/pipeline/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo.cpp\nindex 8d7f7ea7..662b2462 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,6 +295,7 @@ 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 \tconst std::vector<MediaEntity *> &entities = media->entities();\n@@ -309,10 +311,12 @@ bool PipelineHandlerUVC::match(DeviceEnumerator *enumerator)\n \tif (data->init(*entity))\n \t\treturn false;\n \n+\tdevnum = makedev((*entity)->deviceMajor(), (*entity)->deviceMinor());\n+\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","v5","3/4"]}