Patch Detail
Show a patch.
GET /api/patches/15728/?format=api
{ "id": 15728, "url": "https://patchwork.libcamera.org/api/patches/15728/?format=api", "web_url": "https://patchwork.libcamera.org/patch/15728/", "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": "<20220426114330.675768-1-hanlinchen@chromium.org>", "date": "2022-04-26T11:43:30", "name": "[libcamera-devel,v2] android: camera_capabilities: Adjust minimum frame duration to match FPS", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "501d837708fb05d57bf4a8ebac7e1b74f89510e4", "submitter": { "id": 98, "url": "https://patchwork.libcamera.org/api/people/98/?format=api", "name": "Hanlin Chen", "email": "hanlinchen@chromium.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/15728/mbox/", "series": [ { "id": 3073, "url": "https://patchwork.libcamera.org/api/series/3073/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3073", "date": "2022-04-26T11:43:30", "name": "[libcamera-devel,v2] android: camera_capabilities: Adjust minimum frame duration to match FPS", "version": 2, "mbox": "https://patchwork.libcamera.org/series/3073/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/15728/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/15728/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 2EB47C3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 26 Apr 2022 11:43:40 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9FF3B604A9;\n\tTue, 26 Apr 2022 13:43:39 +0200 (CEST)", "from mail-pf1-x436.google.com (mail-pf1-x436.google.com\n\t[IPv6:2607:f8b0:4864:20::436])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 20D9260431\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Apr 2022 13:43:38 +0200 (CEST)", "by mail-pf1-x436.google.com with SMTP id a11so6493962pff.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Apr 2022 04:43:38 -0700 (PDT)", "from localhost ([2401:fa00:1:17:255:33c4:eb32:373b])\n\tby smtp.gmail.com with UTF8SMTPSA id\n\th10-20020a056a001a4a00b004f7c76f29c3sm15436004pfv.24.2022.04.26.04.43.35\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tTue, 26 Apr 2022 04:43:36 -0700 (PDT)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1650973419;\n\tbh=AWrQNCirM/xZOf9NT5g+Vnj7pSNijjCIMer3vMRqzy8=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:From;\n\tb=kVq/9iiMuibAnLzwOwuwsQ4QVOMK5ME6ykhePDr0FCaHl03nW68osx1meI1W8K/3f\n\tNnS+P4392mySPLHd4Vc/s0M41N7EtAsXFdBMmg9Xsg7aoP496SK7Y7tF6Wp4BJlZVR\n\tOe0JUAsj7E6h/Qaq34EvOueUB9Qk6mQ3S44a0TSLa5ZK9QQKj9c4sDZDBe59KmSAd7\n\tONz3IqkKP9bRAPy2thI0H6a3cmqcPHE5PH/y7C4LCiX7cysG/UTWpb1dwDmvGSnx+d\n\tNJXAyH39K0oqfZH7mvMHoADI928Cb+0i9lS0BOCEimB447rstQUqsr4C4T+udI4rA/\n\tJqpymk4Q318kg==", "v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; h=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=glXOQ5MihTl6mbnTQP5NS6PzGkWKfJTdAq5aTZlWJ5I=;\n\tb=n4Mgzvn2uJba1etUbw4nBHmwMR6F/PfFhLq8pMinmCM6x/ul6vNd8ygRJTs+6ESJhT\n\tfwlnpLMZ3MSduiL8Q0lnellgqEDeEaK4lC7USam7LUugvI3V84JWA+5CovcP34VaEGAQ\n\tBw7LgclCkRl6Dnf8wmYsjWnsbtACSvMFR4MfE=" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=chromium.org\n\theader.i=@chromium.org header.b=\"n4Mgzvn2\"; \n\tdkim-atps=neutral", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=glXOQ5MihTl6mbnTQP5NS6PzGkWKfJTdAq5aTZlWJ5I=;\n\tb=bowPG/Y66tK09V0g3/hNmEs2OPkH4rcfXWsi4MZs3WcKjS6VqrXuZTCCRFowI1yh6T\n\tlEDpxYjsAyzXLwL1o7oSKxRuf8zY2udtizExyhLj9zjJ+ZV6crCaaoxD0aCA069hwOAk\n\tq/WKFkEXva5HuL7J+A9RRAjqiPqIQOcIGxA5Rp2vLrqmxHixbH1H2JrKS++gebsaWfx7\n\trFJbu8diDQ8Q2oK0in4ZmobaOsQK7b5623AaabdGsQ9iqsiZfKfvROtDI+rfAjXop5jI\n\ttsby06yNb7t0PbWGZdWgne7z0idB5ZQp5SO5s8A+X7FDZJ1jd7ln0jHuAreQOpzYDoo8\n\twWyg==", "X-Gm-Message-State": "AOAM532uheKsVFH71Dgrm7vFQofnM9t+bfzbbIhdpFv6PfBr2bs8RVVa\n\tmkVHqbbw8N05LSmGOEXDANpZuESnytQE6g==", "X-Google-Smtp-Source": "ABdhPJzgFmkGTx1T35nHQ8VcqG2lu0SngDnuzvTI4d1+aCfEWP0ixpixe0XTVgwFiZ4eVScdlEfXGw==", "X-Received": "by 2002:a63:6b09:0:b0:3aa:c8d7:4c67 with SMTP id\n\tg9-20020a636b09000000b003aac8d74c67mr17668498pgc.600.1650973416454; \n\tTue, 26 Apr 2022 04:43:36 -0700 (PDT)", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 26 Apr 2022 19:43:30 +0800", "Message-Id": "<20220426114330.675768-1-hanlinchen@chromium.org>", "X-Mailer": "git-send-email 2.36.0.rc2.479.g8af0fa9b8e-goog", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v2] android: camera_capabilities: Adjust\n\tminimum frame duration to match FPS", "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>", "From": "Han-Lin Chen via libcamera-devel <libcamera-devel@lists.libcamera.org>", "Reply-To": "Han-Lin Chen <hanlinchen@chromium.org>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "CTS calculates FPS with a rounding formula: See\nCamera2SurfaceViewTestCase.java:getSuitableFpsRangeForDuration()\n\nfps = floor(1e9 / minFrameDuration + 0.05f)\n\nThe android adapter reports it as the AE target FPS. The patch adjusts the\nreported minimum frame duration to match the reported FPS.\n\nThe requirement comes from ChromeOS which only allows the stream configuration\nwith the minimum frame duration achieves the target FPS.\n\nSigned-off-by: Han-Lin Chen <hanlinchen@chromium.org>\n---\n src/android/camera_capabilities.cpp | 23 ++++++++++++++++++-----\n 1 file changed, 18 insertions(+), 5 deletions(-)", "diff": "diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\nindex 55d651f3..5242055c 100644\n--- a/src/android/camera_capabilities.cpp\n+++ b/src/android/camera_capabilities.cpp\n@@ -687,6 +687,21 @@ int CameraCapabilities::initializeStreamConfigurations()\n \t\t\t\t\tminFrameDuration = minFrameDurationCap;\n \t\t\t}\n \n+\t\t\t/*\n+\t\t\t * Calculate FPS as CTS does: see\n+\t\t\t * Camera2SurfaceViewTestCase.java:getSuitableFpsRangeForDuration()\n+\t\t\t */\n+\t\t\tunsigned int fps =\n+\t\t\t\tstatic_cast<unsigned int>(floor(1e9 / minFrameDuration + 0.05f));\n+\n+\t\t\t/*\n+\t\t\t * Adjust the minimum frame duration to match the\n+\t\t\t * calculated FPS.The requirement comes from ChromeOS\n+\t\t\t * which only allows the stream configuration with the\n+\t\t\t * minimum frame duration achieves the target FPS.\n+\t\t\t */\n+\t\t\tminFrameDuration = 1e9 / fps;\n+\n \t\t\tstreamConfigurations_.push_back({\n \t\t\t\tres, androidFormat, minFrameDuration, maxFrameDuration,\n \t\t\t});\n@@ -1287,12 +1302,10 @@ int CameraCapabilities::initializeStaticMetadata()\n \t\t * recording profile. Inspecting the Intel IPU3 HAL\n \t\t * implementation confirms this but no reference has been found\n \t\t * in the metadata documentation.\n-\t\t *\n-\t\t * Calculate FPS as CTS does: see\n-\t\t * Camera2SurfaceViewTestCase.java:getSuitableFpsRangeForDuration()\n \t\t */\n-\t\tunsigned int fps = static_cast<unsigned int>\n-\t\t\t\t (floor(1e9 / entry.minFrameDurationNsec + 0.05f));\n+\t\tunsigned int fps =\n+\t\t\tstatic_cast<unsigned int>(floor(1e9 / entry.minFrameDurationNsec));\n+\n \t\tif (entry.androidFormat != HAL_PIXEL_FORMAT_BLOB && fps < 30)\n \t\t\tcontinue;\n \n", "prefixes": [ "libcamera-devel", "v2" ] }