From patchwork Wed Jun 19 02:51:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 1450 Return-Path: Received: from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net [195.74.38.228]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3B2FD61A21 for ; Wed, 19 Jun 2019 04:52:23 +0200 (CEST) X-Halon-ID: 31296ce7-923d-11e9-8ab4-005056917a89 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (unknown [89.233.230.99]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA id 31296ce7-923d-11e9-8ab4-005056917a89; Wed, 19 Jun 2019 04:52:08 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Wed, 19 Jun 2019 04:51:13 +0200 Message-Id: <20190619025129.21164-1-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 00/16] libcamera: Add support for format information and validation 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: Wed, 19 Jun 2019 02:52:23 -0000 Hi, This series aim to add support for format information exposed to applications and to ease format validation by allowing formats to be enumerate on v4l2 devices. The series also enhance the format enumeration of v4l2 subdevices. Further more it extends the cam utility to demonstrate the usage of how formats can examined and validated. One shortcoming of this series is that it only extends the uvcvideo pipeline with code to gather format information and perform validation. This however do not impact other existing pipeline handlers as they keep functioning as before this series. That is no format information can be retrieved and format validation is still supported all yet as simple as before this series. * Changes since v3 - Fix grammar and spelling in documentation. - Extend documentation, thanks Laurent! - Change error of ImageFormats::addFormat() from -EBUSY to -ESXIST. - Added \todo notes where computed lists could potentially be cached in the future. - Catch the error from V4L2Device::enumSizes() in V4L2Device::formats() - Move infoConfiguration() into CamApp::infoConfiguration(). * Changes since v2 - Correct spelling and grammar in documentation, thanks Jacopo! - Removed unneeded empty constructor ImageFormats::ImageFormats() - Rearranged order of data accessors in ImageFormats per Jacopo's suggestions. - s|\returns|\return| - Fix segfault when running cam -I without a camera. Niklas Söderlund (16): libcamera: geometry: SizeRange: Add constructor for a single size libcamera: geometry: SizeRange: Extend with step information libcamera: geometry: SizeRange: Add toString() libcamera: geometry: SizeRange: Add contains() libcamera: formats: Add ImageFormats libcamera: v4l2_subdevice: Breakout mbus code enumeration libcamera: v4l2_subdevice: Rework enumPadSizes() libcamera: v4l2_subdevice: Replace FormatEnum with ImageFormats libcamera: v4l2_device: Add enumeration of pixelformats and frame sizes libcamera: stream: Add StreamFormats libcamera: stream: StreamConfiguration: Add StreamFormats information test: stream: Add test for StreamFormat cam: Move camera configuration preparation to CamApp cam: Validate camera configuration cam: Add --info option to print information about stream(s) libcamera: pipeline: uvcvideo: Add format information and validation include/libcamera/geometry.h | 24 ++- include/libcamera/stream.h | 24 ++- src/cam/capture.cpp | 84 +------- src/cam/capture.h | 7 +- src/cam/main.cpp | 129 ++++++++++++- src/cam/main.h | 1 + src/libcamera/camera_sensor.cpp | 14 +- src/libcamera/formats.cpp | 90 ++++++++- src/libcamera/geometry.cpp | 86 ++++++++- src/libcamera/include/formats.h | 14 +- src/libcamera/include/v4l2_device.h | 5 + src/libcamera/include/v4l2_subdevice.h | 7 +- src/libcamera/pipeline/uvcvideo.cpp | 41 +++- src/libcamera/stream.cpp | 255 +++++++++++++++++++++++++ src/libcamera/v4l2_device.cpp | 114 +++++++++++ src/libcamera/v4l2_subdevice.cpp | 113 ++++++----- test/meson.build | 1 + test/stream/meson.build | 11 ++ test/stream/stream_formats.cpp | 101 ++++++++++ test/v4l2_subdevice/list_formats.cpp | 16 +- 20 files changed, 957 insertions(+), 180 deletions(-) create mode 100644 test/stream/meson.build create mode 100644 test/stream/stream_formats.cpp