Adding codec_profile to scrcpy client default options.

If the option is not requested with -c then the codec will be automatically choosen by the MediaCodec.

(cherry picked from commit 8bf45997bfdffbca16105eb5b40d8bc42f15d203)
This commit is contained in:
Tzah Mazuz 2020-03-12 15:59:10 +02:00
parent c396758b4e
commit d93cf8420b
4 changed files with 5 additions and 0 deletions

View file

@ -371,6 +371,7 @@ scrcpy_parse_args(struct scrcpy_cli_args *args, int argc, char *argv[]) {
{"window-height", required_argument, NULL, OPT_WINDOW_HEIGHT},
{"window-borderless", no_argument, NULL,
OPT_WINDOW_BORDERLESS},
{"codec-profile", required_argument, NULL, 'P'},
{NULL, 0, NULL, 0 },
};

View file

@ -285,6 +285,7 @@ scrcpy(const struct scrcpy_options *options) {
.bit_rate = options->bit_rate,
.max_fps = options->max_fps,
.control = options->control,
.codec_profile = options->codec_profile,
};
if (!server_start(&server, options->serial, &params)) {
return false;

View file

@ -32,6 +32,7 @@ struct scrcpy_options {
bool render_expired_frames;
bool prefer_text;
bool window_borderless;
uint32_t codec_profile;
};
#define SCRCPY_OPTIONS_DEFAULT { \
@ -58,6 +59,7 @@ struct scrcpy_options {
.render_expired_frames = false, \
.prefer_text = false, \
.window_borderless = false, \
.codec_profile = 0, \
}
bool

View file

@ -37,6 +37,7 @@ struct server_params {
uint32_t bit_rate;
uint16_t max_fps;
bool control;
uint32_t codec_profile;
};
// init default values