mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-04-20 03:25:03 +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 version;
|
||||
SDL_bool show_touches;
|
||||
SDL_bool fullscreen;
|
||||
Uint16 port;
|
||||
Uint16 max_size;
|
||||
Uint32 bit_rate;
|
||||
|
@ -57,6 +58,9 @@ static void usage(const char *arg0) {
|
|||
" Enable \"show touches\" on start, disable on quit.\n"
|
||||
" It only shows physical touches (not clicks from scrcpy).\n"
|
||||
"\n"
|
||||
" -f, --fullscreen\n"
|
||||
" Start the app in fullscreen.\n"
|
||||
"\n"
|
||||
" -v, --version\n"
|
||||
" Print the version of scrcpy.\n"
|
||||
"\n"
|
||||
|
@ -205,11 +209,12 @@ static SDL_bool parse_args(struct args *args, int argc, char *argv[]) {
|
|||
{"port", required_argument, NULL, 'p'},
|
||||
{"serial", required_argument, NULL, 's'},
|
||||
{"show-touches", no_argument, NULL, 't'},
|
||||
{"fullscreen", no_argument, NULL, 'f'},
|
||||
{"version", no_argument, NULL, 'v'},
|
||||
{NULL, 0, NULL, 0 },
|
||||
};
|
||||
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) {
|
||||
case 'b':
|
||||
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':
|
||||
args->show_touches = SDL_TRUE;
|
||||
break;
|
||||
case 'f':
|
||||
args->fullscreen = SDL_TRUE;
|
||||
break;
|
||||
case 'v':
|
||||
args->version = SDL_TRUE;
|
||||
break;
|
||||
|
@ -305,6 +313,7 @@ int main(int argc, char *argv[]) {
|
|||
.max_size = args.max_size,
|
||||
.bit_rate = args.bit_rate,
|
||||
.show_touches = args.show_touches,
|
||||
.fullscreen = args.fullscreen,
|
||||
};
|
||||
int res = scrcpy(&options) ? 0 : 1;
|
||||
|
||||
|
|
|
@ -210,6 +210,10 @@ SDL_bool scrcpy(const struct scrcpy_options *options) {
|
|||
wait_show_touches(proc_show_touches);
|
||||
show_touches_waited = SDL_TRUE;
|
||||
}
|
||||
|
||||
if (options->fullscreen) {
|
||||
screen_switch_fullscreen(input_manager.screen);
|
||||
}
|
||||
|
||||
ret = event_loop();
|
||||
LOGD("quit...");
|
||||
|
|
|
@ -10,6 +10,7 @@ struct scrcpy_options {
|
|||
Uint16 max_size;
|
||||
Uint32 bit_rate;
|
||||
SDL_bool show_touches;
|
||||
SDL_bool fullscreen;
|
||||
};
|
||||
|
||||
SDL_bool scrcpy(const struct scrcpy_options *options);
|
||||
|
|
Loading…
Add table
Reference in a new issue