[{"id":33255,"web_url":"https://patchwork.libcamera.org/comment/33255/","msgid":"<173858077530.1773152.13267016582583428775@ping.linuxembedded.co.uk>","date":"2025-02-03T11:06:15","subject":"Re: [PATCH v1 3/3] libcamera: pipeline: virtual: Set `FrameError` on\n\terror","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Barnabás Pőcze (2025-02-03 10:43:34)\n> Do not cancel, simply set the buffer's status to `FrameError`\n> to notify the user about the error condition.\n> \n> Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>\n> ---\n>  src/libcamera/pipeline/virtual/virtual.cpp | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/pipeline/virtual/virtual.cpp b/src/libcamera/pipeline/virtual/virtual.cpp\n> index 1a75f35aa..cbba08c82 100644\n> --- a/src/libcamera/pipeline/virtual/virtual.cpp\n> +++ b/src/libcamera/pipeline/virtual/virtual.cpp\n> @@ -322,7 +322,7 @@ int PipelineHandlerVirtual::queueRequestDevice([[maybe_unused]] Camera *camera,\n>  \n>                                 if (streamConfig.frameGenerator->generateFrame(\n>                                             stream->configuration().size, buffer))\n> -                                       buffer->_d()->cancel();\n> +                                       fmd.status = FrameMetadata::Status::FrameError;\n\nI think this sounds right. I always worry we don't handle frame buffers\ncorrectly for errors vs shutdown paths where I think buffers get marked\nas error/cancel to let the application know not to re-submit them.\n\nI think that API all feels awkward, but I suspect what you're doing here\nis correct as this is just if there is an error to generate the frame.\n\nCan the generateFrame return errors? What might happen?\n\nanyway, it sounds correct already:\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n>  \n>                                 completeBuffer(request, buffer);\n>                                 break;\n> -- \n> 2.48.1\n> \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 9B804C3260\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  3 Feb 2025 11:06:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E32FF6858D;\n\tMon,  3 Feb 2025 12:06:19 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CA1E46857A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  3 Feb 2025 12:06:17 +0100 (CET)","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 8DACF664;\n\tMon,  3 Feb 2025 12:05:06 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Gmey3N8x\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1738580706;\n\tbh=Gp49ItXc3ZlXD1SbRpVNlk1tWbLdNLoNVey7srs3nDg=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=Gmey3N8xcSiDb1w9fx7rxJNkNpImRecN5l9BVZuaWXfCyJM0BRXoiXXpGRvGrxOAz\n\t4Y1tRCCgROZbFRyx+oMiCv5cSwFambpSseuwNZ69ZrRvyuWgzS0eBo9BFSXEKVa0Ip\n\tj1NfNHr6ex2tqKxSY+awCBklwDOBneTg376F1jUA=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20250203104318.135628-4-pobrn@protonmail.com>","References":"<20250203104318.135628-1-pobrn@protonmail.com>\n\t<20250203104318.135628-4-pobrn@protonmail.com>","Subject":"Re: [PATCH v1 3/3] libcamera: pipeline: virtual: Set `FrameError` on\n\terror","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Mon, 03 Feb 2025 11:06:15 +0000","Message-ID":"<173858077530.1773152.13267016582583428775@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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":33257,"web_url":"https://patchwork.libcamera.org/comment/33257/","msgid":"<RZa762ybozhi0VybVZaMV7X7ABVuvmtWq9gMg06PsrczSisuP1Wp2yW10Pn9hn-S0tiFq5e0QyP3jaG0dCCKxOYwbfbJWmOPMbzijXkiwnw=@protonmail.com>","date":"2025-02-03T11:17:08","subject":"Re: [PATCH v1 3/3] libcamera: pipeline: virtual: Set `FrameError` on\n\terror","submitter":{"id":133,"url":"https://patchwork.libcamera.org/api/people/133/","name":"Pőcze Barnabás","email":"pobrn@protonmail.com"},"content":"2025. február 3., hétfő 12:06 keltezéssel, Kieran Bingham <kieran.bingham@ideasonboard.com> írta:\n\n> Quoting Barnabás Pőcze (2025-02-03 10:43:34)\n> > Do not cancel, simply set the buffer's status to `FrameError`\n> > to notify the user about the error condition.\n> >\n> > Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>\n> > ---\n> >  src/libcamera/pipeline/virtual/virtual.cpp | 2 +-\n> >  1 file changed, 1 insertion(+), 1 deletion(-)\n> >\n> > diff --git a/src/libcamera/pipeline/virtual/virtual.cpp b/src/libcamera/pipeline/virtual/virtual.cpp\n> > index 1a75f35aa..cbba08c82 100644\n> > --- a/src/libcamera/pipeline/virtual/virtual.cpp\n> > +++ b/src/libcamera/pipeline/virtual/virtual.cpp\n> > @@ -322,7 +322,7 @@ int PipelineHandlerVirtual::queueRequestDevice([[maybe_unused]] Camera *camera,\n> >\n> >                                 if (streamConfig.frameGenerator->generateFrame(\n> >                                             stream->configuration().size, buffer))\n> > -                                       buffer->_d()->cancel();\n> > +                                       fmd.status = FrameMetadata::Status::FrameError;\n> \n> I think this sounds right. I always worry we don't handle frame buffers\n> correctly for errors vs shutdown paths where I think buffers get marked\n> as error/cancel to let the application know not to re-submit them.\n> \n> I think that API all feels awkward, but I suspect what you're doing here\n> is correct as this is just if there is an error to generate the frame.\n> \n> Can the generateFrame return errors? What might happen?\n\nI don't think it can, realistically. \n\n\n> \n> anyway, it sounds correct already:\n> \n> \n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> >\n> >                                 completeBuffer(request, buffer);\n> >                                 break;\n> > --\n> > 2.48.1\n> >\n> >\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 19DA6BD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  3 Feb 2025 11:17:18 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 32F5D68592;\n\tMon,  3 Feb 2025 12:17:17 +0100 (CET)","from mail-10630.protonmail.ch (mail-10630.protonmail.ch\n\t[79.135.106.30])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6B7FE618CD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  3 Feb 2025 12:17:15 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=protonmail.com header.i=@protonmail.com\n\theader.b=\"JWypLU/m\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;\n\ts=protonmail3; t=1738581434; x=1738840634;\n\tbh=eUXE0Nq9EZum37skGIyG8CIQOLBp4F+pgS2VxcmodIY=;\n\th=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References:\n\tFeedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID:\n\tMessage-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post;\n\tb=JWypLU/m1gE1A9YP0SV/ZVCnBdVINESwM8qc6n6vRCJyxSA3zF518dwbAN2MUhIHe\n\tJiZ4SMUSVqpLgyrblfBRoNTC3NMmXTnPRnc2Gj6Xdu3g9ijcRqoLC6PrzAi74IqGLm\n\tvr1ILb3yV0WTlAAPWpiz/10mHkXxqoKB//HMa5rkiLJixtgdcC2TFq3hxgAAHBBbjo\n\tBJAxOQnK+Kb2ruIWcnKmU2T8hX8DBou4qmtZ1cBupcaxCO5iOwD6KokL0QcsCyHtVT\n\tFJS0X4B95Mn0+2DZTK4WDQauOSf3c5iFfbo1oQiG6H7FcClHBEhDdVONRAu80knlpl\n\tZ3Q0vfFW+RKbQ==","Date":"Mon, 03 Feb 2025 11:17:08 +0000","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v1 3/3] libcamera: pipeline: virtual: Set `FrameError` on\n\terror","Message-ID":"<RZa762ybozhi0VybVZaMV7X7ABVuvmtWq9gMg06PsrczSisuP1Wp2yW10Pn9hn-S0tiFq5e0QyP3jaG0dCCKxOYwbfbJWmOPMbzijXkiwnw=@protonmail.com>","In-Reply-To":"<173858077530.1773152.13267016582583428775@ping.linuxembedded.co.uk>","References":"<20250203104318.135628-1-pobrn@protonmail.com>\n\t<20250203104318.135628-4-pobrn@protonmail.com>\n\t<173858077530.1773152.13267016582583428775@ping.linuxembedded.co.uk>","Feedback-ID":"20568564:user:proton","X-Pm-Message-ID":"e70f5ff5d11472dfe0289d05cedea8e8f47eb68b","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","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":33270,"web_url":"https://patchwork.libcamera.org/comment/33270/","msgid":"<ngjfmr7rcn4o4jg3ii3gaxbnkqfsqvrqnejakfpzskohj2iocg@uakhjylilpnz>","date":"2025-02-03T17:42:23","subject":"Re: [PATCH v1 3/3] libcamera: pipeline: virtual: Set `FrameError` on\n\terror","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Barnabás\n\nOn Mon, Feb 03, 2025 at 10:43:34AM +0000, Barnabás Pőcze wrote:\n> Do not cancel, simply set the buffer's status to `FrameError`\n> to notify the user about the error condition.\n\nIn case of errors, Status::FrameError seems more opportune than\nStatus::FrameCancelled indeed\n\n>\n> Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>\n\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nThanks\n  j\n\n> ---\n>  src/libcamera/pipeline/virtual/virtual.cpp | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/src/libcamera/pipeline/virtual/virtual.cpp b/src/libcamera/pipeline/virtual/virtual.cpp\n> index 1a75f35aa..cbba08c82 100644\n> --- a/src/libcamera/pipeline/virtual/virtual.cpp\n> +++ b/src/libcamera/pipeline/virtual/virtual.cpp\n> @@ -322,7 +322,7 @@ int PipelineHandlerVirtual::queueRequestDevice([[maybe_unused]] Camera *camera,\n>\n>  \t\t\t\tif (streamConfig.frameGenerator->generateFrame(\n>  \t\t\t\t\t    stream->configuration().size, buffer))\n> -\t\t\t\t\tbuffer->_d()->cancel();\n> +\t\t\t\t\tfmd.status = FrameMetadata::Status::FrameError;\n>\n>  \t\t\t\tcompleteBuffer(request, buffer);\n>  \t\t\t\tbreak;\n> --\n> 2.48.1\n>\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 5BAB2C3260\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  3 Feb 2025 17:42:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9A2946859D;\n\tMon,  3 Feb 2025 18:42:29 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 52EDA61876\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  3 Feb 2025 18:42:27 +0100 (CET)","from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A07088DB;\n\tMon,  3 Feb 2025 18:41:15 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Hzs6/DNA\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1738604475;\n\tbh=f5iKOxkIIDEs4cmaiDqBB+JWddRPzveC/uM0FLEAUCY=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Hzs6/DNAIhKAVfNfs15P1R3FUINc1LwH/CordTVnwbx3SVVW7GrDX2u5lXpwZIrMv\n\tBJFG3QP+DN5gqFy6VCQw/Gw7H+V0DYnUzJDlt4Ac2kriy9zXPQCTscBWwZxM2fwVvQ\n\tR7MfAwwntQy1/FM04urobxvJmc/fa7kk7JMORqzU=","Date":"Mon, 3 Feb 2025 18:42:23 +0100","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v1 3/3] libcamera: pipeline: virtual: Set `FrameError` on\n\terror","Message-ID":"<ngjfmr7rcn4o4jg3ii3gaxbnkqfsqvrqnejakfpzskohj2iocg@uakhjylilpnz>","References":"<20250203104318.135628-1-pobrn@protonmail.com>\n\t<20250203104318.135628-4-pobrn@protonmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20250203104318.135628-4-pobrn@protonmail.com>","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>"}}]