From a50289642948239722b0f45b2df097df20d43ae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Sun, 26 May 2019 02:31:39 +0200 Subject: libcamera: stream: StreamConfiguration: Add StreamFormats information MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allow StreamFormats to be associated to a StreamConfiguration. The intention is that pipeline handlers should associate formats to a StreamConfiguration when it's created in generateConfiguration(). Signed-off-by: Niklas Söderlund Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/libcamera/stream.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/libcamera/stream.cpp') diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp index 3398c597..d60f8324 100644 --- a/src/libcamera/stream.cpp +++ b/src/libcamera/stream.cpp @@ -270,6 +270,23 @@ SizeRange StreamFormats::range(unsigned int pixelformat) const * configured for a single video stream. */ +/** + * \todo This method is deprecated and should be removed once all pipeline + * handlers provied StreamFormats. + */ +StreamConfiguration::StreamConfiguration() + : stream_(nullptr) +{ +} + +/** + * \brief Construct a configuration with stream formats + */ +StreamConfiguration::StreamConfiguration(const StreamFormats &formats) + : stream_(nullptr), formats_(formats) +{ +} + /** * \var StreamConfiguration::size * \brief Stream size in pixels @@ -310,6 +327,18 @@ SizeRange StreamFormats::range(unsigned int pixelformat) const * \param[in] stream The stream */ +/** + * \fn StreamConfiguration::formats() + * \brief Retrieve advisory stream format information + * + * This method retrieves information about the pixel formats and sizes supported + * by the stream configuration. The sizes are advisory and not all of them are + * guaranteed to be supported by the stream. Users shall always inspect the size + * in the stream configuration after calling CameraConfiguration::validate(). + * + * \return Stream formats information + */ + /** * \brief Assemble and return a string describing the configuration * -- cgit v1.2.1