From patchwork Tue Jan 20 14:44:20 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 25888 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 1C132C3220 for ; Tue, 20 Jan 2026 14:44:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0A38761FC9; Tue, 20 Jan 2026 15:44:26 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="tl8X3Csb"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2CEC061A35 for ; Tue, 20 Jan 2026 15:44:24 +0100 (CET) Received: from pb-laptop.local (185.221.143.114.nat.pool.zt.hu [185.221.143.114]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id ED23C177D for ; Tue, 20 Jan 2026 15:43:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1768920233; bh=DyyZRCCFGIafOOWR1pFK5lPr66T8OmgWPYIxZ2cuVqM=; h=From:To:Subject:Date:From; b=tl8X3CsbUZDZm9yACMXruyTcHbV98fxdsRmkVDyqC5LxuKz6dD7vqrXEzugZgr2hf wB56b1D1uYvTjGlDAGZdwy7ZYTbbBUuo5AUA+/CookNagPekOHWlXhzamKA4TKkaWy m4zas0HzvmeJ8sBp91IShcLIETbsCZHB8FKW4w2w= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v1] libcamera: pipeline: virtual: Don't use span iterator as pointer Date: Tue, 20 Jan 2026 15:44:20 +0100 Message-ID: <20260120144420.264358-1-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.52.0 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" Pointer to the contiguous data of a container is to be retrieved using the `data()` member function. Using `begin()` in contexts that require pointers is not correct as the iterator may be something entirely different. So use `data()` where applicable. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart --- src/libcamera/pipeline/virtual/image_frame_generator.cpp | 5 +++-- src/libcamera/pipeline/virtual/test_pattern_generator.cpp | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/libcamera/pipeline/virtual/image_frame_generator.cpp b/src/libcamera/pipeline/virtual/image_frame_generator.cpp index d1545b5d9..5ba76507a 100644 --- a/src/libcamera/pipeline/virtual/image_frame_generator.cpp +++ b/src/libcamera/pipeline/virtual/image_frame_generator.cpp @@ -136,8 +136,9 @@ int ImageFrameGenerator::generateFrame(const Size &size, const FrameBuffer *buff /* Write the scaledY and scaledUV to the mapped frame buffer */ libyuv::NV12Copy(scaledFrameDatas_[frameIndex_].Y.get(), size.width, - scaledFrameDatas_[frameIndex_].UV.get(), size.width, planes[0].begin(), - size.width, planes[1].begin(), size.width, + scaledFrameDatas_[frameIndex_].UV.get(), size.width, + planes[0].data(), size.width, + planes[1].data(), size.width, size.width, size.height); /* Proceed to the next image every 4 frames */ diff --git a/src/libcamera/pipeline/virtual/test_pattern_generator.cpp b/src/libcamera/pipeline/virtual/test_pattern_generator.cpp index 745be83b9..12cce9f7e 100644 --- a/src/libcamera/pipeline/virtual/test_pattern_generator.cpp +++ b/src/libcamera/pipeline/virtual/test_pattern_generator.cpp @@ -53,8 +53,8 @@ int TestPatternGenerator::generateFrame(const Size &size, /* Convert the template_ to the frame buffer */ int ret = libyuv::ARGBToNV12(template_.get(), size.width * kARGBSize, - planes[0].begin(), size.width, - planes[1].begin(), size.width, + planes[0].data(), size.width, + planes[1].data(), size.width, size.width, size.height); if (ret != 0) LOG(Virtual, Error) << "ARGBToNV12() failed with " << ret;