Patch Detail
Show a patch.
GET /api/patches/11810/?format=api
{ "id": 11810, "url": "https://patchwork.libcamera.org/api/patches/11810/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11810/", "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": "<20210401101340.160590-5-paul.elder@ideasonboard.com>", "date": "2021-04-01T10:13:36", "name": "[libcamera-devel,RFC,4/8] android: camera_device: Set proper frame duration", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "8cf8891025fae442a52508641122a5203cb38f11", "submitter": { "id": 17, "url": "https://patchwork.libcamera.org/api/people/17/?format=api", "name": "Paul Elder", "email": "paul.elder@ideasonboard.com" }, "delegate": { "id": 17, "url": "https://patchwork.libcamera.org/api/users/17/?format=api", "username": "epaul", "first_name": "Paul", "last_name": "Elder", "email": "paul.elder@ideasonboard.com" }, "mbox": "https://patchwork.libcamera.org/patch/11810/mbox/", "series": [ { "id": 1878, "url": "https://patchwork.libcamera.org/api/series/1878/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1878", "date": "2021-04-01T10:13:32", "name": "android: First set of FULL fixes", "version": 1, "mbox": "https://patchwork.libcamera.org/series/1878/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/11810/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11810/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 6F655C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 1 Apr 2021 10:14:03 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 24DC268786;\n\tThu, 1 Apr 2021 12:14:03 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 42C7668782\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 1 Apr 2021 12:14:01 +0200 (CEST)", "from pyrite.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:2c71:1b79:d06d:5032])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id CF39CF7;\n\tThu, 1 Apr 2021 12:13:59 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"cZ26l7mh\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1617272041;\n\tbh=mDh8j51KePPsrpsOwTeVl4thnj9CV52Rc1z67ivFfBY=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=cZ26l7mhg0/KO6juZjD0olTwnP+wttS7/D8cAl2ea2262giHo7P2BJRd/mlFgwon/\n\tJ7CuQXWatV1uTqHNRwDIFwbtCPQRCSkRLexsiVbNOv6TVnWhxjhEGclUbcQKCmGomy\n\thxDIJL3qDdC0UQp0mqcBpbaFXx8cQdTOF4IPRYmU=", "From": "Paul Elder <paul.elder@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Thu, 1 Apr 2021 19:13:36 +0900", "Message-Id": "<20210401101340.160590-5-paul.elder@ideasonboard.com>", "X-Mailer": "git-send-email 2.27.0", "In-Reply-To": "<20210401101340.160590-1-paul.elder@ideasonboard.com>", "References": "<20210401101340.160590-1-paul.elder@ideasonboard.com>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [RFC PATCH 4/8] android: camera_device: Set\n\tproper frame duration", "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>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "CTS tests that the frame duration is for every frame (after the first 6)\nare within an the frame duration ranges that we provide in the static\nmetadata. One way it can do this, which it was doing previously, is to\ncalculate it based on the timestamps that we report for each capture\nresult. Another option is that we can report the frame duration\nourselves. The frame durations that we report can be more \"correct\", so\nuse this method to appease CTS.\n\nThis is part of the fix to allow the following CTS test to pass:\n- android.hardware.camera2.cts.CaptureRequestTest#testNoiseReductionModeControl\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n\n---\nThis probably isn't the right solution, but I can't seem to figure out\nwhat the correct route is.\n\nCTS checks if the frame duration that we report is within the frame\nduration range. The frame duration range comes from\nCONTROL_AE_AVAILABLE_TARGET_FPS_RANGES (where the frame duration is less\nthan or equal to 1e9/30). The frame duration for the current frame is\neither calculated by CTS by subtracting the SENSOR_TIMESTAMP of the\ncurrent frame from the one of the last frame (which is what we did\npreviously) or from what we report in SENSOR_FRAME_DURATION.\n\nThe issue is that the frame duration calculated by CTS is less than the\nminimum available frame duration that we report. So should we lower\nthat? Or report a different SENSOR_FRAME DURATION, if at all?\n---\n src/android/camera_device.cpp | 13 +++++++++++--\n src/android/camera_device.h | 2 ++\n 2 files changed, 13 insertions(+), 2 deletions(-)", "diff": "diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex ded57649..0dcfc880 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -311,7 +311,7 @@ CameraDevice::Camera3RequestDescriptor::~Camera3RequestDescriptor() = default;\n \n CameraDevice::CameraDevice(unsigned int id, std::shared_ptr<Camera> camera)\n \t: id_(id), running_(false), camera_(std::move(camera)),\n-\t facing_(CAMERA_FACING_FRONT), orientation_(0)\n+\t facing_(CAMERA_FACING_FRONT), orientation_(0), lastResultTimestamp_(0)\n {\n \tcamera_->requestCompleted.connect(this, &CameraDevice::requestComplete);\n \n@@ -1339,6 +1339,7 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()\n \t\tANDROID_REQUEST_PIPELINE_DEPTH,\n \t\tANDROID_SCALER_CROP_REGION,\n \t\tANDROID_SENSOR_EXPOSURE_TIME,\n+\t\tANDROID_SENSOR_FRAME_DURATION,\n \t\tANDROID_SENSOR_ROLLING_SHUTTER_SKEW,\n \t\tANDROID_SENSOR_TEST_PATTERN_MODE,\n \t\tANDROID_SENSOR_TIMESTAMP,\n@@ -1944,6 +1945,7 @@ void CameraDevice::requestComplete(Request *request)\n \t */\n \tuint64_t timestamp = buffers.begin()->second->metadata().timestamp;\n \tresultMetadata = getResultMetadata(*descriptor, timestamp);\n+\tlastResultTimestamp_ = timestamp;\n \n \t/* Handle any JPEG compression. */\n \tfor (camera3_stream_buffer_t &buffer : descriptor->buffers_) {\n@@ -2074,7 +2076,7 @@ CameraDevice::getResultMetadata(const Camera3RequestDescriptor &descriptor,\n \t * Total bytes for JPEG metadata: 82\n \t */\n \tstd::unique_ptr<CameraMetadata> resultMetadata =\n-\t\tstd::make_unique<CameraMetadata>(44, 166);\n+\t\tstd::make_unique<CameraMetadata>(45, 174);\n \tif (!resultMetadata->isValid()) {\n \t\tLOG(HAL, Error) << \"Failed to allocate result metadata\";\n \t\treturn nullptr;\n@@ -2197,6 +2199,13 @@ CameraDevice::getResultMetadata(const Camera3RequestDescriptor &descriptor,\n \tvalue = ANDROID_NOISE_REDUCTION_MODE_OFF;\n \tresultMetadata->addEntry(ANDROID_NOISE_REDUCTION_MODE, &value, 1);\n \n+\t/*\n+\t * \\todo Use sliding window average\n+\t * int64_t value64 = timestamp - lastResultTimestamp_;\n+\t */\n+\tint64_t value64 = 33333333;\n+\tresultMetadata->addEntry(ANDROID_SENSOR_FRAME_DURATION, &value64, 1);\n+\n \t/* 33.3 msec */\n \tconst int64_t rolling_shutter_skew = 33300000;\n \tresultMetadata->addEntry(ANDROID_SENSOR_ROLLING_SHUTTER_SKEW,\ndiff --git a/src/android/camera_device.h b/src/android/camera_device.h\nindex 388acf51..dc03a038 100644\n--- a/src/android/camera_device.h\n+++ b/src/android/camera_device.h\n@@ -131,6 +131,8 @@ private:\n \n \tunsigned int maxJpegBufferSize_;\n \n+\tint64_t lastResultTimestamp_;\n+\n \tCameraMetadata lastSettings_;\n };\n \n", "prefixes": [ "libcamera-devel", "RFC", "4/8" ] }