2
0
mirror of https://github.com/Genymobile/scrcpy synced 2025-08-31 22:35:37 +00:00

Add --list-cameras

Add an option to list the device cameras.

PR #4213 <https://github.com/Genymobile/scrcpy/pull/4213>

Co-authored-by: Romain Vimont <rom@rom1v.com>
Signed-off-by: Romain Vimont <rom@rom1v.com>
This commit is contained in:
Simon Chan
2023-07-16 17:07:19 +08:00
committed by Romain Vimont
parent f085765e04
commit cd63896d63
11 changed files with 101 additions and 4 deletions

View File

@@ -81,6 +81,7 @@ enum {
OPT_KILL_ADB_ON_CLOSE,
OPT_TIME_LIMIT,
OPT_PAUSE_ON_EXIT,
OPT_LIST_CAMERAS,
};
struct sc_option {
@@ -320,6 +321,11 @@ static const struct sc_option options[] = {
"This is a workaround for some devices not behaving as "
"expected when setting the device clipboard programmatically.",
},
{
.longopt_id = OPT_LIST_CAMERAS,
.longopt = "list-cameras",
.text = "List device cameras.",
},
{
.longopt_id = OPT_LIST_DISPLAYS,
.longopt = "list-displays",
@@ -1998,6 +2004,9 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
case OPT_LIST_DISPLAYS:
opts->list |= SC_OPTION_LIST_DISPLAYS;
break;
case OPT_LIST_CAMERAS:
opts->list |= SC_OPTION_LIST_CAMERAS;
break;
case OPT_REQUIRE_AUDIO:
opts->require_audio = true;
break;