From patchwork Wed Nov 27 08:12:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 22105 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 ECCD0C3213 for ; Wed, 27 Nov 2024 08:12:22 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 329C26609C; Wed, 27 Nov 2024 09:12:22 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="S2mMahGy"; 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 0335765F9E for ; Wed, 27 Nov 2024 09:12:20 +0100 (CET) Received: from ideasonboard.com (mob-5-90-139-188.net.vodafone.it [5.90.139.188]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E593078C; Wed, 27 Nov 2024 09:11:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1732695118; bh=KvNd9kd4uSkZ7dRXdTolMUTCayiIH0kLzAlA3ZxwP6Y=; h=From:To:Cc:Subject:Date:From; b=S2mMahGyBVUYtUISvzuoupfynP10Z4HhPpcObdABt7f85+YxIBHa1zte8NrNNV+Uh LQG6eRW1Z9Nk4jZ3FJSbmOc4x4G2WRC7PqHc8BpW1Eym5lb+LKxPO2UvYSK6q/oRfa 133TeI6yGBwjxB9GPQi92E0yfZJQPebi3VDGA0iE= From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Cc: Jacopo Mondi Subject: [PATCH] libcamera: v4l2_videodevice: Clarify V4L2M2MDevice Date: Wed, 27 Nov 2024 09:12:11 +0100 Message-ID: <20241127081212.16543-1-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.47.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" The documentation seems to suggest that to create a new M2M execution context it is expected users to call V4L2M2MDevice::open() multiple times on the same video device path. It is instead expected that multiple instances of the class are created, one for each required execution context. Clarify it in the documentation of the V4L2M2MDevice class. Signed-off-by: Jacopo Mondi Reviewed-by: Kieran Bingham --- src/libcamera/v4l2_videodevice.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index 14eba0561d6a..156601d08d0c 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -2128,11 +2128,16 @@ V4L2PixelFormat V4L2VideoDevice::toV4L2PixelFormat(const PixelFormat &pixelForma * deviceNode which operate together using two queues to implement the V4L2 * Memory to Memory API. * - * The two devices should be opened by calling open() on the V4L2M2MDevice, and - * can be closed by calling close on the V4L2M2MDevice. + * User of this class should create a new instance of the V4L2M2MDevice for each + * desired execution context and then open it by calling open() on the + * V4L2M2MDevice and close it by calling close() on the V4L2M2MDevice. * * Calling V4L2VideoDevice::open() and V4L2VideoDevice::close() on the capture * or output V4L2VideoDevice is not permitted. + * + * Once the M2M device is open users can operate on the output and capture queue + * represented by the V4L2VideoDevice returned by the output() and capture() + * functions. */ /**