From patchwork Wed May 22 22:12:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 1264 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6637560103 for ; Thu, 23 May 2019 00:12:32 +0200 (CEST) Received: from pendragon.bb.dnainternet.fi (dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E76CD443 for ; Thu, 23 May 2019 00:12:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1558563151; bh=JfbuY1cQ7hAVZsVREBLpkFblFJC4uznc4+BdJxKaraQ=; h=From:To:Subject:Date:From; b=vSdQ3HttJsDwu823TjpV3zRAcHdFnC7IHihcPSXq1y9VeM8svcsyXltgh/NOZAo7s Wu4o8Zm4NXOIaKDJjGjleXNudHqCstSTUCnPiq80M7s+kucOjN9UR34K8UC6FVYeTW 3/UxMUJSTMFO1ErKZuUgUvqO8UvNO+kHLKLKF3GY= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Thu, 23 May 2019 01:12:10 +0300 Message-Id: <20190522221210.19257-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] cam: Rename conf variable referring to command line option to opt X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2019 22:12:32 -0000 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 Reviewed-by: Jacopo Mondi Reviewed-by: Kieran Bingham --- src/cam/main.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/cam/main.cpp b/src/cam/main.cpp index 5ecd7e0e38d7..4155889678ce 100644 --- a/src/cam/main.cpp +++ b/src/cam/main.cpp @@ -98,19 +98,19 @@ static std::unique_ptr prepareCameraConfig() /* Use roles and get a default configuration. */ 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); - } else if (conf["role"].toString() == "viewfinder") { + } else if (opt["role"].toString() == "viewfinder") { roles.push_back(StreamRole::Viewfinder); - } else if (conf["role"].toString() == "video") { + } else if (opt["role"].toString() == "video") { roles.push_back(StreamRole::VideoRecording); - } else if (conf["role"].toString() == "still") { + } else if (opt["role"].toString() == "still") { roles.push_back(StreamRole::StillCapture); } else { std::cerr << "Unknown stream role " - << conf["role"].toString() << std::endl; + << opt["role"].toString() << std::endl; return nullptr; } } @@ -125,18 +125,18 @@ static std::unique_ptr prepareCameraConfig() /* Apply configuration explicitly requested. */ unsigned int i = 0; for (auto const &value : streamOptions) { - KeyValueParser::Options conf = value.toKeyValues(); + KeyValueParser::Options opt = value.toKeyValues(); StreamConfiguration &cfg = config->at(i++); - if (conf.isSet("width")) - cfg.size.width = conf["width"]; + if (opt.isSet("width")) + cfg.size.width = opt["width"]; - if (conf.isSet("height")) - cfg.size.height = conf["height"]; + if (opt.isSet("height")) + cfg.size.height = opt["height"]; /* TODO: Translate 4CC string to ID. */ - if (conf.isSet("pixelformat")) - cfg.pixelFormat = conf["pixelformat"]; + if (opt.isSet("pixelformat")) + cfg.pixelFormat = opt["pixelformat"]; } return config;