Patch Detail
Show a patch.
GET /api/1.1/patches/385/?format=api
{ "id": 385, "url": "https://patchwork.libcamera.org/api/1.1/patches/385/?format=api", "web_url": "https://patchwork.libcamera.org/patch/385/", "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": "<20190125153340.2744-7-niklas.soderlund@ragnatech.se>", "date": "2019-01-25T15:33:39", "name": "[libcamera-devel,v2,6/7] libcamera: camera: integrate streams and configuration", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "496bd6e0ace56b05bff8b3ce15001aa6880c876f", "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": { "id": 16, "url": "https://patchwork.libcamera.org/api/1.1/users/16/?format=api", "username": "neg", "first_name": "Niklas", "last_name": "Söderlund", "email": "niklas.soderlund@ragnatech.se" }, "mbox": "https://patchwork.libcamera.org/patch/385/mbox/", "series": [ { "id": 132, "url": "https://patchwork.libcamera.org/api/1.1/series/132/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=132", "date": "2019-01-25T15:33:33", "name": "libcamera: add basic support for Streams and format configuration", "version": 2, "mbox": "https://patchwork.libcamera.org/series/132/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/385/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/385/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 C897E60C80\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 25 Jan 2019 16:33:54 +0100 (CET)", "from bismarck.berto.se (unknown [89.233.230.99])\n\tby bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA\n\tid 9e9fa57f-20b6-11e9-874f-005056917f90;\n\tFri, 25 Jan 2019 16:33:53 +0100 (CET)" ], "X-Halon-ID": "9e9fa57f-20b6-11e9-874f-005056917f90", "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": "Fri, 25 Jan 2019 16:33:39 +0100", "Message-Id": "<20190125153340.2744-7-niklas.soderlund@ragnatech.se>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20190125153340.2744-1-niklas.soderlund@ragnatech.se>", "References": "<20190125153340.2744-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 6/7] libcamera: camera: integrate\n\tstreams and configuration", "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": "Fri, 25 Jan 2019 15:33:55 -0000" }, "content": "Add retrieval and configuration of streams information and\nconfiguration. The implementation in the Camera are minimalistic as the\nheavily lifting are done by the pipeline handler implementations.\n\nThe single most important thing for the helpers in the Camera object is\nto perform access control and making sure no request is forwarded to a\npipeline handler if the camera have been disconnected.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n include/libcamera/camera.h | 7 ++++++\n src/libcamera/camera.cpp | 48 ++++++++++++++++++++++++++++++++++++++\n 2 files changed, 55 insertions(+)", "diff": "diff --git a/include/libcamera/camera.h b/include/libcamera/camera.h\nindex 7e358f8c0aa093cf..c6342ed81598921c 100644\n--- a/include/libcamera/camera.h\n+++ b/include/libcamera/camera.h\n@@ -9,12 +9,15 @@\n \n #include <memory>\n #include <string>\n+#include <vector>\n \n #include <libcamera/signal.h>\n \n namespace libcamera {\n \n class PipelineHandler;\n+class Stream;\n+class StreamConfiguration;\n \n class Camera final\n {\n@@ -32,6 +35,10 @@ public:\n \tint acquire();\n \tvoid release();\n \n+\tstd::vector<Stream> streams() const;\n+\n+\tint configure(std::vector<StreamConfiguration *> &config);\n+\n private:\n \tCamera(PipelineHandler *pipe, const std::string &name);\n \t~Camera();\ndiff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp\nindex fd19e8cf6694cc1b..f90abfecd4e6bb48 100644\n--- a/src/libcamera/camera.cpp\n+++ b/src/libcamera/camera.cpp\n@@ -6,6 +6,9 @@\n */\n \n #include <libcamera/camera.h>\n+#include <libcamera/stream.h>\n+\n+#include \"pipeline_handler.h\"\n \n #include \"log.h\"\n #include \"pipeline_handler.h\"\n@@ -160,4 +163,49 @@ void Camera::release()\n \tacquired_ = false;\n }\n \n+/**\n+ * \\brief Retrieve the supported streams of the camera\n+ *\n+ * \\return An array of streams supported by the camera device\n+ */\n+std::vector<Stream> Camera::streams() const\n+{\n+\tstd::vector<Stream> streams;\n+\n+\tif (pipe_)\n+\t\tstreams = pipe_->streams(this);\n+\n+\treturn streams;\n+}\n+\n+/**\n+ * \\brief Configure the camera device prior to capture\n+ *\n+ * Prior to starting capture, the camera device must be configured to select a\n+ * set of streams.\n+ *\n+ * The requested configuration \\a config shall contain at least one stream and\n+ * may contain multiple streams. For each stream an associated StreamFormat\n+ * shall be supplied. Streams supported by the camera device not part of the\n+ * \\a config will be disabled.\n+ *\n+ * Exclusive access to the camera device shall be ensured by a call to\n+ * Camera::acquire() before calling this function, otherwise an -EACCES error\n+ * will be returned.\n+ *\n+ * \\param[in] config Array of stream configurations to setup\n+ *\n+ * \\return 0 on success or a negative error code on error.\n+ */\n+int Camera::configure(std::vector<StreamConfiguration *> &config)\n+{\n+\tif (!pipe_)\n+\t\treturn -ENODEV;\n+\n+\tif (!acquired_)\n+\t\treturn -EACCES;\n+\n+\treturn pipe_->configure(this, config);\n+}\n+\n } /* namespace libcamera */\n", "prefixes": [ "libcamera-devel", "v2", "6/7" ] }