Show a patch.

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

{
    "id": 10640,
    "url": "https://patchwork.libcamera.org/api/patches/10640/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/10640/",
    "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": "<20201211060315.2637333-2-hiroh@chromium.org>",
    "date": "2020-12-11T06:03:14",
    "name": "[libcamera-devel,v6,2/3] android: camera_device: Use Camera3StreamConfig in configureStreams()",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "caaa5ac559898dbc8c62cb4a63c4dbba79512b94",
    "submitter": {
        "id": 63,
        "url": "https://patchwork.libcamera.org/api/people/63/?format=api",
        "name": "Hirokazu Honda",
        "email": "hiroh@chromium.org"
    },
    "delegate": {
        "id": 15,
        "url": "https://patchwork.libcamera.org/api/users/15/?format=api",
        "username": "jmondi",
        "first_name": "Jacopo",
        "last_name": "Mondi",
        "email": "jacopo@jmondi.org"
    },
    "mbox": "https://patchwork.libcamera.org/patch/10640/mbox/",
    "series": [
        {
            "id": 1524,
            "url": "https://patchwork.libcamera.org/api/series/1524/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1524",
            "date": "2020-12-11T06:03:13",
            "name": "[libcamera-devel,v6,1/3] android: camera_device: Introduce Camera3StreamConfig",
            "version": 6,
            "mbox": "https://patchwork.libcamera.org/series/1524/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/10640/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/10640/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 84DB1BD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 11 Dec 2020 06:03:27 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 537FB67E4D;\n\tFri, 11 Dec 2020 07:03:27 +0100 (CET)",
            "from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com\n\t[IPv6:2607:f8b0:4864:20::1044])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 665FF6346D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 11 Dec 2020 07:03:26 +0100 (CET)",
            "by mail-pj1-x1044.google.com with SMTP id j13so1792496pjz.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 10 Dec 2020 22:03:26 -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\tm77sm9207503pfd.105.2020.12.10.22.03.22\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 10 Dec 2020 22:03:23 -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=\"PkiZ/00t\"; 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=NGAC1T7SVkfHxXdFPBDLMTozdyzAw8HtVP7RP2f4nSI=;\n\tb=PkiZ/00tPmYyMVQBi8uK/a5uyNf5N3b799ACMuTE3KbU8+3jZEszUZVkFK5BW+gwWn\n\tcvV19MBBnqj2rDDLCghm/GFaffBl2c07S8Zb3RZ081IczP/GZ+FAvE23GoBghykJAQDT\n\t4LYr6GnfHuBmtwVsFArxIhPabbj3+5Q/gofGo=",
        "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=NGAC1T7SVkfHxXdFPBDLMTozdyzAw8HtVP7RP2f4nSI=;\n\tb=mxIxdFS6p884XwWNqYJc39qxVd4+0/c29JHUSGOv2gfNZfsAmbVPO0fY6LH58o/lk8\n\tPoX086qRbfhnqw9fvYYtAIy36YXAoy2EDbK514hotUID6iOdp7BD2sxCC7p++GMT6YT6\n\t4kBaqYeEd2hKFekgxJTmvCpFCis57wQ2qArX4rlWorvnqAZ/KqwvuaGS7oW41qQNZ4TM\n\tkxsPpBTG4UgdBOTjNtpDX8hPkrf9+gGd7AWQjpcookoZHTtoTaT9PfDmvQi0Rvie//YG\n\taPeXWt+5+lEd3+N2OYWHCFFVhThiFikLkKjPnV+Byi0ZxzJ1uZVZSGcEdJpg28OAwBET\n\tKfjQ==",
        "X-Gm-Message-State": "AOAM531//xmN95X1RBtVUFidXNU0ETW4R2h+LsWuDD8052l1Zbgmzx4u\n\tg9fpE9qyLQXe+ttVUid9wcjg6t7MjE3lE1J3",
        "X-Google-Smtp-Source": "ABdhPJxlcjgoO0dysUQa0erUvUBcmdZS5MbwXOYCBeN5FiqqXzWFZUsv0GWrvIfzu/j77EA11c3sCQ==",
        "X-Received": "by 2002:a17:90a:2a83:: with SMTP id\n\tj3mr11767822pjd.84.1607666604533; \n\tThu, 10 Dec 2020 22:03:24 -0800 (PST)",
        "From": "Hirokazu Honda <hiroh@chromium.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri, 11 Dec 2020 06:03:14 +0000",
        "Message-Id": "<20201211060315.2637333-2-hiroh@chromium.org>",
        "X-Mailer": "git-send-email 2.29.2.576.ga3fc446d84-goog",
        "In-Reply-To": "<20201211060315.2637333-1-hiroh@chromium.org>",
        "References": "<20201211060315.2637333-1-hiroh@chromium.org>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v6 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 58ff329c..5e245298 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",
        "v6",
        "2/3"
    ]
}