[{"id":34417,"web_url":"https://patchwork.libcamera.org/comment/34417/","msgid":"<84fa1f69fdc5b27f5436953fe6dc1d444cfec09e.camel@collabora.com>","date":"2025-06-04T17:12:23","subject":"Re: [PATCH v2 4/7] gstreamer: Rename variable in\n\tgst_libcamera_create_video_pool()","submitter":{"id":31,"url":"https://patchwork.libcamera.org/api/people/31/","name":"Nicolas Dufresne","email":"nicolas.dufresne@collabora.com"},"content":"Le mercredi 04 juin 2025 à 16:07 +0300, Laurent Pinchart a écrit :\n> Now that the code is isolated in a function, the video_pool variable in\n> gst_libcamera_create_video_pool() can be renamed to pool without\n> clashing with another local variable. Do so to reduce line length.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n\n> ---\n>  src/gstreamer/gstlibcamerasrc.cpp | 16 ++++++++--------\n>  1 file changed, 8 insertions(+), 8 deletions(-)\n> \n> diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\n> index b907a5759740..9c0ee491ab63 100644\n> --- a/src/gstreamer/gstlibcamerasrc.cpp\n> +++ b/src/gstreamer/gstlibcamerasrc.cpp\n> @@ -543,7 +543,7 @@ gst_libcamera_create_video_pool(GstLibcameraSrc *self, GstPad *srcpad,\n>  {\n>  \tGstQuery *query = NULL;\n>  \tconst gboolean need_pool = true;\n> -\tGstBufferPool *video_pool = NULL;\n> +\tGstBufferPool *pool = NULL;\n>  \n>  \t/*\n>  \t * Get the peer allocation hints to check if it supports the meta API.\n> @@ -564,22 +564,22 @@ gst_libcamera_create_video_pool(GstLibcameraSrc *self, GstPad *srcpad,\n>  \t * create a new pool.\n>  \t */\n>  \tif (gst_query_get_n_allocation_pools(query) > 0)\n> -\t\tgst_query_parse_nth_allocation_pool(query, 0, &video_pool, NULL, NULL, NULL);\n> +\t\tgst_query_parse_nth_allocation_pool(query, 0, &pool, NULL, NULL, NULL);\n>  \n> -\tif (!video_pool) {\n> +\tif (!pool) {\n>  \t\tGstStructure *config;\n>  \t\tguint min_buffers = 3;\n>  \n> -\t\tvideo_pool = gst_video_buffer_pool_new();\n> -\t\tconfig = gst_buffer_pool_get_config(video_pool);\n> +\t\tpool = gst_video_buffer_pool_new();\n> +\t\tconfig = gst_buffer_pool_get_config(pool);\n>  \t\tgst_buffer_pool_config_set_params(config, caps, info->size, min_buffers, 0);\n>  \n>  \t\tGST_DEBUG_OBJECT(self, \"Own pool config is %\" GST_PTR_FORMAT, config);\n>  \n> -\t\tgst_buffer_pool_set_config(GST_BUFFER_POOL_CAST(video_pool), config);\n> +\t\tgst_buffer_pool_set_config(GST_BUFFER_POOL_CAST(pool), config);\n>  \t}\n>  \n> -\tif (!gst_buffer_pool_set_active(video_pool, true)) {\n> +\tif (!gst_buffer_pool_set_active(pool, true)) {\n>  \t\tgst_caps_unref(caps);\n>  \t\tGST_ELEMENT_ERROR(self, RESOURCE, SETTINGS,\n>  \t\t\t\t  (\"Failed to active buffer pool\"),\n> @@ -588,7 +588,7 @@ gst_libcamera_create_video_pool(GstLibcameraSrc *self, GstPad *srcpad,\n>  \t}\n>  \n>  \tgst_query_unref(query);\n> -\treturn { video_pool, 0 };\n> +\treturn { pool, 0 };\n>  }\n>  \n>  /* Must be called with stream_lock held. */","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 D7B64C3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  4 Jun 2025 17:12:28 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8ABBA68DA8;\n\tWed,  4 Jun 2025 19:12:28 +0200 (CEST)","from bali.collaboradmins.com (bali.collaboradmins.com\n\t[IPv6:2a01:4f8:201:9162::2])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7683268DA8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  4 Jun 2025 19:12:26 +0200 (CEST)","from [IPv6:2606:6d00:10:5285::5ac] (unknown\n\t[IPv6:2606:6d00:10:5285::5ac])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (4096 bits)\n\tserver-digest SHA256)\n\t(No client certificate requested) (Authenticated sender: nicolas)\n\tby bali.collaboradmins.com (Postfix) with ESMTPSA id 7AA7617E010B;\n\tWed,  4 Jun 2025 19:12:25 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=collabora.com header.i=@collabora.com\n\theader.b=\"HAcNreFn\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com;\n\ts=mail; t=1749057146;\n\tbh=LaOjjzjTILAjWFDvplSoIGcmdUE14JFQDL6fekSDweE=;\n\th=Subject:From:To:Cc:Date:In-Reply-To:References:From;\n\tb=HAcNreFn3eNvug0IQQ4kj9aCGuX5KYTKRwSV0LlncMpv3AWBg3HVn0I18kzllWCvK\n\tbI5AYVVVCh5P3KtFnJoak9iACXwcLKXKJcWavOJiOi61XLMqX2naf0gnp9Yg+ca6rA\n\tnDiD1Kxk8VHlc6DQBsqJhoam9fXt2blPhVTpggZKyDZL3auKfwevA7pl4akh5Keibt\n\t3eMg9KagDvERorTxXSx1xa3vpdWKJaq0dCzo5g/3ONGp8iVGeO5p6y5MVcBo6JLTL6\n\tFxqhZy62hOwLqeAUag0/AVGMekpB6p1NjBbLVyW80g7V2YBE+IK4fRkPSRS1R+3Ohk\n\tIM/M79RgRu63w==","Message-ID":"<84fa1f69fdc5b27f5436953fe6dc1d444cfec09e.camel@collabora.com>","Subject":"Re: [PATCH v2 4/7] gstreamer: Rename variable in\n\tgst_libcamera_create_video_pool()","From":"Nicolas Dufresne <nicolas.dufresne@collabora.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>, \n\tlibcamera-devel@lists.libcamera.org","Cc":"Hou Qi <qi.hou@nxp.com>","Date":"Wed, 04 Jun 2025 13:12:23 -0400","In-Reply-To":"<20250604130741.9228-5-laurent.pinchart@ideasonboard.com>","References":"<20250604130741.9228-1-laurent.pinchart@ideasonboard.com>\n\t<20250604130741.9228-5-laurent.pinchart@ideasonboard.com>","Organization":"Collabora Canada","Content-Type":"text/plain; charset=\"UTF-8\"","User-Agent":"Evolution 3.56.2 (3.56.2-1.fc42) ","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>"}}]