mirror of
https://github.com/Genymobile/scrcpy.git
synced 2024-09-19 05:31:21 +02:00
dc7fcf3c7a
Accept a range of ports to listen to, so that it does not fail if another instance of scrcpy is currently starting. The range can be passed via the command line: scrcpy -p 27183:27186 scrcpy -p 27183 # implicitly 27183:27183, as before The default is 27183:27199. Closes #951 <https://github.com/Genymobile/scrcpy/issues/951>
70 lines
1.6 KiB
C
70 lines
1.6 KiB
C
#ifndef SCRCPY_H
|
|
#define SCRCPY_H
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
#include "config.h"
|
|
#include "common.h"
|
|
#include "input_manager.h"
|
|
#include "recorder.h"
|
|
|
|
struct scrcpy_options {
|
|
const char *serial;
|
|
const char *crop;
|
|
const char *record_filename;
|
|
const char *window_title;
|
|
const char *push_target;
|
|
enum recorder_format record_format;
|
|
struct port_range port_range;
|
|
uint16_t max_size;
|
|
uint32_t bit_rate;
|
|
uint16_t max_fps;
|
|
int16_t window_x;
|
|
int16_t window_y;
|
|
uint16_t window_width;
|
|
uint16_t window_height;
|
|
bool show_touches;
|
|
bool fullscreen;
|
|
bool always_on_top;
|
|
bool control;
|
|
bool display;
|
|
bool turn_screen_off;
|
|
bool render_expired_frames;
|
|
bool prefer_text;
|
|
bool window_borderless;
|
|
};
|
|
|
|
#define SCRCPY_OPTIONS_DEFAULT { \
|
|
.serial = NULL, \
|
|
.crop = NULL, \
|
|
.record_filename = NULL, \
|
|
.window_title = NULL, \
|
|
.push_target = NULL, \
|
|
.record_format = RECORDER_FORMAT_AUTO, \
|
|
.port_range = { \
|
|
.first = DEFAULT_LOCAL_PORT_RANGE_FIRST, \
|
|
.last = DEFAULT_LOCAL_PORT_RANGE_LAST, \
|
|
}, \
|
|
.max_size = DEFAULT_MAX_SIZE, \
|
|
.bit_rate = DEFAULT_BIT_RATE, \
|
|
.max_fps = 0, \
|
|
.window_x = -1, \
|
|
.window_y = -1, \
|
|
.window_width = 0, \
|
|
.window_height = 0, \
|
|
.show_touches = false, \
|
|
.fullscreen = false, \
|
|
.always_on_top = false, \
|
|
.control = true, \
|
|
.display = true, \
|
|
.turn_screen_off = false, \
|
|
.render_expired_frames = false, \
|
|
.prefer_text = false, \
|
|
.window_borderless = false, \
|
|
}
|
|
|
|
bool
|
|
scrcpy(const struct scrcpy_options *options);
|
|
|
|
#endif
|