mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-08-03 14:49:29 +00:00
Merge 1035653d4a
into fdbb725436
This commit is contained in:
commit
68d728858f
3 changed files with 15 additions and 1 deletions
|
@ -14,6 +14,7 @@ struct args {
|
||||||
SDL_bool help;
|
SDL_bool help;
|
||||||
SDL_bool version;
|
SDL_bool version;
|
||||||
SDL_bool show_touches;
|
SDL_bool show_touches;
|
||||||
|
SDL_bool fullscreen;
|
||||||
Uint16 port;
|
Uint16 port;
|
||||||
Uint16 max_size;
|
Uint16 max_size;
|
||||||
Uint32 bit_rate;
|
Uint32 bit_rate;
|
||||||
|
@ -57,6 +58,9 @@ static void usage(const char *arg0) {
|
||||||
" Enable \"show touches\" on start, disable on quit.\n"
|
" Enable \"show touches\" on start, disable on quit.\n"
|
||||||
" It only shows physical touches (not clicks from scrcpy).\n"
|
" It only shows physical touches (not clicks from scrcpy).\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
" -f, --fullscreen\n"
|
||||||
|
" Start the app in fullscreen.\n"
|
||||||
|
"\n"
|
||||||
" -v, --version\n"
|
" -v, --version\n"
|
||||||
" Print the version of scrcpy.\n"
|
" Print the version of scrcpy.\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
@ -205,11 +209,12 @@ static SDL_bool parse_args(struct args *args, int argc, char *argv[]) {
|
||||||
{"port", required_argument, NULL, 'p'},
|
{"port", required_argument, NULL, 'p'},
|
||||||
{"serial", required_argument, NULL, 's'},
|
{"serial", required_argument, NULL, 's'},
|
||||||
{"show-touches", no_argument, NULL, 't'},
|
{"show-touches", no_argument, NULL, 't'},
|
||||||
|
{"fullscreen", no_argument, NULL, 'f'},
|
||||||
{"version", no_argument, NULL, 'v'},
|
{"version", no_argument, NULL, 'v'},
|
||||||
{NULL, 0, NULL, 0 },
|
{NULL, 0, NULL, 0 },
|
||||||
};
|
};
|
||||||
int c;
|
int c;
|
||||||
while ((c = getopt_long(argc, argv, "b:c:hm:p:s:tv", long_options, NULL)) != -1) {
|
while ((c = getopt_long(argc, argv, "b:c:hm:p:s:tfv", long_options, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'b':
|
case 'b':
|
||||||
if (!parse_bit_rate(optarg, &args->bit_rate)) {
|
if (!parse_bit_rate(optarg, &args->bit_rate)) {
|
||||||
|
@ -238,6 +243,9 @@ static SDL_bool parse_args(struct args *args, int argc, char *argv[]) {
|
||||||
case 't':
|
case 't':
|
||||||
args->show_touches = SDL_TRUE;
|
args->show_touches = SDL_TRUE;
|
||||||
break;
|
break;
|
||||||
|
case 'f':
|
||||||
|
args->fullscreen = SDL_TRUE;
|
||||||
|
break;
|
||||||
case 'v':
|
case 'v':
|
||||||
args->version = SDL_TRUE;
|
args->version = SDL_TRUE;
|
||||||
break;
|
break;
|
||||||
|
@ -305,6 +313,7 @@ int main(int argc, char *argv[]) {
|
||||||
.max_size = args.max_size,
|
.max_size = args.max_size,
|
||||||
.bit_rate = args.bit_rate,
|
.bit_rate = args.bit_rate,
|
||||||
.show_touches = args.show_touches,
|
.show_touches = args.show_touches,
|
||||||
|
.fullscreen = args.fullscreen,
|
||||||
};
|
};
|
||||||
int res = scrcpy(&options) ? 0 : 1;
|
int res = scrcpy(&options) ? 0 : 1;
|
||||||
|
|
||||||
|
|
|
@ -210,6 +210,10 @@ SDL_bool scrcpy(const struct scrcpy_options *options) {
|
||||||
wait_show_touches(proc_show_touches);
|
wait_show_touches(proc_show_touches);
|
||||||
show_touches_waited = SDL_TRUE;
|
show_touches_waited = SDL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options->fullscreen) {
|
||||||
|
screen_switch_fullscreen(input_manager.screen);
|
||||||
|
}
|
||||||
|
|
||||||
ret = event_loop();
|
ret = event_loop();
|
||||||
LOGD("quit...");
|
LOGD("quit...");
|
||||||
|
|
|
@ -10,6 +10,7 @@ struct scrcpy_options {
|
||||||
Uint16 max_size;
|
Uint16 max_size;
|
||||||
Uint32 bit_rate;
|
Uint32 bit_rate;
|
||||||
SDL_bool show_touches;
|
SDL_bool show_touches;
|
||||||
|
SDL_bool fullscreen;
|
||||||
};
|
};
|
||||||
|
|
||||||
SDL_bool scrcpy(const struct scrcpy_options *options);
|
SDL_bool scrcpy(const struct scrcpy_options *options);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue