From 77ae64eb24bf6c2fe241b6f7b841315b1ee15707 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 29 Apr 2019 15:15:23 +0300 Subject: libcamera: Refactor the camera configuration storage and API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refactor the CameraConfiguration structure to not rely on Stream instances. This is a step towards making the camera configuration object more powerful with configuration validation using "try" semantics. The CameraConfiguration now exposes a simple vector-like API to access the contained stream configurations. Both operator[]() and at() are provided to access elements. The isEmpty() method is renamed to empty() and the methods reordered to match the std::vector class. As applications need access to the Stream instances associated with the configuration entries in order to associate buffers with streams when creating requests, expose the stream selected by the pipeline handler through a new StreamConfiguration::stream(). Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund Reviewed-by: Jacopo Mondi --- src/libcamera/stream.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/libcamera/stream.cpp') diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp index fe4c4ecf..0c59a31a 100644 --- a/src/libcamera/stream.cpp +++ b/src/libcamera/stream.cpp @@ -58,6 +58,28 @@ namespace libcamera { * \brief Requested number of buffers to allocate for the stream */ +/** + * \fn StreamConfiguration::stream() + * \brief Retrieve the stream associated with the configuration + * + * When a camera is configured with Camera::configure() Stream instances are + * associated with each stream configuration entry. This method retrieves the + * associated Stream, which remains valid until the next call to + * Camera::configure() or Camera::release(). + * + * \return The stream associated with the configuration + */ + +/** + * \fn StreamConfiguration::setStream() + * \brief Associate a stream with a configuration + * + * This method is meant for the PipelineHandler::configure() method and shall + * not be called by applications. + * + * \param[in] stream The stream + */ + /** * \brief Assemble and return a string describing the configuration * -- cgit v1.2.1