Patch Detail
Show a patch.
GET /api/1.1/patches/102/?format=api
{ "id": 102, "url": "https://patchwork.libcamera.org/api/1.1/patches/102/?format=api", "web_url": "https://patchwork.libcamera.org/patch/102/", "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": "<20181229032855.26249-8-niklas.soderlund@ragnatech.se>", "date": "2018-12-29T03:28:50", "name": "[libcamera-devel,v2,07/12] libcamera: device_enumerator: add factory for DeviceEnumerators", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "3bbfe84f8146810616a176acedd378298225f290", "submitter": { "id": 5, "url": "https://patchwork.libcamera.org/api/1.1/people/5/?format=api", "name": "Niklas Söderlund", "email": "niklas.soderlund@ragnatech.se" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/102/mbox/", "series": [ { "id": 41, "url": "https://patchwork.libcamera.org/api/1.1/series/41/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=41", "date": "2018-12-29T03:28:43", "name": "Add basic camera enumeration", "version": 2, "mbox": "https://patchwork.libcamera.org/series/41/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/102/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/102/checks/", "tags": {}, "headers": { "Return-Path": "<niklas.soderlund@ragnatech.se>", "Received": [ "from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net\n\t[195.74.38.229])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1ECDB60B31\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 29 Dec 2018 04:29:56 +0100 (CET)", "from bismarck.berto.se (unknown [89.233.230.99])\n\tby bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA\n\tid fbb49f4a-0b19-11e9-911a-0050569116f7;\n\tSat, 29 Dec 2018 04:29:43 +0100 (CET)" ], "X-Halon-ID": "fbb49f4a-0b19-11e9-911a-0050569116f7", "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": "Sat, 29 Dec 2018 04:28:50 +0100", "Message-Id": "<20181229032855.26249-8-niklas.soderlund@ragnatech.se>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20181229032855.26249-1-niklas.soderlund@ragnatech.se>", "References": "<20181229032855.26249-1-niklas.soderlund@ragnatech.se>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v2 07/12] libcamera: device_enumerator:\n\tadd factory 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, 29 Dec 2018 03:29:56 -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>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/device_enumerator.cpp | 19 +++++++++++++++++++\n src/libcamera/include/device_enumerator.h | 2 ++\n 2 files changed, 21 insertions(+)", "diff": "diff --git a/src/libcamera/device_enumerator.cpp b/src/libcamera/device_enumerator.cpp\nindex 3cafd0d3703dac99..26a3e68fcf39e43a 100644\n--- a/src/libcamera/device_enumerator.cpp\n+++ b/src/libcamera/device_enumerator.cpp\n@@ -121,6 +121,25 @@ bool DeviceMatch::match(const DeviceInfo *info) 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/*\n+\t * NOTE: Either udev is not available or initialization of it\n+\t * failed, use/fallback on sysfs enumerator\n+\t */\n+\n+\t/* TODO: add a sysfs based enumerator */\n+\n+\treturn nullptr;\n+}\n+\n DeviceEnumerator::~DeviceEnumerator()\n {\n \tfor (DeviceInfo *dev : devices_) {\ndiff --git a/src/libcamera/include/device_enumerator.h b/src/libcamera/include/device_enumerator.h\nindex 5348e6cf583dbd15..24bca0e3fc32c377 100644\n--- a/src/libcamera/include/device_enumerator.h\n+++ b/src/libcamera/include/device_enumerator.h\n@@ -56,6 +56,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", "v2", "07/12" ] }