Show a patch.

GET /api/patches/10652/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 10652,
    "url": "https://patchwork.libcamera.org/api/patches/10652/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/10652/",
    "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": "<20201212004149.158801-2-hiroh@chromium.org>",
    "date": "2020-12-12T00:41:48",
    "name": "[libcamera-devel,v8,2/3] android: camera_device: Use Camera3StreamConfig in configureStreams()",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "f38e3918f1b46005d82b4fa0ae2b9e7c9c0728dc",
    "submitter": {
        "id": 63,
        "url": "https://patchwork.libcamera.org/api/people/63/?format=api",
        "name": "Hirokazu Honda",
        "email": "hiroh@chromium.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/10652/mbox/",
    "series": [
        {
            "id": 1528,
            "url": "https://patchwork.libcamera.org/api/series/1528/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1528",
            "date": "2020-12-12T00:41:49",
            "name": "[libcamera-devel,v8,1/3] android: camera_device: Introduce Camera3StreamConfig",
            "version": 8,
            "mbox": "https://patchwork.libcamera.org/series/1528/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/10652/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/10652/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 957C6BD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 12 Dec 2020 01:31:41 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0B97E68054;\n\tSat, 12 Dec 2020 02:31:41 +0100 (CET)",
            "from mail-pg1-x544.google.com (mail-pg1-x544.google.com\n\t[IPv6:2607:f8b0:4864:20::544])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DE45268053\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 12 Dec 2020 02:31:38 +0100 (CET)",
            "by mail-pg1-x544.google.com with SMTP id w4so8349563pgg.13\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 11 Dec 2020 17:31:38 -0800 (PST)",
            "from hiroh.c.googlers.com.com\n\t(128.141.236.35.bc.googleusercontent.com. [35.236.141.128])\n\tby smtp.gmail.com with ESMTPSA id\n\tx188sm11558534pfd.43.2020.12.11.16.41.55\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 11 Dec 2020 16:41:56 -0800 (PST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"KwJFAE3M\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=yoK5XFHb4HhZWfB4dpOlsDWxHSKmTJdiIr+Nywe5htw=;\n\tb=KwJFAE3MNkZBphNYC87+9UbYty5mYeW5guqwgSKGoN85veVZZutgcGaYqpsRPd4J10\n\tY8HtYJqZZlRyODcip/tkhO564/uNnQAEfg11qIPDymVW2/V76945i0rfVF7ifoqpo1j1\n\t9b4QTr3ZHInCUhRPS4imDnsNufRo0DJBaVAe4=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=yoK5XFHb4HhZWfB4dpOlsDWxHSKmTJdiIr+Nywe5htw=;\n\tb=V7fDL6fK/I7XGgAknCNFMoXDfh0wb1CQt24htZGb8T9Yl8jePEgOZ2AUFYbtoH3AKb\n\t8/FC7dZR+1CUKWj4AulHoQiTf4sPfSUON/h08uc99MNnM4BU62hw9NrXFnXaiRH9f0IK\n\tG6owmu7GkY1maLRf+4cYgwM8upPO1XybUdPs6RJ5NQ2jiKv2LR7oV+S6a4zDHn9FZ8yp\n\td63ivJQ8FLcgCzq94fvSpXW1vBWqhHNFRKNKcaEgbRWIdeD+EHybugrQNa42bPHuop7s\n\t7RaBcsL58UBSk4XYdXzyOksO3+D1Vn1sU+RdT2apxfBWb6VPbCOG2104yPwYxtrN330Y\n\tsxpA==",
        "X-Gm-Message-State": "AOAM531Gqjz0ZeLbDceOIh2on837sEbx2EFoKC8bRZp/CMZ8zQAQdAHO\n\t8+X6crSErI9tb/RhVjGsyk8ylfoIVdptsl6R",
        "X-Google-Smtp-Source": "ABdhPJzfqWiocUIvj+eIeyWhRYWXBRLqNN27rsD410zi/YIv3vjD81Wf+LUbK+AdA++oOV7ujg4Srw==",
        "X-Received": "by 2002:a63:c04b:: with SMTP id\n\tz11mr13569054pgi.74.1607733717045; \n\tFri, 11 Dec 2020 16:41:57 -0800 (PST)",
        "From": "Hirokazu Honda <hiroh@chromium.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Sat, 12 Dec 2020 00:41:48 +0000",
        "Message-Id": "<20201212004149.158801-2-hiroh@chromium.org>",
        "X-Mailer": "git-send-email 2.29.2.576.ga3fc446d84-goog",
        "In-Reply-To": "<20201212004149.158801-1-hiroh@chromium.org>",
        "References": "<20201212004149.158801-1-hiroh@chromium.org>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v8 2/3] android: camera_device: Use\n\tCamera3StreamConfig in configureStreams()",
        "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": "Use the newly introduced Camera3StreamConfig to associate the\nAndroid requested streams with the associated StreamConfiguration\nin a vector of configurations.\n\nThis change prepares to sort the vector of configuration before using\nit to configure the Camera and populate the streams_ vector.\n\nNo functional changes intended.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Umang Jain <email@uajain.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/android/camera_device.cpp | 48 ++++++++++++++++++++---------------\n 1 file changed, 28 insertions(+), 20 deletions(-)\n\n--\n2.29.2.576.ga3fc446d84-goog",
    "diff": "diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex f4a6fb6b..7e8b2818 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -1264,6 +1264,9 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n \tstreams_.clear();\n \tstreams_.reserve(stream_list->num_streams);\n\n+\tstd::vector<Camera3StreamConfig> streamConfigs;\n+\tstreamConfigs.reserve(stream_list->num_streams);\n+\n \t/* First handle all non-MJPEG streams. */\n \tcamera3_stream_t *jpegStream = nullptr;\n \tfor (unsigned int i = 0; i < stream_list->num_streams; ++i) {\n@@ -1294,14 +1297,11 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n \t\t\tcontinue;\n \t\t}\n\n-\t\tStreamConfiguration streamConfiguration;\n-\t\tstreamConfiguration.size = size;\n-\t\tstreamConfiguration.pixelFormat = format;\n-\n-\t\tconfig_->addConfiguration(streamConfiguration);\n-\t\tstreams_.emplace_back(this, CameraStream::Type::Direct,\n-\t\t\t\t      stream, config_->size() - 1);\n-\t\tstream->priv = static_cast<void *>(&streams_.back());\n+\t\tCamera3StreamConfig streamConfig;\n+\t\tstreamConfig.streams = { { stream, CameraStream::Type::Direct } };\n+\t\tstreamConfig.config.size = size;\n+\t\tstreamConfig.config.pixelFormat = format;\n+\t\tstreamConfigs.push_back(std::move(streamConfig));\n \t}\n\n \t/* Now handle the MJPEG streams, adding a new stream if required. */\n@@ -1310,8 +1310,8 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n \t\tint index = -1;\n\n \t\t/* Search for a compatible stream in the non-JPEG ones. */\n-\t\tfor (unsigned int i = 0; i < config_->size(); i++) {\n-\t\t\tStreamConfiguration &cfg = config_->at(i);\n+\t\tfor (size_t i = 0; i < streamConfigs.size(); ++i) {\n+\t\t\tconst auto &cfg = streamConfigs[i].config;\n\n \t\t\t/*\n \t\t\t * \\todo The PixelFormat must also be compatible with\n@@ -1334,28 +1334,36 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n \t\t * introduce a new stream to satisfy the request requirements.\n \t\t */\n \t\tif (index < 0) {\n-\t\t\tStreamConfiguration streamConfiguration;\n-\n \t\t\t/*\n \t\t\t * \\todo The pixelFormat should be a 'best-fit' choice\n \t\t\t * and may require a validation cycle. This is not yet\n \t\t\t * handled, and should be considered as part of any\n \t\t\t * stream configuration reworks.\n \t\t\t */\n-\t\t\tstreamConfiguration.size.width = jpegStream->width;\n-\t\t\tstreamConfiguration.size.height = jpegStream->height;\n-\t\t\tstreamConfiguration.pixelFormat = formats::NV12;\n+\t\t\tCamera3StreamConfig streamConfig;\n+\t\t\tstreamConfig.config.size.width = jpegStream->width;\n+\t\t\tstreamConfig.config.size.height = jpegStream->height;\n+\t\t\tstreamConfig.config.pixelFormat = formats::NV12;\n+\t\t\tstreamConfigs.push_back(std::move(streamConfig));\n\n-\t\t\tLOG(HAL, Info) << \"Adding \" << streamConfiguration.toString()\n+\t\t\tLOG(HAL, Info) << \"Adding \" << streamConfig.config.toString()\n \t\t\t\t       << \" for MJPEG support\";\n\n \t\t\ttype = CameraStream::Type::Internal;\n-\t\t\tconfig_->addConfiguration(streamConfiguration);\n-\t\t\tindex = config_->size() - 1;\n+\t\t\tindex = streamConfigs.size() - 1;\n \t\t}\n\n-\t\tstreams_.emplace_back(this, type, jpegStream, index);\n-\t\tjpegStream->priv = static_cast<void *>(&streams_.back());\n+\t\tstreamConfigs[index].streams.push_back({ jpegStream, type });\n+\t}\n+\n+\tfor (const auto &streamConfig : streamConfigs) {\n+\t\tconfig_->addConfiguration(streamConfig.config);\n+\n+\t\tfor (auto &stream : streamConfig.streams) {\n+\t\t\tstreams_.emplace_back(this, stream.type, stream.stream,\n+\t\t\t\t\t      config_->size() - 1);\n+\t\t\tstream.stream->priv = static_cast<void *>(&streams_.back());\n+\t\t}\n \t}\n\n \tswitch (config_->validate()) {\n",
    "prefixes": [
        "libcamera-devel",
        "v8",
        "2/3"
    ]
}