Patch Detail
Show a patch.
GET /api/1.1/patches/13738/?format=api
{ "id": 13738, "url": "https://patchwork.libcamera.org/api/1.1/patches/13738/?format=api", "web_url": "https://patchwork.libcamera.org/patch/13738/", "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": "<20210907194107.803730-8-jacopo@jmondi.org>", "date": "2021-09-07T19:40:57", "name": "[libcamera-devel,v2,07/17] 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/13738/mbox/", "series": [ { "id": 2492, "url": "https://patchwork.libcamera.org/api/1.1/series/2492/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2492", "date": "2021-09-07T19:40:50", "name": "IPU3 control info update and HAL frame durations", "version": 2, "mbox": "https://patchwork.libcamera.org/series/2492/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/13738/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/13738/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 E33A0BDB1D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 7 Sep 2021 19:40:37 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id ADEE869187;\n\tTue, 7 Sep 2021 21:40:37 +0200 (CEST)", "from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net\n\t[217.70.183.193])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0E3B169173\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 7 Sep 2021 21:40:34 +0200 (CEST)", "(Authenticated sender: jacopo@jmondi.org)\n\tby relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 3C825240004;\n\tTue, 7 Sep 2021 19:40:33 +0000 (UTC)" ], "From": "Jacopo Mondi <jacopo@jmondi.org>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 7 Sep 2021 21:40:57 +0200", "Message-Id": "<20210907194107.803730-8-jacopo@jmondi.org>", "X-Mailer": "git-send-email 2.32.0", "In-Reply-To": "<20210907194107.803730-1-jacopo@jmondi.org>", "References": "<20210907194107.803730-1-jacopo@jmondi.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v2 07/17] 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>\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 9bfc7ebc6334..ee2883ab2821 100644\n--- a/src/android/camera_capabilities.cpp\n+++ b/src/android/camera_capabilities.cpp\n@@ -862,55 +862,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", "v2", "07/17" ] }