Rename --encoder to --video-encoder
This prepares the introduction of --audio-encoder. PR #3757 <https://github.com/Genymobile/scrcpy/pull/3757>
This commit is contained in:
@@ -45,7 +45,8 @@ enum {
|
||||
OPT_NO_KEY_REPEAT,
|
||||
OPT_FORWARD_ALL_CLICKS,
|
||||
OPT_LEGACY_PASTE,
|
||||
OPT_ENCODER_NAME,
|
||||
OPT_ENCODER,
|
||||
OPT_VIDEO_ENCODER,
|
||||
OPT_POWER_OFF_ON_CLOSE,
|
||||
OPT_V4L2_SINK,
|
||||
OPT_DISPLAY_BUFFER,
|
||||
@@ -178,11 +179,10 @@ static const struct sc_option options[] = {
|
||||
"Also see -d (--select-usb).",
|
||||
},
|
||||
{
|
||||
.longopt_id = OPT_ENCODER_NAME,
|
||||
// deprecated
|
||||
.longopt_id = OPT_ENCODER,
|
||||
.longopt = "encoder",
|
||||
.argdesc = "name",
|
||||
.text = "Use a specific MediaCodec encoder (depending on the codec "
|
||||
"provided by --video-codec).",
|
||||
},
|
||||
{
|
||||
.longopt_id = OPT_FORCE_ADB_FORWARD,
|
||||
@@ -543,6 +543,13 @@ static const struct sc_option options[] = {
|
||||
"Android documentation: "
|
||||
"<https://d.android.com/reference/android/media/MediaFormat>",
|
||||
},
|
||||
{
|
||||
.longopt_id = OPT_VIDEO_ENCODER,
|
||||
.longopt = "video-encoder",
|
||||
.argdesc = "name",
|
||||
.text = "Use a specific MediaCodec video encoder (depending on the "
|
||||
"codec provided by --video-codec).",
|
||||
},
|
||||
{
|
||||
.shortopt = 'w',
|
||||
.longopt = "stay-awake",
|
||||
@@ -1629,8 +1636,11 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
|
||||
case OPT_VIDEO_CODEC_OPTIONS:
|
||||
opts->video_codec_options = optarg;
|
||||
break;
|
||||
case OPT_ENCODER_NAME:
|
||||
opts->encoder_name = optarg;
|
||||
case OPT_ENCODER:
|
||||
LOGW("--encoder is deprecated, use --video-encoder instead.");
|
||||
// fall through
|
||||
case OPT_VIDEO_ENCODER:
|
||||
opts->video_encoder = optarg;
|
||||
break;
|
||||
case OPT_FORCE_ADB_FORWARD:
|
||||
opts->force_adb_forward = true;
|
||||
|
||||
@@ -8,7 +8,7 @@ const struct scrcpy_options scrcpy_options_default = {
|
||||
.push_target = NULL,
|
||||
.render_driver = NULL,
|
||||
.video_codec_options = NULL,
|
||||
.encoder_name = NULL,
|
||||
.video_encoder = NULL,
|
||||
#ifdef HAVE_V4L2
|
||||
.v4l2_device = NULL,
|
||||
#endif
|
||||
|
||||
@@ -94,7 +94,7 @@ struct scrcpy_options {
|
||||
const char *push_target;
|
||||
const char *render_driver;
|
||||
const char *video_codec_options;
|
||||
const char *encoder_name;
|
||||
const char *video_encoder;
|
||||
#ifdef HAVE_V4L2
|
||||
const char *v4l2_device;
|
||||
#endif
|
||||
|
||||
@@ -329,7 +329,7 @@ scrcpy(struct scrcpy_options *options) {
|
||||
.show_touches = options->show_touches,
|
||||
.stay_awake = options->stay_awake,
|
||||
.video_codec_options = options->video_codec_options,
|
||||
.encoder_name = options->encoder_name,
|
||||
.video_encoder = options->video_encoder,
|
||||
.force_adb_forward = options->force_adb_forward,
|
||||
.power_off_on_close = options->power_off_on_close,
|
||||
.clipboard_autosync = options->clipboard_autosync,
|
||||
|
||||
@@ -72,7 +72,7 @@ sc_server_params_destroy(struct sc_server_params *params) {
|
||||
free((char *) params->req_serial);
|
||||
free((char *) params->crop);
|
||||
free((char *) params->video_codec_options);
|
||||
free((char *) params->encoder_name);
|
||||
free((char *) params->video_encoder);
|
||||
free((char *) params->tcpip_dst);
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ sc_server_params_copy(struct sc_server_params *dst,
|
||||
COPY(req_serial);
|
||||
COPY(crop);
|
||||
COPY(video_codec_options);
|
||||
COPY(encoder_name);
|
||||
COPY(video_encoder);
|
||||
COPY(tcpip_dst);
|
||||
#undef COPY
|
||||
|
||||
@@ -258,8 +258,8 @@ execute_server(struct sc_server *server,
|
||||
if (params->video_codec_options) {
|
||||
ADD_PARAM("video_codec_options=%s", params->video_codec_options);
|
||||
}
|
||||
if (params->encoder_name) {
|
||||
ADD_PARAM("encoder_name=%s", params->encoder_name);
|
||||
if (params->video_encoder) {
|
||||
ADD_PARAM("video_encoder=%s", params->video_encoder);
|
||||
}
|
||||
if (params->power_off_on_close) {
|
||||
ADD_PARAM("power_off_on_close=true");
|
||||
|
||||
@@ -28,7 +28,7 @@ struct sc_server_params {
|
||||
enum sc_codec video_codec;
|
||||
const char *crop;
|
||||
const char *video_codec_options;
|
||||
const char *encoder_name;
|
||||
const char *video_encoder;
|
||||
struct sc_port_range port_range;
|
||||
uint32_t tunnel_host;
|
||||
uint16_t tunnel_port;
|
||||
|
||||
Reference in New Issue
Block a user