2021-10-28 00:43:47 +08:00
|
|
|
#ifndef SCRCPY_OPTIONS_H
|
|
|
|
#define SCRCPY_OPTIONS_H
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#include "util/tick.h"
|
|
|
|
|
|
|
|
enum sc_log_level {
|
|
|
|
SC_LOG_LEVEL_VERBOSE,
|
|
|
|
SC_LOG_LEVEL_DEBUG,
|
|
|
|
SC_LOG_LEVEL_INFO,
|
|
|
|
SC_LOG_LEVEL_WARN,
|
|
|
|
SC_LOG_LEVEL_ERROR,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum sc_record_format {
|
|
|
|
SC_RECORD_FORMAT_AUTO,
|
|
|
|
SC_RECORD_FORMAT_MP4,
|
|
|
|
SC_RECORD_FORMAT_MKV,
|
|
|
|
};
|
|
|
|
|
2023-02-03 19:35:37 +08:00
|
|
|
enum sc_codec {
|
|
|
|
SC_CODEC_H264,
|
2023-02-03 19:40:55 +08:00
|
|
|
SC_CODEC_H265,
|
2023-02-03 19:42:22 +08:00
|
|
|
SC_CODEC_AV1,
|
2023-02-03 19:35:37 +08:00
|
|
|
};
|
|
|
|
|
2021-10-28 00:43:47 +08:00
|
|
|
enum sc_lock_video_orientation {
|
|
|
|
SC_LOCK_VIDEO_ORIENTATION_UNLOCKED = -1,
|
|
|
|
// lock the current orientation when scrcpy starts
|
|
|
|
SC_LOCK_VIDEO_ORIENTATION_INITIAL = -2,
|
|
|
|
SC_LOCK_VIDEO_ORIENTATION_0 = 0,
|
|
|
|
SC_LOCK_VIDEO_ORIENTATION_1,
|
|
|
|
SC_LOCK_VIDEO_ORIENTATION_2,
|
|
|
|
SC_LOCK_VIDEO_ORIENTATION_3,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum sc_keyboard_input_mode {
|
|
|
|
SC_KEYBOARD_INPUT_MODE_INJECT,
|
|
|
|
SC_KEYBOARD_INPUT_MODE_HID,
|
|
|
|
};
|
|
|
|
|
2021-12-27 05:32:51 +08:00
|
|
|
enum sc_mouse_input_mode {
|
|
|
|
SC_MOUSE_INPUT_MODE_INJECT,
|
|
|
|
SC_MOUSE_INPUT_MODE_HID,
|
|
|
|
};
|
|
|
|
|
2021-11-27 05:05:28 +08:00
|
|
|
enum sc_key_inject_mode {
|
|
|
|
// Inject special keys, letters and space as key events.
|
|
|
|
// Inject numbers and punctuation as text events.
|
|
|
|
// This is the default mode.
|
|
|
|
SC_KEY_INJECT_MODE_MIXED,
|
|
|
|
|
|
|
|
// Inject special keys as key events.
|
|
|
|
// Inject letters and space, numbers and punctuation as text events.
|
|
|
|
SC_KEY_INJECT_MODE_TEXT,
|
2021-11-27 05:15:44 +08:00
|
|
|
|
|
|
|
// Inject everything as key events.
|
|
|
|
SC_KEY_INJECT_MODE_RAW,
|
2021-11-27 05:05:28 +08:00
|
|
|
};
|
|
|
|
|
2021-10-28 00:43:47 +08:00
|
|
|
#define SC_MAX_SHORTCUT_MODS 8
|
|
|
|
|
|
|
|
enum sc_shortcut_mod {
|
2021-12-28 22:24:15 +08:00
|
|
|
SC_SHORTCUT_MOD_LCTRL = 1 << 0,
|
|
|
|
SC_SHORTCUT_MOD_RCTRL = 1 << 1,
|
|
|
|
SC_SHORTCUT_MOD_LALT = 1 << 2,
|
|
|
|
SC_SHORTCUT_MOD_RALT = 1 << 3,
|
|
|
|
SC_SHORTCUT_MOD_LSUPER = 1 << 4,
|
|
|
|
SC_SHORTCUT_MOD_RSUPER = 1 << 5,
|
2021-10-28 00:43:47 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct sc_shortcut_mods {
|
|
|
|
unsigned data[SC_MAX_SHORTCUT_MODS];
|
|
|
|
unsigned count;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct sc_port_range {
|
|
|
|
uint16_t first;
|
|
|
|
uint16_t last;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define SC_WINDOW_POSITION_UNDEFINED (-0x8000)
|
|
|
|
|
|
|
|
struct scrcpy_options {
|
|
|
|
const char *serial;
|
|
|
|
const char *crop;
|
|
|
|
const char *record_filename;
|
|
|
|
const char *window_title;
|
|
|
|
const char *push_target;
|
|
|
|
const char *render_driver;
|
|
|
|
const char *codec_options;
|
|
|
|
const char *encoder_name;
|
2021-10-28 00:43:47 +08:00
|
|
|
#ifdef HAVE_V4L2
|
2021-10-28 00:43:47 +08:00
|
|
|
const char *v4l2_device;
|
2021-10-28 00:43:47 +08:00
|
|
|
#endif
|
2021-10-28 00:43:47 +08:00
|
|
|
enum sc_log_level log_level;
|
2023-02-03 19:35:37 +08:00
|
|
|
enum sc_codec codec;
|
2021-10-28 00:43:47 +08:00
|
|
|
enum sc_record_format record_format;
|
|
|
|
enum sc_keyboard_input_mode keyboard_input_mode;
|
2021-12-27 05:32:51 +08:00
|
|
|
enum sc_mouse_input_mode mouse_input_mode;
|
2021-10-28 00:43:47 +08:00
|
|
|
struct sc_port_range port_range;
|
2021-11-18 08:02:53 +08:00
|
|
|
uint32_t tunnel_host;
|
|
|
|
uint16_t tunnel_port;
|
2021-10-28 00:43:47 +08:00
|
|
|
struct sc_shortcut_mods shortcut_mods;
|
|
|
|
uint16_t max_size;
|
|
|
|
uint32_t bit_rate;
|
|
|
|
uint16_t max_fps;
|
|
|
|
enum sc_lock_video_orientation lock_video_orientation;
|
|
|
|
uint8_t rotation;
|
|
|
|
int16_t window_x; // SC_WINDOW_POSITION_UNDEFINED for "auto"
|
|
|
|
int16_t window_y; // SC_WINDOW_POSITION_UNDEFINED for "auto"
|
|
|
|
uint16_t window_width;
|
|
|
|
uint16_t window_height;
|
|
|
|
uint32_t display_id;
|
|
|
|
sc_tick display_buffer;
|
|
|
|
sc_tick v4l2_buffer;
|
2022-01-22 18:09:41 +08:00
|
|
|
#ifdef HAVE_USB
|
|
|
|
bool otg;
|
|
|
|
#endif
|
2021-10-28 00:43:47 +08:00
|
|
|
bool show_touches;
|
|
|
|
bool fullscreen;
|
|
|
|
bool always_on_top;
|
|
|
|
bool control;
|
|
|
|
bool display;
|
|
|
|
bool turn_screen_off;
|
2021-11-27 05:05:28 +08:00
|
|
|
enum sc_key_inject_mode key_inject_mode;
|
2021-10-28 00:43:47 +08:00
|
|
|
bool window_borderless;
|
|
|
|
bool mipmaps;
|
|
|
|
bool stay_awake;
|
|
|
|
bool force_adb_forward;
|
|
|
|
bool disable_screensaver;
|
|
|
|
bool forward_key_repeat;
|
|
|
|
bool forward_all_clicks;
|
|
|
|
bool legacy_paste;
|
|
|
|
bool power_off_on_close;
|
2021-11-22 15:49:10 +08:00
|
|
|
bool clipboard_autosync;
|
2022-01-16 06:01:14 +08:00
|
|
|
bool downsize_on_error;
|
2021-11-26 05:22:49 +08:00
|
|
|
bool tcpip;
|
|
|
|
const char *tcpip_dst;
|
2022-02-07 01:40:18 +08:00
|
|
|
bool select_usb;
|
|
|
|
bool select_tcpip;
|
2022-02-14 00:17:01 +08:00
|
|
|
bool cleanup;
|
2022-02-18 03:08:41 +08:00
|
|
|
bool start_fps_counter;
|
2022-04-23 21:08:30 +08:00
|
|
|
bool power_on;
|
2021-10-28 00:43:47 +08:00
|
|
|
};
|
|
|
|
|
2021-10-28 00:43:47 +08:00
|
|
|
extern const struct scrcpy_options scrcpy_options_default;
|
2021-10-28 00:43:47 +08:00
|
|
|
|
|
|
|
#endif
|