Skip to content

Commit

Permalink
verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertvanheusden committed Jul 5, 2024
1 parent ceb55d4 commit 379b2db
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/list-libcamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

int main(int argc, char *argv[])
{
bool verbose = argc >=2 && strcmp(argv[1], "-v") == 0;

if (!verbose)
libcamera::logSetTarget(libcamera::LoggingTargetNone);

libcamera::CameraManager *lcm = new libcamera::CameraManager();

if (int rc = lcm->start(); rc != 0) {
Expand All @@ -16,9 +21,11 @@ int main(int argc, char *argv[])
for(auto camera : cams) {
printf("libcamera device: %s\n", camera.get()->id().c_str());

printf(" resolutions:\n");
for(auto & stream : camera.get()->streams())
printf(" %s\n", stream->configuration().toString().c_str());
if (verbose) {
printf(" resolutions:\n");
for(auto & stream : camera.get()->streams())
printf(" %s\n", stream->configuration().toString().c_str());
}
}

return 0;
Expand Down

0 comments on commit 379b2db

Please sign in to comment.