From patchwork Tue Dec 1 08:38:04 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: 29125 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 F3BFFC3361 for ; Tue, 1 Dec 2026 08:38:24 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4A5E46AAC3; Tue, 1 Dec 2026 09:38:20 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="oOdPbLhY"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D40BE6AA79 for ; Tue, 1 Dec 2026 09:38:10 +0100 (CET) Received: from pb-laptop.local (185.182.215.119.nat.pool.zt.hu [185.182.215.119]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id F1452C49 for ; Tue, 1 Dec 2026 09:35:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1796114133; bh=gnO83JzyR5919St0tN++xhWB1f4ByaMfM5xFTWFmUDg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=oOdPbLhYIam5CpwqmEek+h+6fvGHynRnwzLbQ076rMbb/VPKYJ37wROR/bTkn8QWD vTx49d+tcmbMmkOxbhCPJgPFxe7WZhAr1dUXVkN6sXXGcYxmL9YK+H6y4ZFkDDVlGo nU6DIdF4yCkpP1pw4ZwP/mH4YgKynwgXZq8qv1Jw= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v1 8/9] v4l2: v4l2_camera: Clear completed requests when stopping Date: Tue, 1 Dec 2026 09:38:04 +0100 Message-ID: <20261201083805.496809-9-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261201083805.496809-1-barnabas.pocze@ideasonboard.com> References: <20261201083805.496809-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 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 c7f227ee09..32014ae19c 100644 --- a/src/v4l2/v4l2_camera.cpp +++ b/src/v4l2/v4l2_camera.cpp @@ -243,6 +243,7 @@ int V4L2Camera::streamOff() { MutexLocker locker(bufferMutex_); isRunning_ = false; + completedBuffers_.clear(); } bufferCV_.notify_all();