[{"id":34679,"web_url":"https://patchwork.libcamera.org/comment/34679/","msgid":"<175101225891.3281735.16544636033003169908@ping.linuxembedded.co.uk>","date":"2025-06-27T08:17:38","subject":"Re: [PATCH v2] V4L2VideoDevice: Call FrameBuffer::Private::cancel()\n\tin streamOff()","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi all,\n\nQuoting Harvey Yang (2024-12-09 16:34:07)\n> At the moment `V4L2VideoDevice::streamOff()` sets\n> `FrameBuffer::Private`'s metadata directly, while that's equivalent to\n> calling `FrameBuffer::Private::cancel()`. To ease code tracing, this\n> patch replace the manual modification with the function call.\n> \n> Signed-off-by: Harvey Yang <chenghaoyang@chromium.org>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nI'm digging through my emails and see this is still pending.\n\nI believe it's suitable for merge, but it's core libcamera and only has\none RB tag from me.\n\nany other feedback or otherwise objections to this? Otherwise if no one\nobjects I'll merge.\n\n--\nKieran\n\n\n> ---\n>  src/libcamera/v4l2_videodevice.cpp | 3 +--\n>  1 file changed, 1 insertion(+), 2 deletions(-)\n> \n> diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\n> index a5cf67845..5fcebdc63 100644\n> --- a/src/libcamera/v4l2_videodevice.cpp\n> +++ b/src/libcamera/v4l2_videodevice.cpp\n> @@ -2007,10 +2007,9 @@ int V4L2VideoDevice::streamOff()\n>         /* Send back all queued buffers. */\n>         for (auto it : queuedBuffers_) {\n>                 FrameBuffer *buffer = it.second;\n> -               FrameMetadata &metadata = buffer->_d()->metadata();\n>  \n>                 cache_->put(it.first);\n> -               metadata.status = FrameMetadata::FrameCancelled;\n> +               buffer->_d()->cancel();\n>                 bufferReady.emit(buffer);\n>         }\n>  \n> -- \n> 2.47.0.338.g60cca15819-goog\n>","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 6AF7DBDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 27 Jun 2025 08:17:43 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 541BF68DF7;\n\tFri, 27 Jun 2025 10:17:42 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3BEE662C43\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Jun 2025 10:17:41 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C64DD289;\n\tFri, 27 Jun 2025 10:17:21 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"kIsaIES6\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1751012241;\n\tbh=KahjVDl/y0YvOUbO+Ls/q5lSORixIarVy56R98VWMng=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=kIsaIES6YKZ5BR4kVK7XSPcOC75Nmj3fVj0iVewq6at3NiJsZbJ6AkQko0JBFrJl1\n\tCZl7koDMM00BI7sifoZY51g1bQGYRoCHTAeS2b0xqYRYd2Pt+RlQ6oc1ICq6a935b/\n\tEC5gtajR9JFzwQqa5k49NmjAsnfa8hSVbhpdFxY4=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20241209163418.330904-1-chenghaoyang@chromium.org>","References":"<20241209163418.330904-1-chenghaoyang@chromium.org>","Subject":"Re: [PATCH v2] V4L2VideoDevice: Call FrameBuffer::Private::cancel()\n\tin streamOff()","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Harvey Yang <chenghaoyang@chromium.org>","To":"Harvey Yang <chenghaoyang@chromium.org>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Fri, 27 Jun 2025 09:17:38 +0100","Message-ID":"<175101225891.3281735.16544636033003169908@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","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>"}},{"id":34682,"web_url":"https://patchwork.libcamera.org/comment/34682/","msgid":"<cfdb4399-9fe6-4c07-8860-b8616c4b7372@igalia.com>","date":"2025-06-27T08:25:01","subject":"Re: [PATCH v2] V4L2VideoDevice: Call FrameBuffer::Private::cancel()\n\tin streamOff()","submitter":{"id":232,"url":"https://patchwork.libcamera.org/api/people/232/","name":"Umang Jain","email":"uajain@igalia.com"},"content":"Hello,\n\nOn 6/27/25 1:47 PM, Kieran Bingham wrote:\n> Hi all,\n>\n> Quoting Harvey Yang (2024-12-09 16:34:07)\n>> At the moment `V4L2VideoDevice::streamOff()` sets\n>> `FrameBuffer::Private`'s metadata directly, while that's equivalent to\n\n\nnit: s/metadata/metadata status to FrameCancelled/\n\n>> calling `FrameBuffer::Private::cancel()`. To ease code tracing, this\n>> patch replace the manual modification with the function call.\n>>\n>> Signed-off-by: Harvey Yang<chenghaoyang@chromium.org>\n>> Reviewed-by: Kieran Bingham<kieran.bingham@ideasonboard.com>\n\n\nLGTM,\n\nReviewed-by: Umang Jain<uajain@igalia.com>\n\n\n> I'm digging through my emails and see this is still pending.\n>\n> I believe it's suitable for merge, but it's core libcamera and only has\n> one RB tag from me.\n>\n> any other feedback or otherwise objections to this? Otherwise if no one\n> objects I'll merge.\n>\n> --\n> Kieran\n>\n>\n>> ---\n>>   src/libcamera/v4l2_videodevice.cpp | 3 +--\n>>   1 file changed, 1 insertion(+), 2 deletions(-)\n>>\n>> diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\n>> index a5cf67845..5fcebdc63 100644\n>> --- a/src/libcamera/v4l2_videodevice.cpp\n>> +++ b/src/libcamera/v4l2_videodevice.cpp\n>> @@ -2007,10 +2007,9 @@ int V4L2VideoDevice::streamOff()\n>>          /* Send back all queued buffers. */\n>>          for (auto it : queuedBuffers_) {\n>>                  FrameBuffer *buffer = it.second;\n>> -               FrameMetadata &metadata = buffer->_d()->metadata();\n>>   \n>>                  cache_->put(it.first);\n>> -               metadata.status = FrameMetadata::FrameCancelled;\n>> +               buffer->_d()->cancel();\n>>                  bufferReady.emit(buffer);\n>>          }\n>>   \n>> -- \n>> 2.47.0.338.g60cca15819-goog\n>>","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 EA2CFBDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 27 Jun 2025 08:25:01 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D315068DF7;\n\tFri, 27 Jun 2025 10:25:00 +0200 (CEST)","from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8991662C43\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Jun 2025 10:24:58 +0200 (CEST)","from [49.36.69.141] (helo=[192.168.29.4])\n\tby fanzine2.igalia.com with esmtpsa \n\t(Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_128_GCM:128)\n\t(Exim) id 1uV4OG-009JM9-DL; Fri, 27 Jun 2025 10:24:56 +0200"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=igalia.com header.i=@igalia.com\n\theader.b=\"A9V36E6D\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;\n\ts=20170329;\n\th=In-Reply-To:From:References:To:Subject:MIME-Version:Date:\n\tMessage-ID:Content-Type:Sender:Reply-To:Cc:Content-Transfer-Encoding:\n\tContent-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:\n\tResent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:\n\tList-Subscribe:List-Post:List-Owner:List-Archive;\n\tbh=1Q05JFlIrvdE+baEyVEwRiJcU56Y0DfE1sIlGQUu0Cc=;\n\tb=A9V36E6Da4yYQR5iy6B77Llx7n\n\tfv9cVEgcrCYsXjzRSAx5lXwgpFjBVkwRz5tBqCm1/d8x75XRYJKWa68h6JZ+/DCMwQR0L/0nl8zT6\n\tR1Sx3JvABVAbwSNzJpHSXqFGA8HrU2/QF7YFsxZOYPN7EoBV4sZJx3uypHMoJ7lTbf1IAdXd7NIst\n\tuWFlUbHy9G02IDtps2lzAcB2fzCJxSSAOz1esFJMUYNXCAxD4EaWebvrWEzAcCVppv3vgfa/6vm2z\n\tAh/mL67pW+U/UU9DjDZ08AacWpnjbFUdL8zjvwIJ43pxM6jCjt5Af3QndOZ/fDiBRUHQZsInZQRYY\n\tZwbYaGSg==;","Content-Type":"multipart/alternative;\n\tboundary=\"------------Ob2O0vWZtR01IHyrK4DDdDK0\"","Message-ID":"<cfdb4399-9fe6-4c07-8860-b8616c4b7372@igalia.com>","Date":"Fri, 27 Jun 2025 13:55:01 +0530","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v2] V4L2VideoDevice: Call FrameBuffer::Private::cancel()\n\tin streamOff()","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tHarvey Yang <chenghaoyang@chromium.org>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20241209163418.330904-1-chenghaoyang@chromium.org>\n\t<175101225891.3281735.16544636033003169908@ping.linuxembedded.co.uk>","Content-Language":"en-US","From":"Umang Jain <uajain@igalia.com>","In-Reply-To":"<175101225891.3281735.16544636033003169908@ping.linuxembedded.co.uk>","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>"}}]