mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-08-03 14:49:29 +00:00
Adding intent broadcasts cli options from the client
This commit is contained in:
parent
02d9df5d71
commit
f5efc9c0d5
3 changed files with 18 additions and 0 deletions
|
@ -656,6 +656,7 @@ guess_record_format(const char *filename) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define OPT_RENDER_EXPIRED_FRAMES 1000
|
#define OPT_RENDER_EXPIRED_FRAMES 1000
|
||||||
#define OPT_WINDOW_TITLE 1001
|
#define OPT_WINDOW_TITLE 1001
|
||||||
#define OPT_PUSH_TARGET 1002
|
#define OPT_PUSH_TARGET 1002
|
||||||
|
@ -684,6 +685,7 @@ guess_record_format(const char *filename) {
|
||||||
#define OPT_ENCODER_NAME 1025
|
#define OPT_ENCODER_NAME 1025
|
||||||
#define OPT_POWER_OFF_ON_CLOSE 1026
|
#define OPT_POWER_OFF_ON_CLOSE 1026
|
||||||
#define OPT_V4L2_SINK 1027
|
#define OPT_V4L2_SINK 1027
|
||||||
|
#define OPT_INTENT_BROADCAST 1028
|
||||||
|
|
||||||
bool
|
bool
|
||||||
scrcpy_parse_args(struct scrcpy_cli_args *args, int argc, char *argv[]) {
|
scrcpy_parse_args(struct scrcpy_cli_args *args, int argc, char *argv[]) {
|
||||||
|
@ -739,6 +741,8 @@ scrcpy_parse_args(struct scrcpy_cli_args *args, int argc, char *argv[]) {
|
||||||
OPT_WINDOW_BORDERLESS},
|
OPT_WINDOW_BORDERLESS},
|
||||||
{"power-off-on-close", no_argument, NULL,
|
{"power-off-on-close", no_argument, NULL,
|
||||||
OPT_POWER_OFF_ON_CLOSE},
|
OPT_POWER_OFF_ON_CLOSE},
|
||||||
|
{"intent-broadcast", optional_argument, NULL,
|
||||||
|
OPT_INTENT_BROADCAST},
|
||||||
{NULL, 0, NULL, 0 },
|
{NULL, 0, NULL, 0 },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -917,6 +921,10 @@ scrcpy_parse_args(struct scrcpy_cli_args *args, int argc, char *argv[]) {
|
||||||
opts->v4l2_device = optarg;
|
opts->v4l2_device = optarg;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
case OPT_INTENT_BROADCAST:
|
||||||
|
opts->intent_broadcast = true;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
// getopt prints the error message on stderr
|
// getopt prints the error message on stderr
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -278,6 +278,7 @@ scrcpy(const struct scrcpy_options *options) {
|
||||||
.encoder_name = options->encoder_name,
|
.encoder_name = options->encoder_name,
|
||||||
.force_adb_forward = options->force_adb_forward,
|
.force_adb_forward = options->force_adb_forward,
|
||||||
.power_off_on_close = options->power_off_on_close,
|
.power_off_on_close = options->power_off_on_close,
|
||||||
|
.intent_broadcast = options->intent_broadcast,
|
||||||
};
|
};
|
||||||
if (!server_start(&s->server, ¶ms)) {
|
if (!server_start(&s->server, ¶ms)) {
|
||||||
goto end;
|
goto end;
|
||||||
|
|
|
@ -53,6 +53,13 @@ struct sc_port_range {
|
||||||
|
|
||||||
#define SC_WINDOW_POSITION_UNDEFINED (-0x8000)
|
#define SC_WINDOW_POSITION_UNDEFINED (-0x8000)
|
||||||
|
|
||||||
|
|
||||||
|
enum sc_intent_broadcast {
|
||||||
|
SC_INTENT_BROADCAST_START = 1 << 0,
|
||||||
|
SC_INTENT_BROADCAST_STOP = 1 << 31,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
struct scrcpy_options {
|
struct scrcpy_options {
|
||||||
const char *serial;
|
const char *serial;
|
||||||
const char *crop;
|
const char *crop;
|
||||||
|
@ -93,6 +100,7 @@ struct scrcpy_options {
|
||||||
bool forward_all_clicks;
|
bool forward_all_clicks;
|
||||||
bool legacy_paste;
|
bool legacy_paste;
|
||||||
bool power_off_on_close;
|
bool power_off_on_close;
|
||||||
|
bool intent_broadcast;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define SCRCPY_OPTIONS_DEFAULT { \
|
#define SCRCPY_OPTIONS_DEFAULT { \
|
||||||
|
@ -141,6 +149,7 @@ struct scrcpy_options {
|
||||||
.forward_all_clicks = false, \
|
.forward_all_clicks = false, \
|
||||||
.legacy_paste = false, \
|
.legacy_paste = false, \
|
||||||
.power_off_on_close = false, \
|
.power_off_on_close = false, \
|
||||||
|
.intent_broadcast = false, \
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue