apps: cam: Print control direction information
Now that there is support for retrieving the allowed directions of a control, print this information when listing controls. Sample output: $ cam --list-controls -c 2 Using camera Virtual0 as cam0 Control: [inout] draft::FaceDetectMode: - FaceDetectModeOff (0) Control: [inout] libcamera::FrameDurationLimits: [16666..33333] Size: 2 Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
34d7b4776b
commit
936a099eca
1 changed files with 8 additions and 2 deletions
|
@ -159,12 +159,18 @@ CameraSession::~CameraSession()
|
||||||
void CameraSession::listControls() const
|
void CameraSession::listControls() const
|
||||||
{
|
{
|
||||||
for (const auto &[id, info] : camera_->controls()) {
|
for (const auto &[id, info] : camera_->controls()) {
|
||||||
|
std::stringstream io;
|
||||||
|
io << "["
|
||||||
|
<< (id->isInput() ? "in" : " ")
|
||||||
|
<< (id->isOutput() ? "out" : " ")
|
||||||
|
<< "] ";
|
||||||
|
|
||||||
if (info.values().empty()) {
|
if (info.values().empty()) {
|
||||||
std::cout << "Control: "
|
std::cout << "Control: " << io.str()
|
||||||
<< id->vendor() << "::" << id->name() << ": "
|
<< id->vendor() << "::" << id->name() << ": "
|
||||||
<< info.toString() << std::endl;
|
<< info.toString() << std::endl;
|
||||||
} else {
|
} else {
|
||||||
std::cout << "Control: "
|
std::cout << "Control: " << io.str()
|
||||||
<< id->vendor() << "::" << id->name() << ":"
|
<< id->vendor() << "::" << id->name() << ":"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
for (const auto &value : info.values()) {
|
for (const auto &value : info.values()) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue