From a40023e6cc005dfc57cc535167ee44761f3ed9f6 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 28 Apr 2019 16:42:12 +0300 Subject: libcamera: Use stream roles directly instead of StreamUsage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In order to prepare for an API overhall of the camera configuration generation, remove the StreamUsage class and replace its uses by stream roles. The size hints can't be specified anymore, and will be replaced with an API on the StreamConfiguration to negotiate configuration parameters with cameras. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund Reviewed-by: Jacopo Mondi --- src/cam/main.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/cam/main.cpp') diff --git a/src/cam/main.cpp b/src/cam/main.cpp index 6a2508dd..d603228c 100644 --- a/src/cam/main.cpp +++ b/src/cam/main.cpp @@ -87,13 +87,13 @@ static int parseOptions(int argc, char *argv[]) static int prepareCameraConfig(CameraConfiguration *config) { - std::vector roles; + StreamRoles roles; streamInfo.clear(); /* If no configuration is provided assume a single video stream. */ if (!options.isSet(OptStream)) { - *config = camera->generateConfiguration({ Stream::VideoRecording() }); + *config = camera->generateConfiguration({ StreamRole::VideoRecording }); streamInfo[config->front()] = "stream0"; return 0; } @@ -106,14 +106,13 @@ static int prepareCameraConfig(CameraConfiguration *config) KeyValueParser::Options conf = value.toKeyValues(); if (!conf.isSet("role")) { - roles.push_back(Stream::VideoRecording()); + roles.push_back(StreamRole::VideoRecording); } else if (conf["role"].toString() == "viewfinder") { - roles.push_back(Stream::Viewfinder(conf["width"], - conf["height"])); + roles.push_back(StreamRole::Viewfinder); } else if (conf["role"].toString() == "video") { - roles.push_back(Stream::VideoRecording()); + roles.push_back(StreamRole::VideoRecording); } else if (conf["role"].toString() == "still") { - roles.push_back(Stream::StillCapture()); + roles.push_back(StreamRole::StillCapture); } else { std::cerr << "Unknown stream role " << conf["role"].toString() << std::endl; -- cgit v1.2.1