[{"id":28247,"web_url":"https://patchwork.libcamera.org/comment/28247/","msgid":"<a7a32874029a79a397c33509fd5463906ada60fa.camel@ndufresne.ca>","date":"2023-12-05T16:11:22","subject":"Re: [libcamera-devel] [PATCH v2 2/3] gstreamer: Add\n\tGstLibcameraSrcState::clearRequests method","submitter":{"id":30,"url":"https://patchwork.libcamera.org/api/people/30/","name":"Nicolas Dufresne","email":"nicolas@ndufresne.ca"},"content":"Le jeudi 30 novembre 2023 à 16:43 +0100, Jaslo Ziska via libcamera-devel a\nécrit :\n> Add a clearRequests method to GstLibcameraSrcState which clears the\n> GstLibcameraSrcState::completedRequests_ queue.\n> \n> Use this new method in gst_libcamera_src_task_leave instead of doing it\n> manually.\n> \n> Signed-off-by: Jaslo Ziska <jaslo@ziska.de>\n\nReviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n\n> ---\n>  src/gstreamer/gstlibcamerasrc.cpp | 13 ++++++++-----\n>  1 file changed, 8 insertions(+), 5 deletions(-)\n> \n> diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\n> index e57ba52f..d448a750 100644\n> --- a/src/gstreamer/gstlibcamerasrc.cpp\n> +++ b/src/gstreamer/gstlibcamerasrc.cpp\n> @@ -133,6 +133,7 @@ struct GstLibcameraSrcState {\n>  \tint queueRequest();\n>  \tvoid requestCompleted(Request *request);\n>  \tint processRequest();\n> +\tvoid clearRequests();\n>  };\n>  \n>  struct _GstLibcameraSrc {\n> @@ -318,6 +319,12 @@ int GstLibcameraSrcState::processRequest()\n>  \treturn err;\n>  }\n>  \n> +void GstLibcameraSrcState::clearRequests()\n> +{\n> +\tGLibLocker locker(&lock_);\n> +\tcompletedRequests_ = {};\n> +}\n> +\n>  static bool\n>  gst_libcamera_src_open(GstLibcameraSrc *self)\n>  {\n> @@ -629,11 +636,7 @@ gst_libcamera_src_task_leave([[maybe_unused]] GstTask *task,\n>  \tGST_DEBUG_OBJECT(self, \"Streaming thread is about to stop\");\n>  \n>  \tstate->cam_->stop();\n> -\n> -\t{\n> -\t\tGLibLocker locker(&state->lock_);\n> -\t\tstate->completedRequests_ = {};\n> -\t}\n> +\tstate->clearRequests();\n>  \n>  \t{\n>  \t\tGLibRecLocker locker(&self->stream_lock);","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 E0807C3226\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  5 Dec 2023 16:11:26 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A6C9F629CC;\n\tTue,  5 Dec 2023 17:11:26 +0100 (CET)","from mail-qk1-x736.google.com (mail-qk1-x736.google.com\n\t[IPv6:2607:f8b0:4864:20::736])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A6F0D61D9F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  5 Dec 2023 17:11:24 +0100 (CET)","by mail-qk1-x736.google.com with SMTP id\n\taf79cd13be357-77f0e76c948so166995785a.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 05 Dec 2023 08:11:24 -0800 (PST)","from nicolas-tpx395.localdomain ([2606:6d00:17:b5c::7a9])\n\tby smtp.gmail.com with ESMTPSA id\n\tc1-20020a05620a0ce100b0077f084f4cbbsm2379074qkj.20.2023.12.05.08.11.23\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 05 Dec 2023 08:11:23 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1701792686;\n\tbh=x8xQpSChIOxYM70mi6e39o5CQ+jWtFZUy5a+UeCDJ9o=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=RHR56TwLiRSiffs3qrolsGbyWMLBmlLSXXAKoT7NJ4XnU02m7Lgxv1iED1UTV/tzU\n\tVyfUUUW8c4amzS+Hvkm0k+BNDGV7l58DAxXuixNM/2AC8S/YKCv49PoK7Wf+uiQ00v\n\tzMKwxSWwlh66JWuaKAUYnjneFJhA+tgIgSwSY/hGHWRi28iWIccJkh7nH4Q+w2jc8l\n\tGLhhv7Ludm+uASxm11kBjSlXDTL9lz1dWNKRjEoDuAewW1FsyRED6AHRXazVW03Fe3\n\tvFZI4JblF1Hm1wVLUevOx7OAojelGT8WwkGL27KIbkgAaQvKyUpSMosBleRKhfoRtH\n\tNif4ACAzbWrgA==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ndufresne-ca.20230601.gappssmtp.com; s=20230601; t=1701792683;\n\tx=1702397483; darn=lists.libcamera.org; \n\th=mime-version:user-agent:content-transfer-encoding:references\n\t:in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=8BlpJFRrpc/SZqlEdfUh390JzDc3kkibG5wj0C4ZP2s=;\n\tb=p7F+TqBt+3FHXFgyRgD0wqWzNuUEuIZR+Wwxi3rMgN7285ap5/O4MysTExaVyNLK/V\n\tH3RmSpovun29StoGY+457eajMd0D/DpFhR0TU3oAr/I+EeYUGVfZxkMlXsen0uMr7Im6\n\t0p2y8IOKVR6qRcjp5emwe0TOQ1qK94rr3Z/5qdOzf8NAovao2diSPkB0F5kq/57+RfmC\n\t6aGEltgfCOgqqH6uURBtSiVxkaB1MXxrVbfWGyLpGMEnMeFvB3U2T3PhK/Iajs6G8gkX\n\tnxFMm991XlL1m9dIDe5tpOaJnTXarw024dynNbiXmD+AEiiVdZ8ucfC5yfRimq6IxN/Y\n\tVx3A=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected)\n\theader.d=ndufresne-ca.20230601.gappssmtp.com\n\theader.i=@ndufresne-ca.20230601.gappssmtp.com header.b=\"p7F+TqBt\"; \n\tdkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1701792683; x=1702397483;\n\th=mime-version:user-agent:content-transfer-encoding:references\n\t:in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from\n\t:to:cc:subject:date:message-id:reply-to;\n\tbh=8BlpJFRrpc/SZqlEdfUh390JzDc3kkibG5wj0C4ZP2s=;\n\tb=CymbpoHjghH4dN31G11Zp2rvcIHaSMT6mNAu6dTaCyIyOaSYBWbkRbOEmx1cIwp0ZH\n\tfWVl0BvyOjqXw5m7Qtv9rCT8/e/DhSzui5BU7f/hw4m3s592Ejqrhn1DD/Yn7Kmx0GS0\n\tzZcEvBVwjBFT4Nuq5fJ0n/WAe1rybIfHa86czRO6Ndfts+f8QY3rkLmfqG74m9ywYuZh\n\tK+J5KYEuVateTfePOPCBF9xIumh8LaeC7rs1kwqyTEKmlRaWoBVg2N7/IQt4rPTOnXLM\n\t2hev+FUh0jK45LX4L/S5Wzb+cbsSRL/dOHgIqSzZuIzrEx1DGT2VZ1BZ6RQPoK7PUAKt\n\teuCQ==","X-Gm-Message-State":"AOJu0YwZ1THf3/kje4FKF+NloBhYUFv22xaNdmGNBT1WhbJWVKYYlEBW\n\tbyUqtx/VqBUeKulA3JABo4xL/oKMksnovoNk6qI=","X-Google-Smtp-Source":"AGHT+IEtEK10v6nWVxAFVmude4Dl3JO7z4LcLcoWWjzA4zb8VaL6363k4mB3pLe8btizWgqXZAGXLA==","X-Received":"by 2002:a05:620a:2409:b0:77e:ffcd:2728 with SMTP id\n\td9-20020a05620a240900b0077effcd2728mr2258727qkn.53.1701792683485; \n\tTue, 05 Dec 2023 08:11:23 -0800 (PST)","Message-ID":"<a7a32874029a79a397c33509fd5463906ada60fa.camel@ndufresne.ca>","To":"Jaslo Ziska <jaslo@ziska.de>, libcamera-devel@lists.libcamera.org","Date":"Tue, 05 Dec 2023 11:11:22 -0500","In-Reply-To":"<20231130155323.13259-3-jaslo@ziska.de>","References":"<20231130155323.13259-1-jaslo@ziska.de>\n\t<20231130155323.13259-3-jaslo@ziska.de>","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","User-Agent":"Evolution 3.48.4 (3.48.4-1.fc38) ","MIME-Version":"1.0","Subject":"Re: [libcamera-devel] [PATCH v2 2/3] gstreamer: Add\n\tGstLibcameraSrcState::clearRequests method","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>","From":"Nicolas Dufresne via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Nicolas Dufresne <nicolas@ndufresne.ca>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":28269,"web_url":"https://patchwork.libcamera.org/comment/28269/","msgid":"<20231206232540.GG29417@pendragon.ideasonboard.com>","date":"2023-12-06T23:25:40","subject":"Re: [libcamera-devel] [PATCH v2 2/3] gstreamer: Add\n\tGstLibcameraSrcState::clearRequests method","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jaslo,\n\nThank you for the patch.\n\nOn Thu, Nov 30, 2023 at 04:43:09PM +0100, Jaslo Ziska via libcamera-devel wrote:\n> Add a clearRequests method to GstLibcameraSrcState which clears the\n\ns/method/function/ (the C++ language has functions, not methods)\n\n> GstLibcameraSrcState::completedRequests_ queue.\n> \n> Use this new method in gst_libcamera_src_task_leave instead of doing it\n\nSame here.\n\n> manually.\n> \n> Signed-off-by: Jaslo Ziska <jaslo@ziska.de>\n\nThis change by itself doesn't seem like a major improvement, but its\nusage in patch 3/3 makes it worth it.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/gstreamer/gstlibcamerasrc.cpp | 13 ++++++++-----\n>  1 file changed, 8 insertions(+), 5 deletions(-)\n> \n> diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\n> index e57ba52f..d448a750 100644\n> --- a/src/gstreamer/gstlibcamerasrc.cpp\n> +++ b/src/gstreamer/gstlibcamerasrc.cpp\n> @@ -133,6 +133,7 @@ struct GstLibcameraSrcState {\n>  \tint queueRequest();\n>  \tvoid requestCompleted(Request *request);\n>  \tint processRequest();\n> +\tvoid clearRequests();\n>  };\n>  \n>  struct _GstLibcameraSrc {\n> @@ -318,6 +319,12 @@ int GstLibcameraSrcState::processRequest()\n>  \treturn err;\n>  }\n>  \n> +void GstLibcameraSrcState::clearRequests()\n> +{\n> +\tGLibLocker locker(&lock_);\n> +\tcompletedRequests_ = {};\n> +}\n> +\n>  static bool\n>  gst_libcamera_src_open(GstLibcameraSrc *self)\n>  {\n> @@ -629,11 +636,7 @@ gst_libcamera_src_task_leave([[maybe_unused]] GstTask *task,\n>  \tGST_DEBUG_OBJECT(self, \"Streaming thread is about to stop\");\n>  \n>  \tstate->cam_->stop();\n> -\n> -\t{\n> -\t\tGLibLocker locker(&state->lock_);\n> -\t\tstate->completedRequests_ = {};\n> -\t}\n> +\tstate->clearRequests();\n>  \n>  \t{\n>  \t\tGLibRecLocker locker(&self->stream_lock);","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 E952DC31E9\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  6 Dec 2023 23:25:36 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 306CA62B2C;\n\tThu,  7 Dec 2023 00:25:36 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E035A61D9B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  7 Dec 2023 00:25:33 +0100 (CET)","from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi\n\t[213.243.189.158])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B283A674;\n\tThu,  7 Dec 2023 00:24:52 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1701905136;\n\tbh=oyICUHqGiLzzIG7kOBf8UYiQRqPGW7hbNBMy5C0h46Q=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=rXID449NZbcjAy2X+UroY2R0ZKfb+i5BBS/EJUWtP8CrAEm5cw3R4jDvnRqDS1shU\n\tTdEwbQXaJr9vyKfCQcJi+yWYs409y0WEVpEwvx2UPNxbeBO+pjv/GZ7IjOvasgzFVR\n\txuzGGISXVmCy/DL868R20HKda0CxNSTb0li6mFFQ+FZZbfF+cLMjZpmB7q1bot6ghN\n\th/lTDNewKa1gYRVR4ddFLho5wwihGl7LgWVeUEjy+9qxXh6q7UdRuBYPLcX4aavkI/\n\tgc2erq1tv47FVrVP4kXnhXz4JloucoZoa8yI59AFfg8voxR5sQa1wI5SR2Ldm++kh1\n\tS9IA0MnHHGs/g==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1701905092;\n\tbh=oyICUHqGiLzzIG7kOBf8UYiQRqPGW7hbNBMy5C0h46Q=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=F6WmdpDcD3aI1QK6Gs5X91fmIexnD2wu9HQedBcgl5lSBcLgGZeRlsWhvzofgMMxl\n\tDIP9zxDOyPSiYMKKOeB3YSWUiqO6Fao2fbbth86bK+bv8w+w9bWbbdgAIr7PwMBTEC\n\tYLwC1GoOT35IzLs9hZ8kqexefQ4w0w2aS7J3LHHU="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"F6WmdpDc\"; dkim-atps=neutral","Date":"Thu, 7 Dec 2023 01:25:40 +0200","To":"Jaslo Ziska <jaslo@ziska.de>","Message-ID":"<20231206232540.GG29417@pendragon.ideasonboard.com>","References":"<20231130155323.13259-1-jaslo@ziska.de>\n\t<20231130155323.13259-3-jaslo@ziska.de>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20231130155323.13259-3-jaslo@ziska.de>","Subject":"Re: [libcamera-devel] [PATCH v2 2/3] gstreamer: Add\n\tGstLibcameraSrcState::clearRequests method","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]