Group server params in a struct

Starting the server requires more and more parameters. For clarity,
group them in a struct.
This commit is contained in:
Romain Vimont
2019-06-04 23:59:55 +02:00
parent c8a6783494
commit ca767ba364
3 changed files with 29 additions and 23 deletions

View File

@@ -271,9 +271,14 @@ av_log_callback(void *avcl, int level, const char *fmt, va_list vl) {
bool
scrcpy(const struct scrcpy_options *options) {
bool record = !!options->record_filename;
if (!server_start(&server, options->serial, options->port,
options->max_size, options->bit_rate, options->crop,
record)) {
struct server_params params = {
.crop = options->crop,
.local_port = options->port,
.max_size = options->max_size,
.bit_rate = options->bit_rate,
.send_frame_meta = record,
};
if (!server_start(&server, options->serial, &params)) {
return false;
}