From patchwork Fri Dec 21 12:37:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 73 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5CF3260B23 for ; Fri, 21 Dec 2018 13:37:29 +0100 (CET) Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CA07D558; Fri, 21 Dec 2018 13:37:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1545395848; bh=R4DWhaNG9P/mlEe/tVOLTrA1A3iRcrwvQLohjD6Nb8M=; h=From:To:Cc:Subject:Date:From; b=LQZrykNdYN6zzmN2900J84UCBGNZBEHd+w2tlksJ2BY2hB91YtRc2htDFMOkekMs8 59ktBkkMHHBP9UNsW/nXZPpD9u+an78VvR8wcZ9meBvQBoDE9O5O2JczoveKrRzdQM 4NA2eZbZkh+l4RioKWvClAIbeMW+94x7ZCtnlGxo= From: Kieran Bingham To: LibCamera Devel Date: Fri, 21 Dec 2018 12:37:22 +0000 Message-Id: <20181221123724.27290-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.17.1 Subject: [libcamera-devel] [PATCH 0/2] libcamera: Initial v4l2device object X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 12:37:36 -0000 Provide an initial object to handle opening and querying a v4l2device object. A test-suite is added to support multiple tests for the object (not all provided in this series) and an associated update to the test base class provides a helper to determine if an external test resource is available. The v4l2device test base class expects /dev/video0 to be a valid video capture device node. This will not always be the case and instead (later) it should iterate all video device nodes and identify a suitable device to utilise in testing. There are further patches on top of this - but they're not yet ready, and sending this out gives us the opportunity to incorporate a v4l2device object for consumption by other developers, while the API grows. Kieran Bingham (2): test: libtest: Add path_exists helper lib: Add V4L2 Device object src/libcamera/include/v4l2_device.h | 36 +++++++ src/libcamera/meson.build | 2 + src/libcamera/v4l2_device.cpp | 137 ++++++++++++++++++++++++++ test/libtest/test.cpp | 11 +++ test/libtest/test.h | 2 + test/meson.build | 2 + test/v4l2_device/double_open.cpp | 32 ++++++ test/v4l2_device/meson.build | 12 +++ test/v4l2_device/v4l2_device_test.cpp | 36 +++++++ test/v4l2_device/v4l2_device_test.h | 31 ++++++ 10 files changed, 301 insertions(+) create mode 100644 src/libcamera/include/v4l2_device.h create mode 100644 src/libcamera/v4l2_device.cpp create mode 100644 test/v4l2_device/double_open.cpp create mode 100644 test/v4l2_device/meson.build create mode 100644 test/v4l2_device/v4l2_device_test.cpp create mode 100644 test/v4l2_device/v4l2_device_test.h