cam: Rename conf variable referring to command line option to opt
Naming a variable that refers to command line options 'conf' is confusing as we using 'config' and 'cfg' to refer to camera and stream configurations. Rename it to 'opt'. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
parent
2b1a908b52
commit
8d846ed8a7
1 changed files with 13 additions and 13 deletions
|
@ -98,19 +98,19 @@ static std::unique_ptr<CameraConfiguration> prepareCameraConfig()
|
||||||
|
|
||||||
/* Use roles and get a default configuration. */
|
/* Use roles and get a default configuration. */
|
||||||
for (auto const &value : streamOptions) {
|
for (auto const &value : streamOptions) {
|
||||||
KeyValueParser::Options conf = value.toKeyValues();
|
KeyValueParser::Options opt = value.toKeyValues();
|
||||||
|
|
||||||
if (!conf.isSet("role")) {
|
if (!opt.isSet("role")) {
|
||||||
roles.push_back(StreamRole::VideoRecording);
|
roles.push_back(StreamRole::VideoRecording);
|
||||||
} else if (conf["role"].toString() == "viewfinder") {
|
} else if (opt["role"].toString() == "viewfinder") {
|
||||||
roles.push_back(StreamRole::Viewfinder);
|
roles.push_back(StreamRole::Viewfinder);
|
||||||
} else if (conf["role"].toString() == "video") {
|
} else if (opt["role"].toString() == "video") {
|
||||||
roles.push_back(StreamRole::VideoRecording);
|
roles.push_back(StreamRole::VideoRecording);
|
||||||
} else if (conf["role"].toString() == "still") {
|
} else if (opt["role"].toString() == "still") {
|
||||||
roles.push_back(StreamRole::StillCapture);
|
roles.push_back(StreamRole::StillCapture);
|
||||||
} else {
|
} else {
|
||||||
std::cerr << "Unknown stream role "
|
std::cerr << "Unknown stream role "
|
||||||
<< conf["role"].toString() << std::endl;
|
<< opt["role"].toString() << std::endl;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -125,18 +125,18 @@ static std::unique_ptr<CameraConfiguration> prepareCameraConfig()
|
||||||
/* Apply configuration explicitly requested. */
|
/* Apply configuration explicitly requested. */
|
||||||
unsigned int i = 0;
|
unsigned int i = 0;
|
||||||
for (auto const &value : streamOptions) {
|
for (auto const &value : streamOptions) {
|
||||||
KeyValueParser::Options conf = value.toKeyValues();
|
KeyValueParser::Options opt = value.toKeyValues();
|
||||||
StreamConfiguration &cfg = config->at(i++);
|
StreamConfiguration &cfg = config->at(i++);
|
||||||
|
|
||||||
if (conf.isSet("width"))
|
if (opt.isSet("width"))
|
||||||
cfg.size.width = conf["width"];
|
cfg.size.width = opt["width"];
|
||||||
|
|
||||||
if (conf.isSet("height"))
|
if (opt.isSet("height"))
|
||||||
cfg.size.height = conf["height"];
|
cfg.size.height = opt["height"];
|
||||||
|
|
||||||
/* TODO: Translate 4CC string to ID. */
|
/* TODO: Translate 4CC string to ID. */
|
||||||
if (conf.isSet("pixelformat"))
|
if (opt.isSet("pixelformat"))
|
||||||
cfg.pixelFormat = conf["pixelformat"];
|
cfg.pixelFormat = opt["pixelformat"];
|
||||||
}
|
}
|
||||||
|
|
||||||
return config;
|
return config;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue