From patchwork Tue Dec 3 09:52:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harvey Yang X-Patchwork-Id: 22155 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 AC02BBDCBF for ; Tue, 3 Dec 2024 09:52:26 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E1E7166085; Tue, 3 Dec 2024 10:52:25 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="fXlDx7KO"; dkim-atps=neutral Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3013366072 for ; Tue, 3 Dec 2024 10:52:24 +0100 (CET) Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-7f71f2b1370so3357874a12.1 for ; Tue, 03 Dec 2024 01:52:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733219542; x=1733824342; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=1dasvx8DVzz+q3yF8nmiRlSGQmpBd0VNHnDGTdM5ozw=; b=fXlDx7KOa0ckOAclUdTbnIls5qh/BOlITgRdX7arsDjt78rzF0iOs2XKf4qNyvXS40 4nVQMirUSoR+xEnZpb1bBw37q6uv1W4ACWX83ad6WcJsqZg0H5gfOWxMINeoIgwLM4/w JZV6gr4+R5Ll9Vh8pULbf6y0iZeqHECTVCMdU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733219542; x=1733824342; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1dasvx8DVzz+q3yF8nmiRlSGQmpBd0VNHnDGTdM5ozw=; b=I+kn10w17gYcUNq3vFs/wznSqW6o5+6quER2DtWE8iOMk4F6Gis5W8hhh4oYjtzDh7 nQ4XTHJogWaBv5JuUCNpqappONKLVMciJuY9EYmYq500Amj94CuYefCk7xVkNKuAhSEH YqxKHOitX7Gesydk9723C1C+p3oB+CmvG5BI5ifWWp5LQgc9dPrLYAiAMyCxf5hyAd+L fv85C0pgxpxJE7peH8cAqBx0JA+ycPdSCmFzql+7XCwgT3Hku/kFVpksWtNQ8j9UIiQu pvFevRNymeGSEUU1W1sf33ZhcKD+cqgxW6kl0FdElEnS4baxtCWu1sqk5daQEPaBlmyi rIXw== X-Gm-Message-State: AOJu0YwsV+Jl7ZNVzYkdDCcpag6m7paKb6Zn8wtZho4sKC1dL53MvGxn YD8sTKUEBD+U9zCseWFT10VPVLv6bIhHABtDB/u7RLyJFSEv4dZvcSqVis+z2r9RImupAC89IB4 WSQ== X-Gm-Gg: ASbGncuo9YS1loF+E6+2mdK35x08RbPOHSFZThc/oxpiNq7d9MDgJOKYYrht5LcdoBe LFoKpCAjokTvBxOrvnPWWxa9U8JYKboKuvWFushBk6Gz1nTQ7RtoAaydXPsfgWeRAT8Y4cF+l5p 4S5FNiNYrcSGuc4cyfVfVptDGA54H5Fgs8t28RDdN26OxeslMll/27WsBETSUwS4uGVSlBlCckG SVmoMI1uuPoxUGT4gNAL7Iuhp4Uvxk/cnKg2HsW84OuAUDzSQaW6KK0m/6Y/Mph5ceXvQ1ZQJoI hKbhfhlSSMVVqZQXnYcBOJGg182s4DVyPGBsqcR/sZOTCXbvtJ11fvZc X-Google-Smtp-Source: AGHT+IHteT4EHYd8M2F4k3DeKFMbDcEyoJm32M5umlTikqQY+b492i08BmrtR7iJahcDGzEufWRUaw== X-Received: by 2002:a05:6a21:33a7:b0:1da:5bb:f8ca with SMTP id adf61e73a8af0-1e165334c99mr3735959637.0.1733219542298; Tue, 03 Dec 2024 01:52:22 -0800 (PST) Received: from chenghaoyang-low.c.googlers.com.com (112.212.229.35.bc.googleusercontent.com. [35.229.212.112]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7fc9c38585csm9314633a12.61.2024.12.03.01.52.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2024 01:52:21 -0800 (PST) From: Harvey Yang To: libcamera-devel@lists.libcamera.org Cc: Harvey Yang Subject: [PATCH] V4L2VideoDevice: Call FrameBuffer::Private::cancel() in streamOff() Date: Tue, 3 Dec 2024 09:52:13 +0000 Message-ID: <20241203095217.2155153-1-chenghaoyang@chromium.org> X-Mailer: git-send-email 2.47.0.338.g60cca15819-goog 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" At the moment `V4L2VideoDevice::streamOff()` sets `FrameBuffer::Private`'s metadata directly, while that's equivalent to calling `FrameBuffer::Private::cancel()`. To ease code tracing, this patch replace the manual modification with the function call. Signed-off-by: Harvey Yang --- src/libcamera/v4l2_videodevice.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index a5cf67845..0558434cb 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -2007,10 +2007,9 @@ int V4L2VideoDevice::streamOff() /* Send back all queued buffers. */ for (auto it : queuedBuffers_) { FrameBuffer *buffer = it.second; - FrameMetadata &metadata = buffer->_d()->metadata(); + buffer->_d()->cancel(); cache_->put(it.first); - metadata.status = FrameMetadata::FrameCancelled; bufferReady.emit(buffer); }