From patchwork Mon Dec 9 16:34:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cheng-Hao Yang X-Patchwork-Id: 22260 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 EE1DFBD80A for ; Mon, 9 Dec 2024 16:34:26 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4DF7F67E6F; Mon, 9 Dec 2024 17:34:26 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="KT99WHbj"; dkim-atps=neutral Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4213467E5F for ; Mon, 9 Dec 2024 17:34:24 +0100 (CET) Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-725ed193c9eso1025031b3a.1 for ; Mon, 09 Dec 2024 08:34:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733762062; x=1734366862; 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=zcca79ogNy9mD8N5n1QtQBlRWuYc8jtxofBvdyoATPk=; b=KT99WHbjH3fjlee+jy1XBJn2Ne41G6t9je7I6samu/Hh5fMmPA+0RUTsUQLYKdq29W WPSdquzqdJIRuyexLrxDeKkQyXCHFL7Ocbe7unIIPH6LUDpGaymmcj7dxJ6fR2eLazIi V39DN+mFIb+CwEBpmuf+6TInYNvfqjeEIWJSM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733762062; x=1734366862; 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=zcca79ogNy9mD8N5n1QtQBlRWuYc8jtxofBvdyoATPk=; b=sRGCTPAv/rHgLZeIgLgOJKlM2xIFl6+pVYqtQ6djbC5CwSqJ5U/4mg0MzxhbMxyDt0 i+HDXXQdtpKHqnjXU5SQvThwzZPvowOekFJNO+D6wJWlak1KsUWdRtcww1rWDGkUcagI rQvFDumKKe3NPdzHfhl85As8f/qUS7Tanlrf27/mb6N6tzgwZpmmuV/sXCE04cv7afmg NeF0gGk0mjhLIevNUcoqe7zwVUxjFTl4CtZdZRgszJXVfKpDraTHyIvZMABfCGgtEWvq NF2/QRV3/HoAbOOfNvikpeYDq1Hfe8COk7jkxoabc03JDkFki5EVqhyqJ2PEAwuWo+Bk GrhQ== X-Gm-Message-State: AOJu0Yxxmde9319zNDOzme7EzGCJM2rCQ1vRc50KTLEDVC8lezjE7GrB JmutIlhYnXTcJnwCaxrIh6P4GEpMDbcrnldVHciKl1XDen946UahHI8lUwZ5FcRajXIu8n30Okk = X-Gm-Gg: ASbGncuEmq0v1ai9kH8turk5ksN3CuTrjZviWlfKRJPJm6EVuHd4IsQJ0uyeRbk0uRO 4FUpYe9fNPXMz8VHi7jh2J1G2B3LkJlovxrbE5eWnhA2gJn5VzvN0V62Sywbp5wtu7FWsoMpOHR 7sGMmLeOZszQR2FCWDSNNTtx/eh9QEMeUVUQ5VoT143iT0jd+UsndnU2oybUGu5Ci3SSXZs0aCe Db8ILfgXE14B1XT3f6DjItFBZ03cmC2h9wCpQkHzPJX6yg+n3JeXZtvGrCYuIPBIv0hFx2uCpQy BGevX4C1TsoAKuQPIHHR5eAI/a1OKO1GHSuEgC2t7lum431BRUOV4Y9w X-Google-Smtp-Source: AGHT+IH9GxSKINO3ZF7gTeKK3MrwegWACHxevg1qtk2V1mMF7JauhntZJoXiFiYoN8UQKJvXvZIGsQ== X-Received: by 2002:a05:6a20:244f:b0:1db:e096:8497 with SMTP id adf61e73a8af0-1e1b19c0924mr1850592637.0.1733762062394; Mon, 09 Dec 2024 08:34: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 d2e1a72fcca58-725dc0bb650sm3838227b3a.101.2024.12.09.08.34.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 08:34:21 -0800 (PST) From: Harvey Yang To: libcamera-devel@lists.libcamera.org Cc: Harvey Yang , Kieran Bingham Subject: [PATCH v2] V4L2VideoDevice: Call FrameBuffer::Private::cancel() in streamOff() Date: Mon, 9 Dec 2024 16:34:07 +0000 Message-ID: <20241209163418.330904-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 Reviewed-by: Kieran Bingham --- 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..5fcebdc63 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(); cache_->put(it.first); - metadata.status = FrameMetadata::FrameCancelled; + buffer->_d()->cancel(); bufferReady.emit(buffer); }