From patchwork Tue Apr 2 00:53:27 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: 831 Return-Path: Received: from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net [195.74.38.229]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6090E60DB2 for ; Tue, 2 Apr 2019 02:53:59 +0200 (CEST) X-Halon-ID: c5f61900-54e1-11e9-846a-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 c5f61900-54e1-11e9-846a-005056917a89; Tue, 02 Apr 2019 02:53:58 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Tue, 2 Apr 2019 02:53:27 +0200 Message-Id: <20190402005332.25018-1-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [libcamera-devel] [RFC 0/5] libcamera: camera: Add support for stream usage hint 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: Tue, 02 Apr 2019 00:53:59 -0000 Hi, This RFC changes how the default configuration is retrieved from a camera. It replaces the current method where applications have to enumerate a cameras streams and pick a set of them to ask for a default configuration and then try to tune them to its use-case. Instead the application asks libcamera for a set of streams to fit its use-case and receives in returns a set of streams with a default configuration (which it then can try and fine tune). The goal of this series is to define the API towards the application and not to implement smart choices in the pipeline handlers to actually select streams. The main reason for this limitation in scope are that all upstream pipeline handlers only support one stream so the new API is not really useful for pipeline handlers yet. The code is however tested with a modified cam tool for which patches will be posted momentarily together with out of tree IPU3 patches to extend it to expose more then one stream per camera. So the API is proven to work with multiple streams and can support capturing multiple streams in the same request. Niklas Söderlund (5): cam: Rework how streams configuration is prepared test: camera: Remove streams argument from configurationValid() test: camera: Remove test for bad Stream IDs libcamera: stream: Add basic stream usage hints definitions libcamera: camera: Add support for stream usage hints include/libcamera/camera.h | 3 +- include/libcamera/stream.h | 39 +++++++++++ src/cam/main.cpp | 35 +++++----- src/libcamera/camera.cpp | 30 +++------ src/libcamera/include/pipeline_handler.h | 2 +- src/libcamera/pipeline/ipu3/ipu3.cpp | 4 +- src/libcamera/pipeline/uvcvideo.cpp | 6 +- src/libcamera/pipeline/vimc.cpp | 6 +- src/libcamera/pipeline_handler.cpp | 4 +- src/libcamera/stream.cpp | 84 ++++++++++++++++++++++++ src/qcam/main_window.cpp | 5 +- test/camera/camera_test.cpp | 26 +++----- test/camera/camera_test.h | 3 +- test/camera/capture.cpp | 7 +- test/camera/configuration_default.cpp | 32 ++------- test/camera/configuration_set.cpp | 5 +- test/camera/statemachine.cpp | 4 +- 17 files changed, 188 insertions(+), 107 deletions(-)