@@ -35,10 +35,8 @@ private:
};
struct StreamConfiguration {
- StreamConfiguration()
- : stream_(nullptr)
- {
- }
+ StreamConfiguration();
+ StreamConfiguration(const StreamFormats &formats);
unsigned int pixelFormat;
Size size;
@@ -47,11 +45,13 @@ struct StreamConfiguration {
Stream *stream() const { return stream_; }
void setStream(Stream *stream) { stream_ = stream; }
+ const StreamFormats &formats() const { return formats_; }
std::string toString() const;
private:
Stream *stream_;
+ StreamFormats formats_;
};
enum StreamRole {
@@ -270,6 +270,19 @@ SizeRange StreamFormats::range(unsigned int pixelformat) const
* configured for a single video stream.
*/
+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 +323,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
*