2018-02-08 18:14:13 +08:00
|
|
|
#ifndef SCRCPY_H
|
|
|
|
#define SCRCPY_H
|
2017-12-12 22:12:07 +08:00
|
|
|
|
2019-03-03 06:52:22 +08:00
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdint.h>
|
2017-12-12 22:12:07 +08:00
|
|
|
|
2019-09-30 04:36:56 +08:00
|
|
|
#include "config.h"
|
2019-12-10 04:16:09 +08:00
|
|
|
#include "common.h"
|
2019-11-08 02:01:35 +08:00
|
|
|
#include "input_manager.h"
|
2019-11-07 05:22:23 +08:00
|
|
|
#include "recorder.h"
|
2020-05-25 03:51:40 +08:00
|
|
|
#include "util/log.h"
|
2019-09-30 04:36:56 +08:00
|
|
|
|
2018-03-21 21:04:13 +08:00
|
|
|
struct scrcpy_options {
|
|
|
|
const char *serial;
|
2018-08-10 01:12:27 +08:00
|
|
|
const char *crop;
|
2018-11-11 21:03:29 +08:00
|
|
|
const char *record_filename;
|
2019-06-24 01:02:34 +08:00
|
|
|
const char *window_title;
|
2019-07-31 07:48:32 +08:00
|
|
|
const char *push_target;
|
2020-04-11 20:34:41 +08:00
|
|
|
const char *render_driver;
|
2020-04-26 20:22:08 +08:00
|
|
|
const char *codec_options;
|
2020-05-25 03:51:40 +08:00
|
|
|
enum sc_log_level log_level;
|
2019-02-09 22:20:07 +08:00
|
|
|
enum recorder_format record_format;
|
2019-12-10 04:16:09 +08:00
|
|
|
struct port_range port_range;
|
2019-03-03 06:52:22 +08:00
|
|
|
uint16_t max_size;
|
|
|
|
uint32_t bit_rate;
|
2019-11-18 05:07:19 +08:00
|
|
|
uint16_t max_fps;
|
2020-02-16 19:30:36 +08:00
|
|
|
int8_t lock_video_orientation;
|
2020-04-08 16:17:12 +08:00
|
|
|
uint8_t rotation;
|
2020-03-27 00:54:06 +08:00
|
|
|
int16_t window_x; // WINDOW_POSITION_UNDEFINED for "auto"
|
|
|
|
int16_t window_y; // WINDOW_POSITION_UNDEFINED for "auto"
|
2019-11-04 01:00:11 +08:00
|
|
|
uint16_t window_width;
|
|
|
|
uint16_t window_height;
|
2020-02-24 19:16:38 +08:00
|
|
|
uint16_t display_id;
|
2019-03-03 06:52:22 +08:00
|
|
|
bool show_touches;
|
|
|
|
bool fullscreen;
|
|
|
|
bool always_on_top;
|
2019-06-05 03:49:26 +08:00
|
|
|
bool control;
|
|
|
|
bool display;
|
2019-06-05 06:55:46 +08:00
|
|
|
bool turn_screen_off;
|
2019-06-06 01:02:50 +08:00
|
|
|
bool render_expired_frames;
|
2019-11-08 02:01:35 +08:00
|
|
|
bool prefer_text;
|
2019-08-29 13:25:17 +08:00
|
|
|
bool window_borderless;
|
2020-04-12 05:55:29 +08:00
|
|
|
bool mipmaps;
|
2020-05-02 07:54:48 +08:00
|
|
|
bool stay_awake;
|
2018-03-21 21:04:13 +08:00
|
|
|
};
|
|
|
|
|
2019-11-07 05:06:54 +08:00
|
|
|
#define SCRCPY_OPTIONS_DEFAULT { \
|
|
|
|
.serial = NULL, \
|
|
|
|
.crop = NULL, \
|
|
|
|
.record_filename = NULL, \
|
|
|
|
.window_title = NULL, \
|
|
|
|
.push_target = NULL, \
|
2020-04-11 20:34:41 +08:00
|
|
|
.render_driver = NULL, \
|
2020-04-26 20:22:08 +08:00
|
|
|
.codec_options = NULL, \
|
2020-05-25 03:51:40 +08:00
|
|
|
.log_level = SC_LOG_LEVEL_INFO, \
|
2019-11-07 05:06:54 +08:00
|
|
|
.record_format = RECORDER_FORMAT_AUTO, \
|
2019-12-10 04:16:09 +08:00
|
|
|
.port_range = { \
|
|
|
|
.first = DEFAULT_LOCAL_PORT_RANGE_FIRST, \
|
|
|
|
.last = DEFAULT_LOCAL_PORT_RANGE_LAST, \
|
|
|
|
}, \
|
2019-12-03 19:06:43 +08:00
|
|
|
.max_size = DEFAULT_MAX_SIZE, \
|
2019-11-07 05:06:54 +08:00
|
|
|
.bit_rate = DEFAULT_BIT_RATE, \
|
2019-11-18 05:07:19 +08:00
|
|
|
.max_fps = 0, \
|
2020-02-16 19:30:36 +08:00
|
|
|
.lock_video_orientation = DEFAULT_LOCK_VIDEO_ORIENTATION, \
|
2020-04-08 16:17:12 +08:00
|
|
|
.rotation = 0, \
|
2020-03-27 00:54:06 +08:00
|
|
|
.window_x = WINDOW_POSITION_UNDEFINED, \
|
|
|
|
.window_y = WINDOW_POSITION_UNDEFINED, \
|
2019-11-04 01:00:11 +08:00
|
|
|
.window_width = 0, \
|
|
|
|
.window_height = 0, \
|
2020-02-24 19:16:38 +08:00
|
|
|
.display_id = 0, \
|
2019-11-07 05:06:54 +08:00
|
|
|
.show_touches = false, \
|
|
|
|
.fullscreen = false, \
|
|
|
|
.always_on_top = false, \
|
|
|
|
.control = true, \
|
|
|
|
.display = true, \
|
|
|
|
.turn_screen_off = false, \
|
|
|
|
.render_expired_frames = false, \
|
2019-11-08 02:01:35 +08:00
|
|
|
.prefer_text = false, \
|
2019-08-29 13:25:17 +08:00
|
|
|
.window_borderless = false, \
|
2020-04-12 05:55:29 +08:00
|
|
|
.mipmaps = true, \
|
2020-05-02 07:54:48 +08:00
|
|
|
.stay_awake = false, \
|
2019-11-07 05:06:54 +08:00
|
|
|
}
|
|
|
|
|
2019-03-03 06:52:22 +08:00
|
|
|
bool
|
2019-03-03 03:09:56 +08:00
|
|
|
scrcpy(const struct scrcpy_options *options);
|
2017-12-12 22:12:07 +08:00
|
|
|
|
|
|
|
#endif
|