Show a patch.

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

{
    "id": 14150,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/14150/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/14150/",
    "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": "<20211014174208.50509-15-jacopo@jmondi.org>",
    "date": "2021-10-14T17:42:06",
    "name": "[libcamera-devel,v4,14/16] android: Populate streams and duration in the same loop",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "de70b861ca8b7d07c3c24836f79c283d018b3a69",
    "submitter": {
        "id": 3,
        "url": "https://patchwork.libcamera.org/api/1.1/people/3/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo@jmondi.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/14150/mbox/",
    "series": [
        {
            "id": 2628,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2628/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2628",
            "date": "2021-10-14T17:41:52",
            "name": "IPU3 control info update and HAL frame durations",
            "version": 4,
            "mbox": "https://patchwork.libcamera.org/series/2628/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/14150/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/14150/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 C22F3C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 14 Oct 2021 17:41:43 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A337268F64;\n\tThu, 14 Oct 2021 19:41:43 +0200 (CEST)",
            "from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net\n\t[217.70.183.199])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9E45568F6B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 14 Oct 2021 19:41:40 +0200 (CEST)",
            "(Authenticated sender: jacopo@jmondi.org)\n\tby relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 9C84CFF805;\n\tThu, 14 Oct 2021 17:41:39 +0000 (UTC)"
        ],
        "From": "Jacopo Mondi <jacopo@jmondi.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Thu, 14 Oct 2021 19:42:06 +0200",
        "Message-Id": "<20211014174208.50509-15-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.33.0",
        "In-Reply-To": "<20211014174208.50509-1-jacopo@jmondi.org>",
        "References": "<20211014174208.50509-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v4 14/16] android: Populate streams and\n\tduration in the same loop",
        "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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "The ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS and\nANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS static metadata are\npopulated by looping on the streamConfigurations_ vector.\n\nUnify them in a single loop to avoid repeating it.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/android/camera_capabilities.cpp | 22 +++++++++-------------\n 1 file changed, 9 insertions(+), 13 deletions(-)",
    "diff": "diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\nindex ebe51ef206dd..b7c3fdbd715d 100644\n--- a/src/android/camera_capabilities.cpp\n+++ b/src/android/camera_capabilities.cpp\n@@ -1277,7 +1277,9 @@ int CameraCapabilities::initializeStaticMetadata()\n \t\t\t\t  maxZoom);\n \n \tstd::vector<uint32_t> availableStreamConfigurations;\n+\tstd::vector<int64_t> minFrameDurations;\n \tavailableStreamConfigurations.reserve(streamConfigurations_.size() * 4);\n+\tminFrameDurations.reserve(streamConfigurations_.size() * 4);\n \tfor (const auto &entry : streamConfigurations_) {\n \t\t/*\n \t\t * Filter out YUV streams not capable of running at 30 FPS.\n@@ -1296,12 +1298,19 @@ int CameraCapabilities::initializeStaticMetadata()\n \t\tif (entry.androidFormat != HAL_PIXEL_FORMAT_BLOB && fps < 30)\n \t\t\tcontinue;\n \n+\t\t/* Stream configuration map. */\n \t\tavailableStreamConfigurations.push_back(entry.androidFormat);\n \t\tavailableStreamConfigurations.push_back(entry.resolution.width);\n \t\tavailableStreamConfigurations.push_back(entry.resolution.height);\n \t\tavailableStreamConfigurations.push_back(\n \t\t\tANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT);\n \n+\t\t/* Per-stream durations. */\n+\t\tminFrameDurations.push_back(entry.androidFormat);\n+\t\tminFrameDurations.push_back(entry.resolution.width);\n+\t\tminFrameDurations.push_back(entry.resolution.height);\n+\t\tminFrameDurations.push_back(entry.minFrameDurationNsec);\n+\n \t\tLOG(HAL, Debug)\n \t\t\t<< \"Output Stream: \" << utils::hex(entry.androidFormat)\n \t\t\t<< \" (\" << entry.resolution.toString() << \")[\"\n@@ -1311,19 +1320,6 @@ int CameraCapabilities::initializeStaticMetadata()\n \tstaticMetadata_->addEntry(ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS,\n \t\t\t\t  availableStreamConfigurations);\n \n-\tstd::vector<int64_t> minFrameDurations;\n-\tminFrameDurations.reserve(streamConfigurations_.size() * 4);\n-\tfor (const auto &entry : streamConfigurations_) {\n-\t\tunsigned int fps = static_cast<unsigned int>\n-\t\t\t\t   (floor(1e9 / entry.minFrameDurationNsec + 0.05f));\n-\t\tif (entry.androidFormat != HAL_PIXEL_FORMAT_BLOB && fps < 30)\n-\t\t\tcontinue;\n-\n-\t\tminFrameDurations.push_back(entry.androidFormat);\n-\t\tminFrameDurations.push_back(entry.resolution.width);\n-\t\tminFrameDurations.push_back(entry.resolution.height);\n-\t\tminFrameDurations.push_back(entry.minFrameDurationNsec);\n-\t}\n \tstaticMetadata_->addEntry(ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS,\n \t\t\t\t  minFrameDurations);\n \n",
    "prefixes": [
        "libcamera-devel",
        "v4",
        "14/16"
    ]
}