From patchwork Mon Jun 29 16:29:38 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: 27094 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 BC389C3261 for ; Mon, 29 Jun 2026 16:31:01 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A964165F35; Mon, 29 Jun 2026 18:30:47 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="mV3ZwC15"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6DB6965F3D for ; Mon, 29 Jun 2026 18:30:24 +0200 (CEST) Received: from pb-laptop.local (185.221.140.128.nat.pool.zt.hu [185.221.140.128]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3AB5E1044 for ; Mon, 29 Jun 2026 18:29:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1782750581; bh=Y/1MYfy85QlfUMD+IhTKG4vHPwL0j8jsvwzEosEwqpM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mV3ZwC15Hh9ULDb+1kYLA2PCvyrZf/6L/bC2VFdHQs1RsaiWQ+wc6llbEjzg54yh7 IcO8yLvzCPR1FtNDQTsqvgHxifqe+FJJs62auR1C2wzKnCjVIECAqb/R11D+pTB9AD 5zXmFx9RhchMgGNVPkqas1gSDomig3aY5UwEbXqs= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [RFC PATCH v1 15/54] v4l2: v4l2_camera: Clear completed requests when stopping Date: Mon, 29 Jun 2026 18:29:38 +0200 Message-ID: <20260629163017.863145-16-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260629163017.863145-1-barnabas.pocze@ideasonboard.com> References: <20260629163017.863145-1-barnabas.pocze@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" The queue `completedBuffers_` keeps track of the completed buffers for servicing `VIDIOC_DQBUF` calls. It should be cleared when the streaming is stopped otherwise after the next startup stale data might be used. Signed-off-by: Barnabás Pőcze --- src/v4l2/v4l2_camera.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/v4l2/v4l2_camera.cpp b/src/v4l2/v4l2_camera.cpp index 8c7de8e92b..99109e93af 100644 --- a/src/v4l2/v4l2_camera.cpp +++ b/src/v4l2/v4l2_camera.cpp @@ -242,6 +242,7 @@ int V4L2Camera::streamOff() { MutexLocker locker(bufferMutex_); isRunning_ = false; + completedBuffers_.clear(); } bufferCV_.notify_all();