Remove deprecated options
This commit is contained in:
parent
21ceff6d45
commit
f126adb160
@ -1592,18 +1592,6 @@ parse_audio_output_buffer(const char *s, sc_tick *tick) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
|
||||||
parse_rotation(const char *s, uint8_t *rotation) {
|
|
||||||
long value;
|
|
||||||
bool ok = parse_integer_arg(s, &value, false, 0, 3, "rotation");
|
|
||||||
if (!ok) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
*rotation = (uint8_t) value;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
parse_orientation(const char *s, enum sc_orientation *orientation) {
|
parse_orientation(const char *s, enum sc_orientation *orientation) {
|
||||||
if (!strcmp(s, "0")) {
|
if (!strcmp(s, "0")) {
|
||||||
@ -2278,8 +2266,8 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
|
|||||||
opts->crop = optarg;
|
opts->crop = optarg;
|
||||||
break;
|
break;
|
||||||
case OPT_DISPLAY:
|
case OPT_DISPLAY:
|
||||||
LOGW("--display is deprecated, use --display-id instead.");
|
LOGE("--display has been removed, use --display-id instead.");
|
||||||
// fall through
|
return false;
|
||||||
case OPT_DISPLAY_ID:
|
case OPT_DISPLAY_ID:
|
||||||
if (!parse_display_id(optarg, &opts->display_id)) {
|
if (!parse_display_id(optarg, &opts->display_id)) {
|
||||||
return false;
|
return false;
|
||||||
@ -2367,8 +2355,9 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
|
|||||||
opts->control = false;
|
opts->control = false;
|
||||||
break;
|
break;
|
||||||
case OPT_NO_DISPLAY:
|
case OPT_NO_DISPLAY:
|
||||||
LOGW("--no-display is deprecated, use --no-playback instead.");
|
LOGE("--no-display has been removed, use --no-playback "
|
||||||
// fall through
|
"instead.");
|
||||||
|
return false;
|
||||||
case 'N':
|
case 'N':
|
||||||
opts->video_playback = false;
|
opts->video_playback = false;
|
||||||
opts->audio_playback = false;
|
opts->audio_playback = false;
|
||||||
@ -2454,32 +2443,9 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
|
|||||||
opts->key_inject_mode = SC_KEY_INJECT_MODE_RAW;
|
opts->key_inject_mode = SC_KEY_INJECT_MODE_RAW;
|
||||||
break;
|
break;
|
||||||
case OPT_ROTATION:
|
case OPT_ROTATION:
|
||||||
LOGW("--rotation is deprecated, use --display-orientation "
|
LOGE("--rotation has been removed, use --orientation or "
|
||||||
"instead.");
|
"--capture-orientation instead.");
|
||||||
uint8_t rotation;
|
|
||||||
if (!parse_rotation(optarg, &rotation)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
assert(rotation <= 3);
|
|
||||||
switch (rotation) {
|
|
||||||
case 0:
|
|
||||||
opts->display_orientation = SC_ORIENTATION_0;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
// rotation 1 was 90° counterclockwise, but orientation
|
|
||||||
// is expressed clockwise
|
|
||||||
opts->display_orientation = SC_ORIENTATION_270;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
opts->display_orientation = SC_ORIENTATION_180;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
// rotation 3 was 270° counterclockwise, but orientation
|
|
||||||
// is expressed clockwise
|
|
||||||
opts->display_orientation = SC_ORIENTATION_90;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case OPT_DISPLAY_ORIENTATION:
|
case OPT_DISPLAY_ORIENTATION:
|
||||||
if (!parse_orientation(optarg, &opts->display_orientation)) {
|
if (!parse_orientation(optarg, &opts->display_orientation)) {
|
||||||
return false;
|
return false;
|
||||||
@ -2540,23 +2506,9 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case OPT_FORWARD_ALL_CLICKS:
|
case OPT_FORWARD_ALL_CLICKS:
|
||||||
LOGW("--forward-all-clicks is deprecated, "
|
LOGE("--forward-all-clicks has been removed, "
|
||||||
"use --mouse-bind=++++ instead.");
|
"use --mouse-bind=++++ instead.");
|
||||||
opts->mouse_bindings = (struct sc_mouse_bindings) {
|
return false;
|
||||||
.pri = {
|
|
||||||
.right_click = SC_MOUSE_BINDING_CLICK,
|
|
||||||
.middle_click = SC_MOUSE_BINDING_CLICK,
|
|
||||||
.click4 = SC_MOUSE_BINDING_CLICK,
|
|
||||||
.click5 = SC_MOUSE_BINDING_CLICK,
|
|
||||||
},
|
|
||||||
.sec = {
|
|
||||||
.right_click = SC_MOUSE_BINDING_CLICK,
|
|
||||||
.middle_click = SC_MOUSE_BINDING_CLICK,
|
|
||||||
.click4 = SC_MOUSE_BINDING_CLICK,
|
|
||||||
.click5 = SC_MOUSE_BINDING_CLICK,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
break;
|
|
||||||
case OPT_LEGACY_PASTE:
|
case OPT_LEGACY_PASTE:
|
||||||
opts->legacy_paste = true;
|
opts->legacy_paste = true;
|
||||||
break;
|
break;
|
||||||
@ -2564,9 +2516,9 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
|
|||||||
opts->power_off_on_close = true;
|
opts->power_off_on_close = true;
|
||||||
break;
|
break;
|
||||||
case OPT_DISPLAY_BUFFER:
|
case OPT_DISPLAY_BUFFER:
|
||||||
LOGW("--display-buffer is deprecated, use --video-buffer "
|
LOGE("--display-buffer has been removed, use --video-buffer "
|
||||||
"instead.");
|
"instead.");
|
||||||
// fall through
|
return false;
|
||||||
case OPT_VIDEO_BUFFER:
|
case OPT_VIDEO_BUFFER:
|
||||||
if (!parse_buffering_time(optarg, &opts->video_buffer)) {
|
if (!parse_buffering_time(optarg, &opts->video_buffer)) {
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user