Show a patch.

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

{
    "id": 10591,
    "url": "https://patchwork.libcamera.org/api/patches/10591/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/10591/",
    "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": "<20201207084218.2307410-2-hiroh@chromium.org>",
    "date": "2020-12-07T08:42:17",
    "name": "[libcamera-devel,v3,2/3] android: camera_device: Use Camera3StreamConfig in configureStreams()",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "90ae78b004a212285a438d1a67d604908e283882",
    "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/10591/mbox/",
    "series": [
        {
            "id": 1508,
            "url": "https://patchwork.libcamera.org/api/series/1508/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1508",
            "date": "2020-12-07T08:42:16",
            "name": "[libcamera-devel,v3,1/3] android: camera_device: Introduce Camera3StreamConfig",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/1508/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/10591/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/10591/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 CCBCDBDB1F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  7 Dec 2020 10:46:30 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7F49A67E16;\n\tMon,  7 Dec 2020 11:46:30 +0100 (CET)",
            "from mail-oi1-x241.google.com (mail-oi1-x241.google.com\n\t[IPv6:2607:f8b0:4864:20::241])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EB5F967E12\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  7 Dec 2020 11:46:28 +0100 (CET)",
            "by mail-oi1-x241.google.com with SMTP id s75so11837019oih.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 07 Dec 2020 02:46:28 -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\t22sm12772144pfn.190.2020.12.07.00.42.32\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 07 Dec 2020 00:42:33 -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=\"LhV6aHDd\"; 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=XCfAms3h7myBvNieIr+PFbFvvDNnue+uTz5FCau7AXY=;\n\tb=LhV6aHDdp2sJw9gJRxKrdWQZV7CafCE9IjlCHWDwfPQZhAQCUF8bnda+SIbsF/HuZb\n\t3MUmu6fEUrFTVEyb3xdAmt5wcB05NyU1VlUAVSaBArn9emUuG+Zpot5h2rfkaQ/Xtk1K\n\tZXNdMvcUbqA0ElLC9kPJ4/kVVfmA26yjuFhGk=",
        "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=XCfAms3h7myBvNieIr+PFbFvvDNnue+uTz5FCau7AXY=;\n\tb=rtMKGtGBb5SjqQ2ODu3DFkbF9XKnAfqcY503k3YGnVIn1x61VYHoyajuyAHMhJeBas\n\tmJuK1soVvNaaQQ+eI3iwue2YqATPLq3LSE28aiCDGUHjGySHbG8fpDEHHZoAXGc4b1xD\n\tNk7m+Gbnlq5yrrbBbemZZhBwpMyQ33JOkOqOoc2zjByHQVZpL/n3x9PDMJ8zHUsUruW6\n\t1jJ0ND4cB3m+iUgcVXjUDDp/fl02DCnyvkhk8I91h3IQyojudyece1bkbEpfiyfsNaJx\n\tYfJOZ8ScoyQUBMZmFwkMt5CNfv29t/ayW1/xaK2GVo6Fh7rGdNXgZRU03NYzUqfqcYuX\n\tdbSA==",
        "X-Gm-Message-State": "AOAM530eQXG8zoOWphWjtck5AlFGLKo4Lxc4CiwsdiSnNuRwt9+/sc8+\n\t5yGXOn4+tJFnk3SyLq66TnfVOSX0x6pYRqTbTfc=",
        "X-Google-Smtp-Source": "ABdhPJy+WtawKqbAPa8CyMyimbdNuv7Tjn4EMPabU6TUVI6jsXsn6bwv/5WcSpLN22fqfuvTbO4oyQ==",
        "X-Received": "by 2002:a17:90a:882:: with SMTP id\n\tv2mr15783359pjc.36.1607330553681; \n\tMon, 07 Dec 2020 00:42:33 -0800 (PST)",
        "From": "Hirokazu Honda <hiroh@chromium.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon,  7 Dec 2020 08:42:17 +0000",
        "Message-Id": "<20201207084218.2307410-2-hiroh@chromium.org>",
        "X-Mailer": "git-send-email 2.29.2.576.ga3fc446d84-goog",
        "In-Reply-To": "<20201207084218.2307410-1-hiroh@chromium.org>",
        "References": "<20201207084218.2307410-1-hiroh@chromium.org>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v3 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": "This uses Camera3StreamConfig in CameraDevice::configureStreams().\n---\n src/android/camera_device.cpp | 52 +++++++++++++++++++++--------------\n 1 file changed, 31 insertions(+), 21 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 09269d95..b7bf3d88 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -1240,6 +1240,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@@ -1270,14 +1273,12 @@ 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 };\n+\t\tstreamConfig.types = { 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@@ -1286,9 +1287,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-\n+\t\tfor (size_t i = 0; i < streamConfigs.size(); ++i) {\n+\t\t\tconst auto &cfg = streamConfigs[i].config;\n \t\t\t/*\n \t\t\t * \\todo The PixelFormat must also be compatible with\n \t\t\t * the encoder.\n@@ -1310,28 +1310,38 @@ 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);\n+\t\tstreamConfigs[index].types.push_back(type);\n+\t}\n+\n+\tfor (const auto &streamConfig : streamConfigs) {\n+\t\tconfig_->addConfiguration(streamConfig.config);\n+\t\tfor (size_t i = 0; i < streamConfig.streams.size(); ++i) {\n+\t\t\tcamera3_stream_t *stream = streamConfig.streams[i];\n+\t\t\tconst CameraStream::Type type = streamConfig.types[i];\n+\t\t\tstreams_.emplace_back(this, type,\n+\t\t\t\t\t      stream, config_->size() - 1);\n+\t\t\tstream->priv = static_cast<void*>(&streams_.back());\n+\t\t}\n \t}\n\n \tswitch (config_->validate()) {\n",
    "prefixes": [
        "libcamera-devel",
        "v3",
        "2/3"
    ]
}