Show a patch.

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

{
    "id": 14092,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/14092/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/14092/",
    "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": "<20211011151154.72856-9-jacopo@jmondi.org>",
    "date": "2021-10-11T15:11:46",
    "name": "[libcamera-devel,v3,08/16] android: capabilties: Assume controls::FrameDurationLimits is supported",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "7c97eaad69523db68c978614e63ec3a2fdc114e6",
    "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/14092/mbox/",
    "series": [
        {
            "id": 2613,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2613/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2613",
            "date": "2021-10-11T15:11:38",
            "name": "IPU3 control info update and HAL frame durations",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/2613/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/14092/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/14092/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 6C4FAC323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 11 Oct 2021 15:11:21 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 39AE368F50;\n\tMon, 11 Oct 2021 17:11:21 +0200 (CEST)",
            "from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net\n\t[217.70.183.196])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 960EC68F5B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 11 Oct 2021 17:11:18 +0200 (CEST)",
            "(Authenticated sender: jacopo@jmondi.org)\n\tby relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 844E5E000D;\n\tMon, 11 Oct 2021 15:11:17 +0000 (UTC)"
        ],
        "From": "Jacopo Mondi <jacopo@jmondi.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon, 11 Oct 2021 17:11:46 +0200",
        "Message-Id": "<20211011151154.72856-9-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.33.0",
        "In-Reply-To": "<20211011151154.72856-1-jacopo@jmondi.org>",
        "References": "<20211011151154.72856-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v3 08/16] android: capabilties: Assume\n\tcontrols::FrameDurationLimits is supported",
        "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": "As we now collect the per-stream frame durations at\ninitializeStreamConfigurations() times, the Camera is now guaranteed to\nsupport the controls::FrameDurationLimits control.\n\nRemove the check for its presence when populating the\nANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES static metadata.\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 | 85 ++++++++++++++---------------\n 1 file changed, 41 insertions(+), 44 deletions(-)",
    "diff": "diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\nindex b69c9f1025b7..a8eec2a77a7b 100644\n--- a/src/android/camera_capabilities.cpp\n+++ b/src/android/camera_capabilities.cpp\n@@ -871,55 +871,52 @@ int CameraCapabilities::initializeStaticMetadata()\n \tstaticMetadata_->addEntry(ANDROID_CONTROL_AE_AVAILABLE_MODES,\n \t\t\t\t  aeAvailableModes);\n \n-\tint64_t minFrameDurationNsec = -1;\n-\tint64_t maxFrameDurationNsec = -1;\n+\t/* Initialize the AE frame duration limits. */\n \tconst auto frameDurationsInfo = controlsInfo.find(&controls::FrameDurationLimits);\n-\tif (frameDurationsInfo != controlsInfo.end()) {\n-\t\tminFrameDurationNsec = frameDurationsInfo->second.min().get<int64_t>() * 1000;\n-\t\tmaxFrameDurationNsec = frameDurationsInfo->second.max().get<int64_t>() * 1000;\n+\tint64_t minFrameDurationNsec = frameDurationsInfo->second.min().get<int64_t>() * 1000;\n+\tint64_t maxFrameDurationNsec = frameDurationsInfo->second.max().get<int64_t>() * 1000;\n \n-\t\t/*\n-\t\t * Adjust the minimum frame duration to comply with Android\n-\t\t * requirements. The camera service mandates all preview/record\n-\t\t * streams to have a minimum frame duration < 33,366 milliseconds\n-\t\t * (see MAX_PREVIEW_RECORD_DURATION_NS in the camera service\n-\t\t * implementation).\n-\t\t *\n-\t\t * If we're close enough (+ 500 useconds) to that value, round\n-\t\t * the minimum frame duration of the camera to an accepted\n-\t\t * value.\n-\t\t */\n-\t\tstatic constexpr int64_t MAX_PREVIEW_RECORD_DURATION_NS = 1e9 / 29.97;\n-\t\tif (minFrameDurationNsec > MAX_PREVIEW_RECORD_DURATION_NS &&\n-\t\t    minFrameDurationNsec < MAX_PREVIEW_RECORD_DURATION_NS + 500000)\n-\t\t\tminFrameDurationNsec = MAX_PREVIEW_RECORD_DURATION_NS - 1000;\n+\t/*\n+\t * Adjust the minimum frame duration to comply with Android\n+\t * requirements. The camera service mandates all preview/record\n+\t * streams to have a minimum frame duration < 33,366 milliseconds\n+\t * (see MAX_PREVIEW_RECORD_DURATION_NS in the camera service\n+\t * implementation).\n+\t *\n+\t * If we're close enough (+ 500 useconds) to that value, round\n+\t * the minimum frame duration of the camera to an accepted\n+\t * value.\n+\t */\n+\tstatic constexpr int64_t MAX_PREVIEW_RECORD_DURATION_NS = 1e9 / 29.97;\n+\tif (minFrameDurationNsec > MAX_PREVIEW_RECORD_DURATION_NS &&\n+\t    minFrameDurationNsec < MAX_PREVIEW_RECORD_DURATION_NS + 500000)\n+\t\tminFrameDurationNsec = MAX_PREVIEW_RECORD_DURATION_NS - 1000;\n \n-\t\t/*\n-\t\t * The AE routine frame rate limits are computed using the frame\n-\t\t * duration limits, as libcamera clips the AE routine to the\n-\t\t * frame durations.\n-\t\t */\n-\t\tint32_t maxFps = std::round(1e9 / minFrameDurationNsec);\n-\t\tint32_t minFps = std::round(1e9 / maxFrameDurationNsec);\n-\t\tminFps = std::max(1, minFps);\n+\t/*\n+\t * The AE routine frame rate limits are computed using the frame\n+\t * duration limits, as libcamera clips the AE routine to the\n+\t * frame durations.\n+\t */\n+\tint32_t maxFps = std::round(1e9 / minFrameDurationNsec);\n+\tint32_t minFps = std::round(1e9 / maxFrameDurationNsec);\n+\tminFps = std::max(1, minFps);\n \n-\t\t/*\n-\t\t * Force rounding errors so that we have the proper frame\n-\t\t * durations for when we reuse these variables later\n-\t\t */\n-\t\tminFrameDurationNsec = 1e9 / maxFps;\n-\t\tmaxFrameDurationNsec = 1e9 / minFps;\n+\t/*\n+\t * Force rounding errors so that we have the proper frame\n+\t * durations for when we reuse these variables later\n+\t */\n+\tminFrameDurationNsec = 1e9 / maxFps;\n+\tmaxFrameDurationNsec = 1e9 / minFps;\n \n-\t\t/*\n-\t\t * Register to the camera service {min, max} and {max, max}\n-\t\t * intervals as requested by the metadata documentation.\n-\t\t */\n-\t\tint32_t availableAeFpsTarget[] = {\n-\t\t\tminFps, maxFps, maxFps, maxFps\n-\t\t};\n-\t\tstaticMetadata_->addEntry(ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES,\n-\t\t\t\t\t  availableAeFpsTarget);\n-\t}\n+\t/*\n+\t * Register to the camera service {min, max} and {max, max}\n+\t * intervals as requested by the metadata documentation.\n+\t */\n+\tint32_t availableAeFpsTarget[] = {\n+\t\tminFps, maxFps, maxFps, maxFps\n+\t};\n+\tstaticMetadata_->addEntry(ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES,\n+\t\t\t\t  availableAeFpsTarget);\n \n \tstd::vector<int32_t> aeCompensationRange = {\n \t\t0, 0,\n",
    "prefixes": [
        "libcamera-devel",
        "v3",
        "08/16"
    ]
}