mirror of
https://github.com/Genymobile/scrcpy
synced 2025-09-01 14:55:13 +00:00
Add --print-fps to enable FPS counter on start
The FPS counter could be enabled/disabled via MOD+i. Add a command line option to enable it on start. This is consistent with other features like --turn-screen-off or --fullscreen. Fixes #468 <https://github.com/Genymobile/scrcpy/issues/468> PR #3030 <https://github.com/Genymobile/scrcpy/pull/3030>
This commit is contained in:
@@ -55,6 +55,7 @@
|
||||
#define OPT_NO_DOWNSIZE_ON_ERROR 1035
|
||||
#define OPT_OTG 1036
|
||||
#define OPT_NO_CLEANUP 1037
|
||||
#define OPT_PRINT_FPS 1038
|
||||
|
||||
struct sc_option {
|
||||
char shortopt;
|
||||
@@ -336,6 +337,12 @@ static const struct sc_option options[] = {
|
||||
"special character, but breaks the expected behavior of alpha "
|
||||
"keys in games (typically WASD).",
|
||||
},
|
||||
{
|
||||
.longopt_id = OPT_PRINT_FPS,
|
||||
.longopt = "print-fps",
|
||||
.text = "Start FPS counter, to print framerate logs to the console. "
|
||||
"It can be started or stopped at any time with MOD+i.",
|
||||
},
|
||||
{
|
||||
.longopt_id = OPT_PUSH_TARGET,
|
||||
.longopt = "push-target",
|
||||
@@ -1547,6 +1554,9 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
|
||||
case OPT_NO_CLEANUP:
|
||||
opts->cleanup = false;
|
||||
break;
|
||||
case OPT_PRINT_FPS:
|
||||
opts->start_fps_counter = true;
|
||||
break;
|
||||
case OPT_OTG:
|
||||
#ifdef HAVE_USB
|
||||
opts->otg = true;
|
||||
|
Reference in New Issue
Block a user