Patch Detail
Show a patch.
GET /api/patches/11099/?format=api
{ "id": 11099, "url": "https://patchwork.libcamera.org/api/patches/11099/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11099/", "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": "<20210131224702.8838-21-laurent.pinchart@ideasonboard.com>", "date": "2021-01-31T22:47:02", "name": "[libcamera-devel,20/20] libcamera: pipeline: simple: Enable multiple streams for compatible devices", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "1e4b43f694ccafaeedc8c3fbb7b6604cd5a239b2", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": { "id": 14, "url": "https://patchwork.libcamera.org/api/users/14/?format=api", "username": "pinchartl", "first_name": "Laurent", "last_name": "Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "mbox": "https://patchwork.libcamera.org/patch/11099/mbox/", "series": [ { "id": 1633, "url": "https://patchwork.libcamera.org/api/series/1633/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1633", "date": "2021-01-31T22:46:42", "name": "[libcamera-devel,01/20] libcamera: pipeline: simple: Manage converter with std::unique_ptr<>", "version": 1, "mbox": "https://patchwork.libcamera.org/series/1633/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/11099/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11099/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 8756EBD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 31 Jan 2021 22:47:48 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 53FCD6840E;\n\tSun, 31 Jan 2021 23:47:48 +0100 (CET)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9E342683FF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 31 Jan 2021 23:47:37 +0100 (CET)", "from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D12531850; \n\tSun, 31 Jan 2021 23:47:35 +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=\"hcoGpm93\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1612133256;\n\tbh=veZtHrkAHVBklEY0+Sz5xGy72xisPX77x1nnWAKUZQE=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=hcoGpm93r3xZdktSxVEguXJPxzX6zVa4Y0szpFtEEJiHJaxqj8CZqSL4amDWcsBez\n\tr/kQkophXYXonp0NzfsgO3lOCt7aRjViaw08RrD0obcHamnq8qEukvv9anc/z0/YE6\n\tpdj0VKE5GmzYKCeqMYpgMf4o1nwfZajCDCBQFFsI=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 1 Feb 2021 00:47:02 +0200", "Message-Id": "<20210131224702.8838-21-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.28.0", "In-Reply-To": "<20210131224702.8838-1-laurent.pinchart@ideasonboard.com>", "References": "<20210131224702.8838-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH 20/20] libcamera: pipeline: simple: Enable\n\tmultiple streams for compatible devices", "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>", "Cc": "Phi-Bang Nguyen <pnguyen@baylibre.com>", "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": "Allow support for multiple streams on a per-device basis. The decision\nshould be made based on the ability of the converter to run multiple\ntimes within the duration of one frame. Hardcode it in\nSimplePipelineInfo for now.\n\nWe may later compute the number of supported streams dynamically based\non the requested configuration, using converter bandwidth information\ninstead of a hardcoded fixed value.\n\nAll platforms are currently limited to a single stream until they get\nsuccessfully tested with multiple streams.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/pipeline/simple/simple.cpp | 39 +++++++++++++-----------\n 1 file changed, 21 insertions(+), 18 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex 55a5528611c8..4a8a7ed24960 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -126,14 +126,15 @@ class SimplePipelineHandler;\n struct SimplePipelineInfo {\n \tconst char *driver;\n \tconst char *converter;\n+\tunsigned int numStreams;\n };\n \n namespace {\n \n static const SimplePipelineInfo supportedDevices[] = {\n-\t{ \"imx7-csi\", \"pxp\" },\n-\t{ \"qcom-camss\", nullptr },\n-\t{ \"sun6i-csi\", nullptr },\n+\t{ \"imx7-csi\", \"pxp\", 1 },\n+\t{ \"qcom-camss\", nullptr, 1 },\n+\t{ \"sun6i-csi\", nullptr, 1 },\n };\n \n } /* namespace */\n@@ -141,7 +142,9 @@ static const SimplePipelineInfo supportedDevices[] = {\n class SimpleCameraData : public CameraData\n {\n public:\n-\tSimpleCameraData(SimplePipelineHandler *pipe, MediaEntity *sensor);\n+\tSimpleCameraData(SimplePipelineHandler *pipe,\n+\t\t\t const SimplePipelineInfo *info,\n+\t\t\t MediaEntity *sensor);\n \n \tbool isValid() const { return sensor_ != nullptr; }\n \n@@ -254,13 +257,12 @@ private:\n */\n \n SimpleCameraData::SimpleCameraData(SimplePipelineHandler *pipe,\n+\t\t\t\t const SimplePipelineInfo *info,\n \t\t\t\t MediaEntity *sensor)\n-\t: CameraData(pipe)\n+\t: CameraData(pipe), streams_(info->numStreams)\n {\n \tint ret;\n \n-\tstreams_.resize(1);\n-\n \t/*\n \t * Walk the pipeline towards the video node and store all entities\n \t * along the way.\n@@ -864,25 +866,26 @@ int SimplePipelineHandler::queueRequestDevice(Camera *camera, Request *request)\n \n bool SimplePipelineHandler::match(DeviceEnumerator *enumerator)\n {\n+\tconst SimplePipelineInfo *info = nullptr;\n \tMediaDevice *converter = nullptr;\n \n-\tfor (const SimplePipelineInfo &info : supportedDevices) {\n-\t\tDeviceMatch dm(info.driver);\n+\tfor (const SimplePipelineInfo &inf : supportedDevices) {\n+\t\tDeviceMatch dm(inf.driver);\n \t\tmedia_ = acquireMediaDevice(enumerator, dm);\n-\t\tif (!media_)\n-\t\t\tcontinue;\n-\n-\t\tif (!info.converter)\n+\t\tif (media_) {\n+\t\t\tinfo = &inf;\n \t\t\tbreak;\n-\n-\t\tDeviceMatch converterMatch(info.converter);\n-\t\tconverter = acquireMediaDevice(enumerator, converterMatch);\n-\t\tbreak;\n+\t\t}\n \t}\n \n \tif (!media_)\n \t\treturn false;\n \n+\tif (info->converter) {\n+\t\tDeviceMatch converterMatch(info->converter);\n+\t\tconverter = acquireMediaDevice(enumerator, converterMatch);\n+\t}\n+\n \t/* Locate the sensors. */\n \tstd::vector<MediaEntity *> sensors;\n \n@@ -926,7 +929,7 @@ bool SimplePipelineHandler::match(DeviceEnumerator *enumerator)\n \n \tfor (MediaEntity *sensor : sensors) {\n \t\tstd::unique_ptr<SimpleCameraData> data =\n-\t\t\tstd::make_unique<SimpleCameraData>(this, sensor);\n+\t\t\tstd::make_unique<SimpleCameraData>(this, info, sensor);\n \t\tif (!data->isValid()) {\n \t\t\tLOG(SimplePipeline, Error)\n \t\t\t\t<< \"No valid pipeline for sensor '\"\n", "prefixes": [ "libcamera-devel", "20/20" ] }