Patch Detail
Show a patch.
GET /api/patches/22117/?format=api
{ "id": 22117, "url": "https://patchwork.libcamera.org/api/patches/22117/?format=api", "web_url": "https://patchwork.libcamera.org/patch/22117/", "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": "<20241127092632.3145984-7-chenghaoyang@chromium.org>", "date": "2024-11-27T09:25:56", "name": "[v2,6/9] android: Cleanup CAMERA3_MSG_ERROR_REQUEST", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "29934104980e95c79bea00d58832c655f6761823", "submitter": { "id": 117, "url": "https://patchwork.libcamera.org/api/people/117/?format=api", "name": "Cheng-Hao Yang", "email": "chenghaoyang@chromium.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/22117/mbox/", "series": [ { "id": 4828, "url": "https://patchwork.libcamera.org/api/series/4828/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4828", "date": "2024-11-27T09:25:50", "name": "Signal metadataAvailable and Android partial result", "version": 2, "mbox": "https://patchwork.libcamera.org/series/4828/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/22117/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/22117/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 43C61C3213\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 27 Nov 2024 09:26:57 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 924A6660B9;\n\tWed, 27 Nov 2024 10:26:56 +0100 (CET)", "from mail-ot1-x334.google.com (mail-ot1-x334.google.com\n\t[IPv6:2607:f8b0:4864:20::334])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 314D3660C7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Nov 2024 10:26:48 +0100 (CET)", "by mail-ot1-x334.google.com with SMTP id\n\t46e09a7af769-71d4d0516e6so1696532a34.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Nov 2024 01:26:48 -0800 (PST)", "from chenghaoyang-low.c.googlers.com.com\n\t(27.247.221.35.bc.googleusercontent.com. [35.221.247.27])\n\tby smtp.gmail.com with ESMTPSA id\n\t41be03b00d2f7-7fbcbfc41f9sm8693027a12.8.2024.11.27.01.26.45\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 27 Nov 2024 01:26:46 -0800 (PST)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"YYtWI9nA\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=chromium.org; s=google; t=1732699607; x=1733304407;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=7qf7TjoxNHo5OLDoWBsF8q4aXijLrJm4Gl0VuJh1ic0=;\n\tb=YYtWI9nAgdyIEDo6UZU9eei0bgK9iPDVCTowryk1ztNoC8ZBuG8RENRpNTwS2h6i8i\n\t4KIGJdBShV0AYpLdSmIcZevV+IeNdqnjr4A51HJBzb4l2Z4ArT+es+T/QnC9SCzWwGs4\n\tGbmJgffafwjkbTwFzizGhnbmjXGm/+lh/ipWY=", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1732699607; x=1733304407;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=7qf7TjoxNHo5OLDoWBsF8q4aXijLrJm4Gl0VuJh1ic0=;\n\tb=QgehKqgbBZZf7Vx/R8i8vphYph/jTb7Zj0mKZi/OIMXsQvyfuoaDq9BLlCWysSO5lx\n\tZAesw18X4HeRHLp9jb0B2veAEXboSSb24Xi2Z79rujcXEDyQuzzgzePG56pXZYERSnw1\n\tqR0zn5vib00HveE1FP+wL6nrZNRF5CdOkqyjHRKZSInf3sE6/ZYJJiNH/HXZ9GMVqz5G\n\tYhRR8e0AD++itOpWp+9WYEQuvBh7vC1CZVqpLa3ztfj07rM5YlMHlXj41OD2gPBPMzl9\n\tIgDu4oHOJ96mi86JYi1Vuw9w4/CQhRrHIx09lDSdTj+xWG8sAFZSqwy8hxTMRNpno4TL\n\t+3Pg==", "X-Gm-Message-State": "AOJu0YyhlSLvZrLd0OF/+viwlY/DufV8QQ+m8LTk8JsxZogl4VRa1M6l\n\t9dhhtfTVIqBk6dTi77QW7FFRlWxPqaAAO2j40tkr3yQDNP2gkqlEPE7wfRUh0kBjU6huUSaQLDc\n\t=", "X-Gm-Gg": "ASbGnctXXC3VzdItL97FzqO5YdEEmDWL5+HPqZwtBwacjmgZZZZH3CvSByz7rv4g4g8\n\tD38P7yP/yKKrq0Ems/B/aaRuUBPIYwMKFSfL1+Eb2QLiMD/lktBLNHste7wJFFZVAtqgyakKADX\n\tnBA/mKgksJm8FnSd+UTuXf7DSSARXai//Ze7OhaI2jLo1qb6dIy8j9IX0kjhaJ2TnU/qz6cvtGW\n\tG46GJeCpovFf2TQveg1FIAyHhr09isz2hvoIj7CGktSe3Gi3ekg8QzqaPuLIoFjXBDbMAl3wC2M\n\toz581frw7j8vF3/rKqTPIOscnUE2dXxxLM7EZ++k3DOdt/PhkW3Msg==", "X-Google-Smtp-Source": "AGHT+IErrD10G3jBi+mWN3Zjm+Ew7Cwjj1wFpafYaRzKTRTL+0s/QFh7z1QoDsMjCii7PQxoU/V0RQ==", "X-Received": "by 2002:a05:6830:3805:b0:71d:4d88:2293 with SMTP id\n\t46e09a7af769-71d65cf62c7mr2174243a34.23.1732699606734; \n\tWed, 27 Nov 2024 01:26:46 -0800 (PST)", "From": "Harvey Yang <chenghaoyang@chromium.org>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Harvey Yang <chenghaoyang@chromium.org>,\n\tHan-Lin Chen <hanlinchen@chromium.org>", "Subject": "[PATCH v2 6/9] android: Cleanup CAMERA3_MSG_ERROR_REQUEST", "Date": "Wed, 27 Nov 2024 09:25:56 +0000", "Message-ID": "<20241127092632.3145984-7-chenghaoyang@chromium.org>", "X-Mailer": "git-send-email 2.47.0.338.g60cca15819-goog", "In-Reply-To": "<20241127092632.3145984-1-chenghaoyang@chromium.org>", "References": "<20241127092632.3145984-1-chenghaoyang@chromium.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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": "When a request is completed with failure, CAMERA3_MSG_ERROR_RESULT\nshould be used instead.\n\nThis patch also cleans up aborting when flushing with\nsendCaptureResult().\n\nSigned-off-by: Han-Lin Chen <hanlinchen@chromium.org>\nCo-developed-by: Harvey Yang <chenghaoyang@chromium.org>\nSigned-off-by: Harvey Yang <chenghaoyang@chromium.org>\n---\n src/android/camera_device.cpp | 28 +++++++++++++++-------------\n 1 file changed, 15 insertions(+), 13 deletions(-)", "diff": "diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex 0377cf215..3fb92268e 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -868,6 +868,8 @@ void CameraDevice::abortRequest(Camera3RequestDescriptor *descriptor) const\n \t\tbuffer.status = StreamBuffer::Status::Error;\n \n \tdescriptor->status_ = Camera3RequestDescriptor::Status::Error;\n+\n+\tsendCaptureResult(descriptor);\n }\n \n bool CameraDevice::isValidRequest(camera3_capture_request_t *camera3Request) const\n@@ -1136,14 +1138,7 @@ int CameraDevice::processCaptureRequest(camera3_capture_request_t *camera3Reques\n \tMutexLocker stateLock(stateMutex_);\n \n \tif (state_ == State::Flushing) {\n-\t\tCamera3RequestDescriptor *rawDescriptor = descriptor.get();\n-\t\t{\n-\t\t\tMutexLocker descriptorsLock(descriptorsMutex_);\n-\t\t\tdescriptors_.push(std::move(descriptor));\n-\t\t}\n-\t\tabortRequest(rawDescriptor);\n-\t\tcompleteDescriptor(rawDescriptor);\n-\n+\t\tabortRequest(descriptor.get());\n \t\treturn 0;\n \t}\n \n@@ -1211,10 +1206,7 @@ void CameraDevice::requestComplete(Request *request)\n \t\t\t\t<< \" not successfully completed: \"\n \t\t\t\t<< request->status();\n \n-\t\tabortRequest(descriptor);\n-\t\tcompleteDescriptor(descriptor);\n-\n-\t\treturn;\n+\t\tdescriptor->status_ = Camera3RequestDescriptor::Status::Error;\n \t}\n \n \t/*\n@@ -1239,7 +1231,7 @@ void CameraDevice::requestComplete(Request *request)\n \t */\n \tdescriptor->resultMetadata_ = getResultMetadata(*descriptor);\n \tif (!descriptor->resultMetadata_) {\n-\t\tnotifyError(descriptor->frameNumber_, nullptr, CAMERA3_MSG_ERROR_RESULT);\n+\t\tdescriptor->status_ = Camera3RequestDescriptor::Status::Error;\n \n \t\t/*\n \t\t * The camera framework expects an empty metadata pack on error.\n@@ -1325,6 +1317,16 @@ void CameraDevice::sendCaptureResults()\n \t\tdescriptors_.pop();\n \n \t\tsendCaptureResult(descriptor.get());\n+\n+\t\t/*\n+\t\t * Call notify with CAMERA3_MSG_ERROR_RESULT to indicate some\n+\t\t * of the expected result metadata might not be available\n+\t\t * because the capture is cancelled by the camera. Only notify\n+\t\t * it when the final result is sent, since Android will ignore\n+\t\t * the following metadata.\n+\t\t */\n+\t\tif (descriptor->status_ == Camera3RequestDescriptor::Status::Error)\n+\t\t\tnotifyError(descriptor->frameNumber_, nullptr, CAMERA3_MSG_ERROR_RESULT);\n \t}\n }\n \n", "prefixes": [ "v2", "6/9" ] }