From patchwork Mon Apr 1 10:14:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 823 Return-Path: Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0A56F600F9 for ; Mon, 1 Apr 2019 12:13:36 +0200 (CEST) X-Originating-IP: 2.224.242.101 Received: from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 809061BF20D; Mon, 1 Apr 2019 10:13:35 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Mon, 1 Apr 2019 12:14:08 +0200 Message-Id: <20190401101410.4984-1-jacopo@jmondi.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [libcamera-devel] [RFC 0/2] libcamera: Implement stream properties 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: Mon, 01 Apr 2019 10:13:36 -0000 Hello, this RFC series implement support for static stream properties and implements their usage in the library, by modifying the way streamConfiguration() works. The first patch adds the StreamProperties and StreamUsage classes, and creates IPU3 streams with associated properties. The IPU3 implementation uses a sub-class of StreamProperties, demonstrating how to use it to store pipeline-specific configurations. The patch does not introduced any dependency betwee the Stream and StreamProperties class, as the second contains informations not visible to the applications, and should be sub-classed by pipeline handler. For this reason, each pipeline hander has to maintain an association between streams and their properties. This could be later generalized by introducing per-Stream data in the pipeline handler base class. The second patch modifies the way application retrieve default stream configurations. The StreamConfiguration class has been expanded to support what has been named 'usage hints'. Each configuration reports a desired size, format and intended usage, and pipeline handlers shall try to associate a configuration with a stream, and return it with an associated default configuration. To demonstrate the usage, implement the new behaviour in the library, using the IPU3 multi-stream pipeline handler implementation (not merged yet) as an example. Also modify the cam application to require configurations for two streams (STILL_CAPTURE and VIEWFINDER) and modify the viewfinder sizes. The two patches are based on v2 of multi-stream support for IPU3, which has not been yet sent as the ImgU support series has not been merged yet. I have pushed to the 'jmondi/imgu-v5-multi' branch. Verified by using the hacked version of camera app, which captures from view finder and takes a snapshot from output every ten frames. Sending as RFC as it depends on a lot of out of tree code, and to request early feedbacks. Thanks j Jacopo Mondi (2): libcamera: stream: Implement StreamProperties libcamera: Modify streamConfiguration() include/libcamera/camera.h | 2 +- include/libcamera/meson.build | 1 + include/libcamera/stream.h | 7 ++ include/libcamera/stream_usages.h | 20 ++++ src/cam/main.cpp | 48 ++++---- src/libcamera/camera.cpp | 30 +++-- src/libcamera/include/pipeline_handler.h | 3 +- src/libcamera/include/stream_properties.h | 41 +++++++ src/libcamera/meson.build | 1 + src/libcamera/pipeline/ipu3/ipu3.cpp | 127 +++++++++++++++++----- src/libcamera/pipeline/uvcvideo.cpp | 4 +- src/libcamera/pipeline/vimc.cpp | 4 +- src/libcamera/pipeline_handler.cpp | 23 ++-- src/libcamera/stream.cpp | 25 +++++ src/libcamera/stream_properties.cpp | 121 +++++++++++++++++++++ 15 files changed, 379 insertions(+), 78 deletions(-) create mode 100644 include/libcamera/stream_usages.h create mode 100644 src/libcamera/include/stream_properties.h create mode 100644 src/libcamera/stream_properties.cpp --- 2.21.0