From 43aea79f6acc69f68feaee0494f45a05bce0f782 Mon Sep 17 00:00:00 2001 From: Tzah Mazuz Date: Thu, 12 Mar 2020 15:59:10 +0200 Subject: [PATCH] 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. --- app/src/cli.c | 1 + app/src/scrcpy.c | 1 + app/src/scrcpy.h | 2 ++ app/src/server.h | 1 + 4 files changed, 5 insertions(+) diff --git a/app/src/cli.c b/app/src/cli.c index 4b093c49da..df1e54afad 100644 --- a/app/src/cli.c +++ b/app/src/cli.c @@ -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 }, }; diff --git a/app/src/scrcpy.c b/app/src/scrcpy.c index 4d9ad88b0b..0057c75b83 100644 --- a/app/src/scrcpy.c +++ b/app/src/scrcpy.c @@ -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, ¶ms)) { return false; diff --git a/app/src/scrcpy.h b/app/src/scrcpy.h index e29298f2c1..4d5ad9fc34 100644 --- a/app/src/scrcpy.h +++ b/app/src/scrcpy.h @@ -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 { \ @@ -64,6 +65,7 @@ struct scrcpy_options { .render_expired_frames = false, \ .prefer_text = false, \ .window_borderless = false, \ + .codec_profile = 0, \ } bool diff --git a/app/src/server.h b/app/src/server.h index d84a5cc8c2..f16ad6b43c 100644 --- a/app/src/server.h +++ b/app/src/server.h @@ -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