Skip to content

Commit

Permalink
Adding codec_profile to scrcpy client default options.
Browse files Browse the repository at this point in the history
If the option is not requested with -c then the codec will be automatically choosen by the MediaCodec.
  • Loading branch information
Tzah Mazuz committed Mar 19, 2020
1 parent 4cca469 commit 43aea79
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/src/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,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 },
};

Expand Down
1 change: 1 addition & 0 deletions app/src/scrcpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ scrcpy(const struct scrcpy_options *options) {
.max_fps = options->max_fps,
.lock_video_orientation = options->lock_video_orientation,
.control = options->control,
.codec_profile = options->codec_profile,
};
if (!server_start(&server, options->serial, &params)) {
return false;
Expand Down
2 changes: 2 additions & 0 deletions app/src/scrcpy.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ struct scrcpy_options {
bool render_expired_frames;
bool prefer_text;
bool window_borderless;
uint32_t codec_profile;
};

#define SCRCPY_OPTIONS_DEFAULT { \
Expand Down Expand Up @@ -64,6 +65,7 @@ struct scrcpy_options {
.render_expired_frames = false, \
.prefer_text = false, \
.window_borderless = false, \
.codec_profile = 0, \
}

bool
Expand Down
1 change: 1 addition & 0 deletions app/src/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ struct server_params {
uint16_t max_fps;
int8_t lock_video_orientation;
bool control;
uint32_t codec_profile;
};

// init default values
Expand Down

0 comments on commit 43aea79

Please sign in to comment.