From patchwork Wed Jun 4 13:07:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 23465 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 1EB05C3292 for ; Wed, 4 Jun 2025 13:08:05 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 512D968DBF; Wed, 4 Jun 2025 15:08:02 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="lIKBnG2C"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id EA92F68DBD for ; Wed, 4 Jun 2025 15:07:56 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E233714C7; Wed, 4 Jun 2025 15:07:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1749042474; bh=cHlXNgC6c6wPP2kbB9NZhy0+fGN3x5Sp5xrxbnbyiOM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lIKBnG2CQ7Ki1MJs/ms2tRjqJP6ojCBPOWRyOhsz6S2B+AGaRmJ6KdM0sKfyKUqLd DWJoiKI21Mr04TAfHrdjZftx/3nADHQpGrbPAabdynyif8FIKT9AinUzWuM1gAe5cn YVwRaEWBTEed3831y1Pm+HA6R+7m5e18SWecV3LE= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: Hou Qi , Nicolas Dufresne Subject: [PATCH v2 4/7] gstreamer: Rename variable in gst_libcamera_create_video_pool() Date: Wed, 4 Jun 2025 16:07:38 +0300 Message-ID: <20250604130741.9228-5-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250604130741.9228-1-laurent.pinchart@ideasonboard.com> References: <20250604130741.9228-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Now that the code is isolated in a function, the video_pool variable in gst_libcamera_create_video_pool() can be renamed to pool without clashing with another local variable. Do so to reduce line length. Signed-off-by: Laurent Pinchart Reviewed-by: Nicolas Dufresne --- src/gstreamer/gstlibcamerasrc.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp index b907a5759740..9c0ee491ab63 100644 --- a/src/gstreamer/gstlibcamerasrc.cpp +++ b/src/gstreamer/gstlibcamerasrc.cpp @@ -543,7 +543,7 @@ gst_libcamera_create_video_pool(GstLibcameraSrc *self, GstPad *srcpad, { GstQuery *query = NULL; const gboolean need_pool = true; - GstBufferPool *video_pool = NULL; + GstBufferPool *pool = NULL; /* * Get the peer allocation hints to check if it supports the meta API. @@ -564,22 +564,22 @@ gst_libcamera_create_video_pool(GstLibcameraSrc *self, GstPad *srcpad, * create a new pool. */ if (gst_query_get_n_allocation_pools(query) > 0) - gst_query_parse_nth_allocation_pool(query, 0, &video_pool, NULL, NULL, NULL); + gst_query_parse_nth_allocation_pool(query, 0, &pool, NULL, NULL, NULL); - if (!video_pool) { + if (!pool) { GstStructure *config; guint min_buffers = 3; - video_pool = gst_video_buffer_pool_new(); - config = gst_buffer_pool_get_config(video_pool); + pool = gst_video_buffer_pool_new(); + config = gst_buffer_pool_get_config(pool); gst_buffer_pool_config_set_params(config, caps, info->size, min_buffers, 0); GST_DEBUG_OBJECT(self, "Own pool config is %" GST_PTR_FORMAT, config); - gst_buffer_pool_set_config(GST_BUFFER_POOL_CAST(video_pool), config); + gst_buffer_pool_set_config(GST_BUFFER_POOL_CAST(pool), config); } - if (!gst_buffer_pool_set_active(video_pool, true)) { + if (!gst_buffer_pool_set_active(pool, true)) { gst_caps_unref(caps); GST_ELEMENT_ERROR(self, RESOURCE, SETTINGS, ("Failed to active buffer pool"), @@ -588,7 +588,7 @@ gst_libcamera_create_video_pool(GstLibcameraSrc *self, GstPad *srcpad, } gst_query_unref(query); - return { video_pool, 0 }; + return { pool, 0 }; } /* Must be called with stream_lock held. */