Pass serial within struct server_params
This was the only option passed separately.
This commit is contained in:
parent
6adc97198b
commit
4c31911df2
3 changed files with 8 additions and 8 deletions
|
@ -256,6 +256,7 @@ scrcpy(const struct scrcpy_options *options) {
|
|||
|
||||
bool record = !!options->record_filename;
|
||||
struct server_params params = {
|
||||
.serial = options->serial,
|
||||
.log_level = options->log_level,
|
||||
.crop = options->crop,
|
||||
.port_range = options->port_range,
|
||||
|
@ -272,7 +273,7 @@ scrcpy(const struct scrcpy_options *options) {
|
|||
.force_adb_forward = options->force_adb_forward,
|
||||
.power_off_on_close = options->power_off_on_close,
|
||||
};
|
||||
if (!server_start(&server, options->serial, ¶ms)) {
|
||||
if (!server_start(&server, ¶ms)) {
|
||||
goto end;
|
||||
}
|
||||
|
||||
|
|
|
@ -407,16 +407,15 @@ run_wait_server(void *data) {
|
|||
}
|
||||
|
||||
bool
|
||||
server_start(struct server *server, const char *serial,
|
||||
const struct server_params *params) {
|
||||
if (serial) {
|
||||
server->serial = strdup(serial);
|
||||
server_start(struct server *server, const struct server_params *params) {
|
||||
if (params->serial) {
|
||||
server->serial = strdup(params->serial);
|
||||
if (!server->serial) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!push_server(serial)) {
|
||||
if (!push_server(params->serial)) {
|
||||
/* server->serial will be freed on server_destroy() */
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ struct server {
|
|||
};
|
||||
|
||||
struct server_params {
|
||||
const char *serial;
|
||||
enum sc_log_level log_level;
|
||||
const char *crop;
|
||||
const char *codec_options;
|
||||
|
@ -56,8 +57,7 @@ server_init(struct server *server);
|
|||
|
||||
// push, enable tunnel et start the server
|
||||
bool
|
||||
server_start(struct server *server, const char *serial,
|
||||
const struct server_params *params);
|
||||
server_start(struct server *server, const struct server_params *params);
|
||||
|
||||
#define DEVICE_NAME_FIELD_LENGTH 64
|
||||
// block until the communication with the server is established
|
||||
|
|
Loading…
Reference in a new issue