mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-08-04 07:09:06 +00:00
Adding to client.
This commit is contained in:
parent
a14840a515
commit
323f2a1bd8
6 changed files with 28 additions and 6 deletions
|
@ -176,6 +176,14 @@ Set the initial window height.
|
||||||
|
|
||||||
Default is 0 (automatic).\n
|
Default is 0 (automatic).\n
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.BI "\-\-\codec\-options " 'options'
|
||||||
|
options is a list of key=value:type pairs seperated by comma\n
|
||||||
|
for the device encoder.\n
|
||||||
|
type is optional, Integer by default.\n
|
||||||
|
For a list of possible codec options:\n
|
||||||
|
developer.android.com/reference/android/media/MediaFormat\n
|
||||||
|
|
||||||
.SH SHORTCUTS
|
.SH SHORTCUTS
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
|
|
|
@ -158,6 +158,13 @@ scrcpy_print_usage(const char *arg0) {
|
||||||
" Set the initial window width.\n"
|
" Set the initial window width.\n"
|
||||||
" Default is 0 (automatic).\n"
|
" Default is 0 (automatic).\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
" --codec-options 'options'\n"
|
||||||
|
" 'options' is a list of key=value:type pairs seperated by comma\n"
|
||||||
|
" for the device encoder.\n"
|
||||||
|
" 'type' is optional, Integer by default.\n"
|
||||||
|
" For a list of possible codec options:\n"
|
||||||
|
" developer.android.com/reference/android/media/MediaFormat\n"
|
||||||
|
"\n"
|
||||||
"Shortcuts:\n"
|
"Shortcuts:\n"
|
||||||
"\n"
|
"\n"
|
||||||
" " CTRL_OR_CMD "+f\n"
|
" " CTRL_OR_CMD "+f\n"
|
||||||
|
@ -468,18 +475,19 @@ guess_record_format(const char *filename) {
|
||||||
#define OPT_ROTATION 1015
|
#define OPT_ROTATION 1015
|
||||||
#define OPT_RENDER_DRIVER 1016
|
#define OPT_RENDER_DRIVER 1016
|
||||||
#define OPT_NO_MIPMAPS 1017
|
#define OPT_NO_MIPMAPS 1017
|
||||||
|
#define OPT_CODEC_OPTIONS 1018
|
||||||
|
|
||||||
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[]) {
|
||||||
static const struct option long_options[] = {
|
static const struct option long_options[] = {
|
||||||
{"always-on-top", no_argument, NULL, OPT_ALWAYS_ON_TOP},
|
{"always-on-top", no_argument, NULL, OPT_ALWAYS_ON_TOP},
|
||||||
{"bit-rate", required_argument, NULL, 'b'},
|
{"bit-rate", required_argument, NULL, 'b'},
|
||||||
|
{"codec-options", required_argument, NULL, OPT_CODEC_OPTIONS},
|
||||||
{"crop", required_argument, NULL, OPT_CROP},
|
{"crop", required_argument, NULL, OPT_CROP},
|
||||||
{"display", required_argument, NULL, OPT_DISPLAY_ID},
|
{"display", required_argument, NULL, OPT_DISPLAY_ID},
|
||||||
{"fullscreen", no_argument, NULL, 'f'},
|
{"fullscreen", no_argument, NULL, 'f'},
|
||||||
{"help", no_argument, NULL, 'h'},
|
{"help", no_argument, NULL, 'h'},
|
||||||
{"lock-video-orientation", required_argument, NULL,
|
{"lock-video-orientation", required_argument, NULL, OPT_LOCK_VIDEO_ORIENTATION},
|
||||||
OPT_LOCK_VIDEO_ORIENTATION},
|
|
||||||
{"max-fps", required_argument, NULL, OPT_MAX_FPS},
|
{"max-fps", required_argument, NULL, OPT_MAX_FPS},
|
||||||
{"max-size", required_argument, NULL, 'm'},
|
{"max-size", required_argument, NULL, 'm'},
|
||||||
{"no-control", no_argument, NULL, 'n'},
|
{"no-control", no_argument, NULL, 'n'},
|
||||||
|
@ -490,8 +498,7 @@ scrcpy_parse_args(struct scrcpy_cli_args *args, int argc, char *argv[]) {
|
||||||
{"record", required_argument, NULL, 'r'},
|
{"record", required_argument, NULL, 'r'},
|
||||||
{"record-format", required_argument, NULL, OPT_RECORD_FORMAT},
|
{"record-format", required_argument, NULL, OPT_RECORD_FORMAT},
|
||||||
{"render-driver", required_argument, NULL, OPT_RENDER_DRIVER},
|
{"render-driver", required_argument, NULL, OPT_RENDER_DRIVER},
|
||||||
{"render-expired-frames", no_argument, NULL,
|
{"render-expired-frames", no_argument, NULL, OPT_RENDER_EXPIRED_FRAMES},
|
||||||
OPT_RENDER_EXPIRED_FRAMES},
|
|
||||||
{"rotation", required_argument, NULL, OPT_ROTATION},
|
{"rotation", required_argument, NULL, OPT_ROTATION},
|
||||||
{"serial", required_argument, NULL, 's'},
|
{"serial", required_argument, NULL, 's'},
|
||||||
{"show-touches", no_argument, NULL, 't'},
|
{"show-touches", no_argument, NULL, 't'},
|
||||||
|
@ -503,8 +510,7 @@ scrcpy_parse_args(struct scrcpy_cli_args *args, int argc, char *argv[]) {
|
||||||
{"window-y", required_argument, NULL, OPT_WINDOW_Y},
|
{"window-y", required_argument, NULL, OPT_WINDOW_Y},
|
||||||
{"window-width", required_argument, NULL, OPT_WINDOW_WIDTH},
|
{"window-width", required_argument, NULL, OPT_WINDOW_WIDTH},
|
||||||
{"window-height", required_argument, NULL, OPT_WINDOW_HEIGHT},
|
{"window-height", required_argument, NULL, OPT_WINDOW_HEIGHT},
|
||||||
{"window-borderless", no_argument, NULL,
|
{"window-borderless", no_argument, NULL, OPT_WINDOW_BORDERLESS},
|
||||||
OPT_WINDOW_BORDERLESS},
|
|
||||||
{NULL, 0, NULL, 0 },
|
{NULL, 0, NULL, 0 },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -639,6 +645,9 @@ scrcpy_parse_args(struct scrcpy_cli_args *args, int argc, char *argv[]) {
|
||||||
case OPT_NO_MIPMAPS:
|
case OPT_NO_MIPMAPS:
|
||||||
opts->mipmaps = false;
|
opts->mipmaps = false;
|
||||||
break;
|
break;
|
||||||
|
case OPT_CODEC_OPTIONS:
|
||||||
|
opts->codec_options = optarg;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
// getopt prints the error message on stderr
|
// getopt prints the error message on stderr
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -292,6 +292,7 @@ scrcpy(const struct scrcpy_options *options) {
|
||||||
.lock_video_orientation = options->lock_video_orientation,
|
.lock_video_orientation = options->lock_video_orientation,
|
||||||
.control = options->control,
|
.control = options->control,
|
||||||
.display_id = options->display_id,
|
.display_id = options->display_id,
|
||||||
|
.codec_options = options->codec_options,
|
||||||
};
|
};
|
||||||
if (!server_start(&server, options->serial, ¶ms)) {
|
if (!server_start(&server, options->serial, ¶ms)) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -16,6 +16,7 @@ struct scrcpy_options {
|
||||||
const char *window_title;
|
const char *window_title;
|
||||||
const char *push_target;
|
const char *push_target;
|
||||||
const char *render_driver;
|
const char *render_driver;
|
||||||
|
const char *codec_options;
|
||||||
enum recorder_format record_format;
|
enum recorder_format record_format;
|
||||||
struct port_range port_range;
|
struct port_range port_range;
|
||||||
uint16_t max_size;
|
uint16_t max_size;
|
||||||
|
@ -47,6 +48,7 @@ struct scrcpy_options {
|
||||||
.window_title = NULL, \
|
.window_title = NULL, \
|
||||||
.push_target = NULL, \
|
.push_target = NULL, \
|
||||||
.render_driver = NULL, \
|
.render_driver = NULL, \
|
||||||
|
.codec_options = NULL, \
|
||||||
.record_format = RECORDER_FORMAT_AUTO, \
|
.record_format = RECORDER_FORMAT_AUTO, \
|
||||||
.port_range = { \
|
.port_range = { \
|
||||||
.first = DEFAULT_LOCAL_PORT_RANGE_FIRST, \
|
.first = DEFAULT_LOCAL_PORT_RANGE_FIRST, \
|
||||||
|
|
|
@ -268,6 +268,7 @@ execute_server(struct server *server, const struct server_params *params) {
|
||||||
"true", // always send frame meta (packet boundaries + timestamp)
|
"true", // always send frame meta (packet boundaries + timestamp)
|
||||||
params->control ? "true" : "false",
|
params->control ? "true" : "false",
|
||||||
display_id_string,
|
display_id_string,
|
||||||
|
params->codec_options ? params->codec_options : "-",
|
||||||
};
|
};
|
||||||
#ifdef SERVER_DEBUGGER
|
#ifdef SERVER_DEBUGGER
|
||||||
LOGI("Server debugger waiting for a client on device port "
|
LOGI("Server debugger waiting for a client on device port "
|
||||||
|
|
|
@ -44,6 +44,7 @@ struct server {
|
||||||
|
|
||||||
struct server_params {
|
struct server_params {
|
||||||
const char *crop;
|
const char *crop;
|
||||||
|
const char *codec_options;
|
||||||
struct port_range port_range;
|
struct port_range port_range;
|
||||||
uint16_t max_size;
|
uint16_t max_size;
|
||||||
uint32_t bit_rate;
|
uint32_t bit_rate;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue