| Message ID | 20260925-v4l2-events-v1-0-b2ec212eb5d0@ideasonboard.com |
|---|---|
| Headers | show
Return-Path: <libcamera-devel-bounces@lists.libcamera.org> 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 577A6BDCBD for <parsemail@patchwork.libcamera.org>; Fri, 25 Sep 2026 15:16:33 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E65EB689C0; Fri, 25 Sep 2026 17:16:31 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="TRRfyhfL"; 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 7338168983 for <libcamera-devel@lists.libcamera.org>; Fri, 25 Sep 2026 17:16:30 +0200 (CEST) Received: from [127.0.1.1] (chfd-03-b2-v4wan-176392-cust229.vm15.cable.virginm.net [82.19.20.230]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 14429C1; Fri, 25 Sep 2026 17:14:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1790349282; bh=Cv+EFxTMp9SeROnHuWPyN6eKMZM1OekWjkU8DCO2M3c=; h=From:Subject:Date:To:Cc:From; b=TRRfyhfLdV/AtWvftrakIQ46FDtn1Cg1fWQRauz4pIwF0kHaeo5l9DeeKLuCVjTiA DQs606bG3hi1W1tvjcAuQ63zInfIYKLnpjncj4eAk/Xb8dqKSIKVLyxPnbRaP3r/qe nrhIbKIGnemOlvVkDkX7IxPiDLsYSMQlukmihCMw= From: Daniel Scally <dan.scally@ideasonboard.com> Subject: [PATCH 0/4] Add generic V4L2 Events support Date: Fri, 25 Sep 2026 16:16:20 +0100 Message-Id: <20260925-v4l2-events-v1-0-b2ec212eb5d0@ideasonboard.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAESQtmoC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIzMDS0ML3TKTHCPd1LLUvJJiXeNUc5NE88RUMwszIyWgjoKi1LTMCrBp0bG 1tQCZKCqTXQAAAA== X-Change-ID: 20260918-v4l2-events-3e74a7ae6862 To: libcamera-devel@lists.libcamera.org Cc: Daniel Scally <dan.scally@ideasonboard.com> X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2827; i=dan.scally@ideasonboard.com; h=from:subject:message-id; bh=Cv+EFxTMp9SeROnHuWPyN6eKMZM1OekWjkU8DCO2M3c=; b=owEBbQKS/ZANAwAKAchJV3psRXUyAcsmYgBqtpBM4MUtb1PJ832s/Z2hdaeLPswDw5rP8ohAJ UryDi9b94WJAjMEAAEKAB0WIQQqyuwyDnZdb+mxmm/ISVd6bEV1MgUCaraQTAAKCRDISVd6bEV1 MrlzD/9rmtW9NSl2j5DAEqB0uyznOnoq/hkhpTbazExRVZn7vP6bzh+SkbbbbGltWCwZHhAo0mG 3xFOR7WscmewRUoox6s1f70dM8/j0R7fVVo7+wwjXR5nIFVYucq8KtMOKJLEAc6soSQy73IFaWI 34Nnmln6YGj7oiOAvtdGgkVjB5yP5HGM2UdfE/zLtrYr65td2ekzGKeNzGr54HKskQaOGUcEA5r oElgtlwuqe2f9SWbH63iMO3ep8367Mq70p6SyxG0uo+tebMrNM7ubdX4wjqvvJtgjgaO3x8Povz l9MhrtmasdQy7oKp5SQ5KFtvsvZ9KDRaqKJVNZVDv+9WFQeRlXMF1vBhjVV+RkVQ8fdS4qSTX0C QFUkZbCYEGAZKk4H4MTVVfgwTq3yOM/++ePfsukoc/Jw/5M3QerqsbSLciLMRraD9EAmgTNXYQm FqhwMMPfj4lmpFxJcvqsz5+kUu8olkqx/0ZSIuWNyzTyGUUQBYtkz/9Bnv2z499YBBBGd2oCiax hIFdx7SEspFnlxxHo4ksbM7KefxBpaetaCC8cjtZtNht0L6ZfBxkyEnBQsutCjHxC8WAU6Ip1/m y6pvvHDITKQjWlv117pskEaYIuYAeNbGMeWTHphL1Cktqxtzdy//5vyu/hKkiYN4slI19ihojGK T69JxbL5uoLyysQ== X-Developer-Key: i=dan.scally@ideasonboard.com; a=openpgp; fpr=EEC699ACA1B7CB5D31330C0BBD501C2A3546CCF6 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: <libcamera-devel.lists.libcamera.org> List-Unsubscribe: <https://lists.libcamera.org/options/libcamera-devel>, <mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe> List-Archive: <https://lists.libcamera.org/pipermail/libcamera-devel/> List-Post: <mailto:libcamera-devel@lists.libcamera.org> List-Help: <mailto:libcamera-devel-request@lists.libcamera.org?subject=help> List-Subscribe: <https://lists.libcamera.org/listinfo/libcamera-devel>, <mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe> Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" <libcamera-devel-bounces@lists.libcamera.org> |
| Series |
|
| Related |
show
|
At present class V4L2Device allows subscriptions to V4L2 Events of type V4L2_EVENT_FRAME_SYNC through a very specific API; support is verified with "supportsFrameSyncEvents()" and subscription enabled with "setFrameStartEnabled()". The arrival of an event is signalled with a Signal<uint32_t> which passes the frame sequence number to the slot. This is adequate, but limited, and expansion to support other event types in a similar manner would be quite clunky. This series adapts the event support to be more generic with the aim of facilitating easy use of other event types. My plan was originally to just rename the functions and parametise them such that support for a given event type could be checked and enabled, however the fact that the existing frameStart Signal takes only a uint32_t as parameter means it cannot be renamed to apply to other events too, as the details of the other event types could not be conveyed through a single uint32_t. Having separate Signals for each event type seems ugly, and so I settled on the idea of having a Signal<std::shared_ptr<V4L2Event>> and letting the Slot deal with figuring out what the type of event is and which of V4L2Event's derived classes it actually represents. We don't have any upstream users of anything but the FrameSync event yet, but not including the others seemed incomplete, so I did. Thanks Dan Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com> --- Daniel Scally (4): libcamera: v4l2_event: Add V4L2Event class and functionality libcamera: v4l2_device: Make supportsFrameStartEvent() generic libcamera: v4l2_device: Emit signals for V4L2Events generically libcamera: v4l2_device: Make setFrameStartEnabled() generic include/libcamera/internal/v4l2_device.h | 10 +- include/libcamera/internal/v4l2_event.h | 158 +++++++++++ src/libcamera/meson.build | 1 + src/libcamera/pipeline/ipu3/cio2.cpp | 6 +- src/libcamera/pipeline/ipu3/cio2.h | 3 +- src/libcamera/pipeline/ipu3/ipu3.cpp | 17 +- src/libcamera/pipeline/mali-c55/mali-c55.cpp | 24 +- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 23 +- .../pipeline/rpi/common/pipeline_base.cpp | 20 +- src/libcamera/pipeline/rpi/common/pipeline_base.h | 3 +- src/libcamera/pipeline/simple/simple.cpp | 29 ++- src/libcamera/v4l2_device.cpp | 65 +++-- src/libcamera/v4l2_event.cpp | 288 +++++++++++++++++++++ 13 files changed, 587 insertions(+), 60 deletions(-) --- base-commit: 279d355ef8f7a4f98bb0a3004c0f788387814506 change-id: 20260918-v4l2-events-3e74a7ae6862 Best regards,