From patchwork Fri Jun 21 16:13:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 1493 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9230F600F7 for ; Fri, 21 Jun 2019 18:14:06 +0200 (CEST) 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 EE91267; Fri, 21 Jun 2019 18:14:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1561133646; bh=hshEvx0Hz24h/yBqBPWCdWDVvVFTC1jZdxe8Ca7TaV4=; h=From:To:Cc:Subject:Date:From; b=nbWGM9vYYTDr5xnEax088blcY55ojddjRFYVBYciKNHBD5K2vVyN+w5MFAMpdCtyJ cxFQad2Yf6e0auXOD1Yq31Je0+EsdGXEl+4hvv7/JSfPIZzILj1+fm94QmHHee0fRU x5iTle1Uu72fCJ/0g3DK9R9j10F3PKTSJ/F2IGI4= From: Kieran Bingham To: LibCamera Devel Date: Fri, 21 Jun 2019 17:13:52 +0100 Message-Id: <20190621161401.28337-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v2 0/9] Libcamera Controls 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 Jun 2019 16:14:06 -0000 V2 of LibCamera controls, now with extracted Value class and a long list of undocumented todos. This series is based upon Jacopo's v5 of V4L2Controls. - ControlValue class is now in it's own reusable Value class. This should be re-usable somewhat like a QT QVariant ... - ControlList Controls are now simply an association of a ControlInfo (or ID) and a Value. The ControlList is a custom wrapper of an unordered_map to pass these around. Known todos / issues: - I still need to look at querying ControlInfo attributes - Currently I think a ControlInfo structure is created everytime an entry is added to the ControlList, and this likely isn't as efficient as I'd like - Min/Max values in ControlInfo are currently unset and un-used - but that should change. - I feel like it would be nice to have a better representation of a single control, rather than just a ControlInfo,Value pair. I have a custom Control class to experiment with but that is not utilsed by this series. I'm not sure how I'd change the iterators to use this anyway yet. - This series does not aim to represent MetaData as such yet. That might be similar and might be possible to use a 'ControlList' but it's not clear yet. - As yet there is not a facility to obtain a list of all controls from the V4L2 layer, and as such I have not yet implemented any means of finding a complete set of controls aavilable to a particular Camera. Kieran Bingham (9): libcamera: Value: Provide abstract value class libcamera: test: Add Value tests libcamera: controls: Introduce Control structures libcamera: test: Add ControlInfo tests libcamera: Implement a ControlList libcamera: request: Add a ControlList libcamera: test: Add ControlList tests [PoC] UVCPipelineHandler: Set Controls [PoC] QCam: Control demo: A SineWave Brightness include/libcamera/controls.h | 99 ++++++++++ include/libcamera/meson.build | 2 + include/libcamera/request.h | 3 + include/libcamera/value.h | 63 ++++++ src/libcamera/controls.cpp | 288 ++++++++++++++++++++++++++++ src/libcamera/meson.build | 2 + src/libcamera/pipeline/uvcvideo.cpp | 43 ++++- src/libcamera/request.cpp | 10 + src/libcamera/value.cpp | 226 ++++++++++++++++++++++ src/qcam/main_window.cpp | 16 ++ test/controls.cpp | 139 ++++++++++++++ test/meson.build | 2 + test/value.cpp | 82 ++++++++ 13 files changed, 974 insertions(+), 1 deletion(-) create mode 100644 include/libcamera/controls.h create mode 100644 include/libcamera/value.h create mode 100644 src/libcamera/controls.cpp create mode 100644 src/libcamera/value.cpp create mode 100644 test/controls.cpp create mode 100644 test/value.cpp