summaryrefslogtreecommitdiff
path: root/src/cam/stream_options.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-08-23 17:37:11 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-08-26 01:04:27 +0300
commit951522c1795485d122fb317ef6fe7f25a853008f (patch)
tree33006071c259fa54d9af2812a916ab94b2e45977 /src/cam/stream_options.cpp
parent555d27ce58cd6eeb050f7201ae67c4cd88607fc4 (diff)
cam: Add color space support
Add support for color space to the StreamKeyValueParser, allowing selection of a color space on the command line. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Diffstat (limited to 'src/cam/stream_options.cpp')
-rw-r--r--src/cam/stream_options.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cam/stream_options.cpp b/src/cam/stream_options.cpp
index a68135a9..3a5625f5 100644
--- a/src/cam/stream_options.cpp
+++ b/src/cam/stream_options.cpp
@@ -8,6 +8,8 @@
#include <iostream>
+#include <libcamera/color_space.h>
+
using namespace libcamera;
StreamKeyValueParser::StreamKeyValueParser()
@@ -21,6 +23,8 @@ StreamKeyValueParser::StreamKeyValueParser()
ArgumentRequired);
addOption("pixelformat", OptionString, "Pixel format name",
ArgumentRequired);
+ addOption("colorspace", OptionString, "Color space",
+ ArgumentRequired);
}
KeyValueParser::Options StreamKeyValueParser::parse(const char *arguments)
@@ -96,6 +100,9 @@ int StreamKeyValueParser::updateConfiguration(CameraConfiguration *config,
if (opts.isSet("pixelformat"))
cfg.pixelFormat = PixelFormat::fromString(opts["pixelformat"].toString());
+
+ if (opts.isSet("colorspace"))
+ cfg.colorSpace = ColorSpace::fromString(opts["colorspace"].toString());
}
return 0;