mirror of
https://github.com/Genymobile/scrcpy
synced 2025-08-31 14:25:56 +00:00
Add --orientation
Add a shortcut to set both the display and record orientations. PR #4441 <https://github.com/Genymobile/scrcpy/pull/4441>
This commit is contained in:
@@ -92,6 +92,7 @@ enum {
|
||||
OPT_CAMERA_HIGH_SPEED,
|
||||
OPT_DISPLAY_ORIENTATION,
|
||||
OPT_RECORD_ORIENTATION,
|
||||
OPT_ORIENTATION,
|
||||
};
|
||||
|
||||
struct sc_option {
|
||||
@@ -525,6 +526,13 @@ static const struct sc_option options[] = {
|
||||
.longopt = "no-video-playback",
|
||||
.text = "Disable video playback on the computer.",
|
||||
},
|
||||
{
|
||||
.longopt_id = OPT_ORIENTATION,
|
||||
.longopt = "orientation",
|
||||
.argdesc = "value",
|
||||
.text = "Same as --display-orientation=value "
|
||||
"--record-orientation=value.",
|
||||
},
|
||||
{
|
||||
.longopt_id = OPT_OTG,
|
||||
.longopt = "otg",
|
||||
@@ -2146,6 +2154,14 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case OPT_ORIENTATION:
|
||||
enum sc_orientation orientation;
|
||||
if (!parse_orientation(optarg, &orientation)) {
|
||||
return false;
|
||||
}
|
||||
opts->display_orientation = orientation;
|
||||
opts->record_orientation = orientation;
|
||||
break;
|
||||
case OPT_RENDER_DRIVER:
|
||||
opts->render_driver = optarg;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user