{"id":15352,"url":"https://patchwork.libcamera.org/api/patches/15352/?format=json","web_url":"https://patchwork.libcamera.org/patch/15352/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20220209071917.559993-10-hanlinchen@chromium.org>","date":"2022-02-09T07:19:17","name":"[libcamera-devel,9/9] android: Elevate min duration to 30 FPS if it's lower within 2%","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"c78941580ba287fb99c72a170ff57fbd6d86f295","submitter":{"id":98,"url":"https://patchwork.libcamera.org/api/people/98/?format=json","name":"Hanlin Chen","email":"hanlinchen@chromium.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/15352/mbox/","series":[{"id":2923,"url":"https://patchwork.libcamera.org/api/series/2923/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2923","date":"2022-02-09T07:19:08","name":"Introduce Pipeline configuration preference for IPU3","version":1,"mbox":"https://patchwork.libcamera.org/series/2923/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/15352/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/15352/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 2A5F8C3263\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  9 Feb 2022 07:19:57 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E7E7E610FA;\n\tWed,  9 Feb 2022 08:19:45 +0100 (CET)","from mail-pl1-x636.google.com (mail-pl1-x636.google.com\n\t[IPv6:2607:f8b0:4864:20::636])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4C49D610EB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  9 Feb 2022 08:19:44 +0100 (CET)","by mail-pl1-x636.google.com with SMTP id x4so1478953plb.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 08 Feb 2022 23:19:44 -0800 (PST)","from localhost ([2401:fa00:1:10:a5cf:9a43:1c6d:824])\n\tby smtp.gmail.com with UTF8SMTPSA id\n\tk16sm12562724pgh.45.2022.02.08.23.19.41\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tTue, 08 Feb 2022 23:19:42 -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=\"NWnxySjH\"; 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=Xt4lfOQkowpQXAH73t5mp6GGmsHlhDFYyEAO6kd44jw=;\n\tb=NWnxySjHAJucfSDM8cwryoE6s3y8rS8NfNIwN2UyE2r4vg+LkyQCXrP2izT741vtnG\n\tZDnr6UA3WtZ/8RzqQdSSylVa+5WgDcRaBewYJIv0UToIEnELGps4aKmMkMiS6k3b2AtT\n\tWsJWne9cKpdPIDlnMR3OtQHtS4jjipmxFliP8=","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:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=Xt4lfOQkowpQXAH73t5mp6GGmsHlhDFYyEAO6kd44jw=;\n\tb=AokOVHA1/Hf8eKY7gIYgR9ucQtfOBKOdLp0AyBMCoE+LCpxRvNXymoFAenWZzadKmO\n\tAdDgUIP6T5pHsPafTSyUX0F0euFwynKH7b/KDozMi7J03q2HbSIT3jxI3CSQdxeNkPEB\n\tVtI5XseOnTjqtb4apCZ0jBjGQdm8JXNXpw+AgwOLkC9nyXsnwi9t3shCR3RvaQZiQMlM\n\t4jAGBRK/YmOJP0KdTMAXm+XzZlYYqSUjNgX3qSYWaUM4xAgd50Q5zRr7yIrDHRnJ2Hbk\n\tNpFK917107+V163Xm+9Ydm6qrvuYwaW727duy/7UHBEcIFjWyz4pFPfD2mb0x2uW38gf\n\tJmWg==","X-Gm-Message-State":"AOAM532YkO2d6eNiHyNPedIMJo/z18iaqrmtFXQJNwPXRE8d8T1LvmUs\n\tBcpKI1zGcFfhgWwejLjXe8paXuGl4+Nwlw==","X-Google-Smtp-Source":"ABdhPJz87QWNvko2IRU+AgRe2OkTsd6kMAambt90bk2CEQp6d/kyLP/PT/36vd6FU7tbumvFWzAF6g==","X-Received":"by 2002:a17:903:2d2:: with SMTP id\n\ts18mr1139085plk.56.1644391182728; \n\tTue, 08 Feb 2022 23:19:42 -0800 (PST)","From":"Han-Lin Chen <hanlinchen@chromium.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Wed,  9 Feb 2022 15:19:17 +0800","Message-Id":"<20220209071917.559993-10-hanlinchen@chromium.org>","X-Mailer":"git-send-email 2.35.0.263.gb82422642f-goog","In-Reply-To":"<20220209071917.559993-1-hanlinchen@chromium.org>","References":"<20220209071917.559993-1-hanlinchen@chromium.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 9/9] android: Elevate min duration to 30\n\tFPS if it's lower within 2%","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":"It's notice that Chrome Camera App filters out the resolutions which cannot\nachieve 30 FPS. Elevate the minimum frame duration to 30 FPS if FPS is lower\nwithin 2%.\n\nSigned-off-by: Han-Lin Chen <hanlinchen@chromium.org>\n---\n src/android/camera_capabilities.cpp | 31 +++++++++++++++++++----------\n 1 file changed, 20 insertions(+), 11 deletions(-)","diff":"diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\nindex 55d651f3..e10ab036 100644\n--- a/src/android/camera_capabilities.cpp\n+++ b/src/android/camera_capabilities.cpp\n@@ -655,7 +655,9 @@ int CameraCapabilities::initializeStreamConfigurations()\n \t\t\tint64_t maxFrameDuration = frameDurations->second.max().get<int64_t>() * 1000;\n \n \t\t\t/*\n-\t\t\t * Cap min frame duration to 30 FPS with 1% tolerance.\n+\t\t\t * Cap min frame duration to 30 FPS with 1% tolerance,\n+\t\t\t * and elevate min frame duration to 30 FPS with 2%\n+\t\t\t * tolerance.\n \t\t\t *\n \t\t\t * 30 frames per second has been validated as the most\n \t\t\t * opportune frame rate for quality tuning, and power\n@@ -675,17 +677,24 @@ int CameraCapabilities::initializeStreamConfigurations()\n \t\t\t * to the in-development configuration API rework.\n \t\t\t */\n \t\t\tint64_t minFrameDurationCap = 1e9 / 30.0;\n-\t\t\tif (minFrameDuration < minFrameDurationCap) {\n-\t\t\t\tfloat tolerance =\n-\t\t\t\t\t(minFrameDurationCap - minFrameDuration) * 100.0 / minFrameDurationCap;\n+\t\t\tfloat tolerance =\n+\t\t\t\t(minFrameDurationCap - minFrameDuration) * 100.0 / minFrameDurationCap;\n \n-\t\t\t\t/*\n-\t\t\t\t * If the tolerance is less than 1%, do not cap\n-\t\t\t\t * the frame duration.\n-\t\t\t\t */\n-\t\t\t\tif (tolerance > 1.0)\n-\t\t\t\t\tminFrameDuration = minFrameDurationCap;\n-\t\t\t}\n+\t\t\t/*\n+\t\t\t * If the tolerance is less than 1%, do not cap\n+\t\t\t * the frame duration.\n+\t\t\t */\n+\t\t\tif (tolerance > 1.0)\n+\t\t\t\tminFrameDuration = minFrameDurationCap;\n+\n+\t\t\t/*\n+\t\t\t * Some applications, ex: Chrome Camera App filters out\n+\t\t\t * the resolutions which cannot achieve 30 FPS. Elevate\n+\t\t\t * the minimum frame duration to 30 FPS if FPS is lower\n+\t\t\t * within 2%.\n+\t\t\t */\n+\t\t\tif (tolerance < 0 && tolerance > -2.0)\n+\t\t\t\tminFrameDuration = minFrameDurationCap;\n \n \t\t\tstreamConfigurations_.push_back({\n \t\t\t\tres, androidFormat, minFrameDuration, maxFrameDuration,\n","prefixes":["libcamera-devel","9/9"]}