@@ -21,6 +21,7 @@ namespace libcamera {
class Camera;
class Stream;
+enum class StreamRole;
class StreamFormats
{
@@ -50,6 +51,7 @@ struct StreamConfiguration {
std::optional<ColorSpace> colorSpace;
+ StreamRole role;
Stream *stream() const { return stream_; }
void setStream(Stream *stream) { stream_ = stream; }
const StreamFormats &formats() const { return formats_; }
@@ -281,7 +281,7 @@ SizeRange StreamFormats::range(const PixelFormat &pixelformat) const
*/
StreamConfiguration::StreamConfiguration()
: pixelFormat(0), stride(0), frameSize(0), bufferCount(0),
- stream_(nullptr)
+ role(StreamRole::Viewfinder), stream_(nullptr)
{
}
@@ -290,7 +290,7 @@ StreamConfiguration::StreamConfiguration()
*/
StreamConfiguration::StreamConfiguration(const StreamFormats &formats)
: pixelFormat(0), stride(0), frameSize(0), bufferCount(0),
- stream_(nullptr), formats_(formats)
+ role(StreamRole::Viewfinder), stream_(nullptr), formats_(formats)
{
}
@@ -350,6 +350,14 @@ StreamConfiguration::StreamConfiguration(const StreamFormats &formats)
* color spaces can be supported and in what combinations.
*/
+/**
+ * \var StreamConfiguration::role
+ * \brief The StreamRole that this StreamConfiguration should be set to
+ *
+ * Some applications may want to assign a StreamConfiguration to a certain
+ * role of Stream.
+ */
+
/**
* \fn StreamConfiguration::stream()
* \brief Retrieve the stream associated with the configuration