Patch Detail
Show a patch.
GET /api/patches/83/?format=api
{ "id": 83, "url": "https://patchwork.libcamera.org/api/patches/83/?format=api", "web_url": "https://patchwork.libcamera.org/patch/83/", "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": "<20181222230041.29999-8-niklas.soderlund@ragnatech.se>", "date": "2018-12-22T23:00:36", "name": "[libcamera-devel,07/12] libcamera: deviceenumerator: add factory for DeviceEnumerators", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "22cea39390a6af13ff37096e7660972b7f2a4eab", "submitter": { "id": 5, "url": "https://patchwork.libcamera.org/api/people/5/?format=api", "name": "Niklas Söderlund", "email": "niklas.soderlund@ragnatech.se" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/83/mbox/", "series": [ { "id": 38, "url": "https://patchwork.libcamera.org/api/series/38/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=38", "date": "2018-12-22T23:00:29", "name": "Add basic camera enumeration", "version": 1, "mbox": "https://patchwork.libcamera.org/series/38/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/83/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/83/checks/", "tags": {}, "headers": { "Return-Path": "<niklas.soderlund@ragnatech.se>", "Received": [ "from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net\n\t[195.74.38.228])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 19A0A60B31\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 23 Dec 2018 00:02:28 +0100 (CET)", "from wyvern.dyn.berto.se (unknown [217.31.177.236])\n\tby bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA\n\tid 96ba8d9d-063d-11e9-9adf-005056917a89;\n\tSun, 23 Dec 2018 00:02:01 +0100 (CET)" ], "X-Halon-ID": "96ba8d9d-063d-11e9-9adf-005056917a89", "Authorized-sender": "niklas@soderlund.pp.se", "From": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Sun, 23 Dec 2018 00:00:36 +0100", "Message-Id": "<20181222230041.29999-8-niklas.soderlund@ragnatech.se>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20181222230041.29999-1-niklas.soderlund@ragnatech.se>", "References": "<20181222230041.29999-1-niklas.soderlund@ragnatech.se>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 07/12] libcamera: deviceenumerator: add\n\tfactory for DeviceEnumerators", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.23", "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": "Sat, 22 Dec 2018 23:02:28 -0000" }, "content": "Provide a factory for DeviceEnumerator objects. Depending on which\nlibraries are available there will be different ways to enumerate\ninformation in the system. This factory hides this from the rest of the\nlibrary.\n\nCurrently udev enumeration is the only supported implementation, a sysfs\nimplementation is another method that surely will be added in the\nfuture.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n src/libcamera/deviceenumerator.cpp | 17 +++++++++++++++++\n src/libcamera/include/deviceenumerator.h | 2 ++\n 2 files changed, 19 insertions(+)", "diff": "diff --git a/src/libcamera/deviceenumerator.cpp b/src/libcamera/deviceenumerator.cpp\nindex f4c40bf0376ab453..6d675fc78af8e586 100644\n--- a/src/libcamera/deviceenumerator.cpp\n+++ b/src/libcamera/deviceenumerator.cpp\n@@ -138,6 +138,23 @@ bool DeviceMatch::matchEntities(const std::vector<std::string> &entities) const\n * Enumerator Base\n */\n \n+DeviceEnumerator *DeviceEnumerator::create()\n+{\n+\tDeviceEnumerator *enumerator;\n+\n+\t/* TODO: add compile time checks to only try udev enumerator if libudev is available */\n+\tenumerator = new DeviceEnumeratorUdev();\n+\tif (!enumerator->init())\n+\t\treturn enumerator;\n+\n+\t/* NOTE: Either udev is not available or initialization of it\n+\t * failed, use/fallback on sysfs enumerator */\n+\n+\t/* TODO: add a sysfs based enumerator */\n+\n+\treturn NULL;\n+}\n+\n DeviceEnumerator::~DeviceEnumerator()\n {\n \tfor (DeviceInfo *dev : devices_) {\ndiff --git a/src/libcamera/include/deviceenumerator.h b/src/libcamera/include/deviceenumerator.h\nindex 2c7ff3f336ba127d..6aa6e59d4a8a9729 100644\n--- a/src/libcamera/include/deviceenumerator.h\n+++ b/src/libcamera/include/deviceenumerator.h\n@@ -59,6 +59,8 @@ private:\n class DeviceEnumerator\n {\n public:\n+\tstatic DeviceEnumerator *create();\n+\n \tvirtual ~DeviceEnumerator();\n \n \tvirtual int init() = 0;\n", "prefixes": [ "libcamera-devel", "07/12" ] }