From patchwork Fri Apr 29 19:34:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 15750 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 51A44C0F2A for ; Fri, 29 Apr 2022 19:34:25 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6A63265648; Fri, 29 Apr 2022 21:34:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1651260864; bh=zYc1GC01DsgB67RFQFoeCdFgV3OrlEDUufvd+1E9FnM=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=XHl08VOqI867Lk99gILrbAZLArMOrhBWyxQIJdpwBYC6LyQTeiSl2kQ29DUc+lBDA k+cg02Px64TTZO3OltBdtqE/5LthvjsT638n2GIv6/AvvjyT1txvyysd9/2yxZ/RJW 3Gj5ALBB9GA8LqfoRwwTMqoH8kwvvhnNO85mf6j2LmAbFqut1IqreAeJICxFF+2oq8 kQ8gO1GnK+eCbrv++kKeQlP6wOs3KhHDWXjAbAhOkuoTg+YzskW0GNaOU7HDsCj+HL +LXYckT7PYiSn+zq2TS5wzMAx/JhzCaBTXLE9EYaiBzS/7eSY2CdU4xtTbu+UMG3CN Tmw+Uomro8lsw== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B514F6042F for ; Fri, 29 Apr 2022 21:34:22 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="H/o35TYB"; dkim-atps=neutral Received: from Q.ksquared.org.uk.beta.tailscale.net (unknown [178.237.134.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id F3D8D45F; Fri, 29 Apr 2022 21:34:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1651260862; bh=zYc1GC01DsgB67RFQFoeCdFgV3OrlEDUufvd+1E9FnM=; h=From:To:Cc:Subject:Date:From; b=H/o35TYB+UUa1rr0Al2cbFBDMSn2ZQYB0i4JVxhMIMO1NQHECzFNYtneOevTUytow uSYF6os6BJy88OaDjy0EQjGPVhJNQbHUYw+IINO1+luVFJgX4igHqsN3omUTrqtKeA f9e6b2t8LTIF0JnJp/iT/u3SKhidWNBkrYMVjT3k= To: libcamera devel Date: Fri, 29 Apr 2022 21:34:31 +0200 Message-Id: <20220429193434.167990-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/3] Sequence Observer 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: , X-Patchwork-Original-From: Kieran Bingham via libcamera-devel From: Kieran Bingham Reply-To: Kieran Bingham Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This fell out of some more work I did in the past catching and detecting frame drops in streams. While the method of reporting this event to userspace is debated, this pulls out some core functionality and wraps some generic code into a Sequence Observer to provide an easy to use check on any monotonic sequence. For now - it simply reports a warning if a V4L2 device detects a frame drop, which is more notification that we have currently... as we are silently dropping frames at the moment. Kieran Bingham (3): libcamera: Add sequence value observer test: Add Sequence observer tests libcamera: v4l2: Detect frame drops on V4L2VideoDevice include/libcamera/internal/v4l2_videodevice.h | 2 + include/libcamera/meson.build | 1 + include/libcamera/sequence.h | 20 +++++ src/libcamera/meson.build | 1 + src/libcamera/sequence.cpp | 66 +++++++++++++++ src/libcamera/v4l2_videodevice.cpp | 10 +++ test/meson.build | 1 + test/sequence.cpp | 80 +++++++++++++++++++ 8 files changed, 181 insertions(+) create mode 100644 include/libcamera/sequence.h create mode 100644 src/libcamera/sequence.cpp create mode 100644 test/sequence.cpp