Patch Detail
Show a patch.
GET /api/patches/11000/?format=api
{ "id": 11000, "url": "https://patchwork.libcamera.org/api/patches/11000/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11000/", "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": "<20210126102825.147026-5-paul.elder@ideasonboard.com>", "date": "2021-01-26T10:28:21", "name": "[libcamera-devel,v5,4/8] android: camera_device: Load make and model from platform settings", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "5a8e7ae6ce3ff7e57c321da226d848a06dbf9965", "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/11000/mbox/", "series": [ { "id": 1608, "url": "https://patchwork.libcamera.org/api/series/1608/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1608", "date": "2021-01-26T10:28:17", "name": "Fill in android result metadata and EXIF tags", "version": 5, "mbox": "https://patchwork.libcamera.org/series/1608/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/11000/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11000/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 E62E5BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 26 Jan 2021 10:28:46 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B3AED682FD;\n\tTue, 26 Jan 2021 11:28:46 +0100 (CET)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 364E5682F5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Jan 2021 11:28:45 +0100 (CET)", "from pyrite.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:2c71:1b79:d06d:5032])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 279AF2E0;\n\tTue, 26 Jan 2021 11:28:42 +0100 (CET)" ], "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=\"NmOaeB2S\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1611656924;\n\tbh=B4Kz+CWd4AtKmBQkg79E1Mp3yQjc05JA7MydSAJ1e64=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=NmOaeB2SXGoUo5xLpvdAknQfYds5Gpz1mjZGQqkmmZfe7+qclYuqMhJG95xiJGmrL\n\ticfThog0g9k9oXbPZvSW3+mVOdPDPkdVKQBacCJFYm1g3lwbtr0wMDrU4jBcjrcrup\n\tdGFTgo0/ojoUjsi5clKp5uY0+v53LmUkoGbrAgXM=", "From": "Paul Elder <paul.elder@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 26 Jan 2021 19:28:21 +0900", "Message-Id": "<20210126102825.147026-5-paul.elder@ideasonboard.com>", "X-Mailer": "git-send-email 2.27.0", "In-Reply-To": "<20210126102825.147026-1-paul.elder@ideasonboard.com>", "References": "<20210126102825.147026-1-paul.elder@ideasonboard.com>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH v5 4/8] android: camera_device: Load make\n\tand model from platform settings", "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>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "In ChromeOS the camera make and model is saved in\n/var/cache/camera/camera.prop. Load and save these values at\nconstruction time, if available.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\n---\nChanges in v5:\n- rename cameraMake() and cameraModel to maker() and model()\n\nNo change in v4\n\nChanges in v3:\n- rename cameraMake_ and cameraModel_ to maker_ and model_\n\nChanges in v2:\n- use fstream instead of File and split\n---\n src/android/camera_device.cpp | 23 +++++++++++++++++++++++\n src/android/camera_device.h | 5 +++++\n 2 files changed, 28 insertions(+)", "diff": "diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex 1a384460..7929877c 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -9,6 +9,7 @@\n #include \"camera_ops.h\"\n #include \"post_processor.h\"\n \n+#include <fstream>\n #include <sys/mman.h>\n #include <tuple>\n #include <vector>\n@@ -351,6 +352,28 @@ CameraDevice::CameraDevice(unsigned int id, const std::shared_ptr<Camera> &camer\n \t * streamConfiguration.\n \t */\n \tmaxJpegBufferSize_ = 13 << 20; /* 13631488 from USB HAL */\n+\n+\tmaker_ = \"libcamera\";\n+\tmodel_ = \"cameraModel\";\n+\n+\t/* \\todo Support getting properties on Android */\n+\tstd::ifstream fstream(\"/var/cache/camera/camera.prop\");\n+\tif (!fstream.is_open())\n+\t\treturn;\n+\n+\tstd::string line;\n+\twhile (std::getline(fstream, line)) {\n+\t\tstd::string::size_type delimPos = line.find(\"=\");\n+\t\tif (delimPos == std::string::npos)\n+\t\t\tcontinue;\n+\t\tstd::string key = line.substr(0, delimPos);\n+\t\tstd::string val = line.substr(delimPos + 1);\n+\n+\t\tif (!key.compare(\"ro.product.model\"))\n+\t\t\tmodel_ = val;\n+\t\telse if (!key.compare(\"ro.product.manufacturer\"))\n+\t\t\tmaker_ = val;\n+\t}\n }\n \n CameraDevice::~CameraDevice()\ndiff --git a/src/android/camera_device.h b/src/android/camera_device.h\nindex 597d11fc..4b0d8575 100644\n--- a/src/android/camera_device.h\n+++ b/src/android/camera_device.h\n@@ -55,6 +55,8 @@ public:\n \t\treturn config_.get();\n \t}\n \n+\tconst std::string &maker() const { return maker_; }\n+\tconst std::string &model() const { return model_; }\n \tint facing() const { return facing_; }\n \tint orientation() const { return orientation_; }\n \tunsigned int maxJpegBufferSize() const { return maxJpegBufferSize_; }\n@@ -125,6 +127,9 @@ private:\n \tstd::map<int, libcamera::PixelFormat> formatsMap_;\n \tstd::vector<CameraStream> streams_;\n \n+\tstd::string maker_;\n+\tstd::string model_;\n+\n \tint facing_;\n \tint orientation_;\n \n", "prefixes": [ "libcamera-devel", "v5", "4/8" ] }