Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aa8b571389 | ||
|
|
ed130e05d5 | ||
|
|
192fbd8450 | ||
|
|
c5c5fc18ae | ||
|
|
f682b87ba5 | ||
|
|
10b749e27d | ||
|
|
05e8c1a3c5 |
@@ -254,10 +254,10 @@ You can then [run](README.md#run) _scrcpy_.
|
|||||||
|
|
||||||
## Prebuilt server
|
## Prebuilt server
|
||||||
|
|
||||||
- [`scrcpy-server-v1.16`][direct-scrcpy-server]
|
- [`scrcpy-server-v1.17`][direct-scrcpy-server]
|
||||||
_(SHA-256: 94a79e05b4498d0460ab7bd9d12cbf05156e3a47bf0c5d1420cee1d4493b3832)_
|
_(SHA-256: 11b5ad2d1bc9b9730fb7254a78efd71a8ff46b1938ff468e47a21b653a1b6725_
|
||||||
|
|
||||||
[direct-scrcpy-server]: https://github.com/Genymobile/scrcpy/releases/download/v1.16/scrcpy-server-v1.16
|
[direct-scrcpy-server]: https://github.com/Genymobile/scrcpy/releases/download/v1.17/scrcpy-server-v1.17
|
||||||
|
|
||||||
Download the prebuilt server somewhere, and specify its path during the Meson
|
Download the prebuilt server somewhere, and specify its path during the Meson
|
||||||
configuration:
|
configuration:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# scrcpy (v1.16)
|
# scrcpy (v1.17)
|
||||||
|
|
||||||
[Read in another language](#translations)
|
[Read in another language](#translations)
|
||||||
|
|
||||||
@@ -77,10 +77,10 @@ hard).
|
|||||||
For Windows, for simplicity, a prebuilt archive with all the dependencies
|
For Windows, for simplicity, a prebuilt archive with all the dependencies
|
||||||
(including `adb`) is available:
|
(including `adb`) is available:
|
||||||
|
|
||||||
- [`scrcpy-win64-v1.16.zip`][direct-win64]
|
- [`scrcpy-win64-v1.17.zip`][direct-win64]
|
||||||
_(SHA-256: 3f30dc5db1a2f95c2b40a0f5de91ec1642d9f53799250a8c529bc882bc0918f0)_
|
_(SHA-256: 8b9e57993c707367ed10ebfe0e1ef563c7a29d9af4a355cd8b6a52a317c73eea)_
|
||||||
|
|
||||||
[direct-win64]: https://github.com/Genymobile/scrcpy/releases/download/v1.16/scrcpy-win64-v1.16.zip
|
[direct-win64]: https://github.com/Genymobile/scrcpy/releases/download/v1.17/scrcpy-win64-v1.17.zip
|
||||||
|
|
||||||
It is also available in [Chocolatey]:
|
It is also available in [Chocolatey]:
|
||||||
|
|
||||||
@@ -116,6 +116,10 @@ brew install scrcpy
|
|||||||
You need `adb`, accessible from your `PATH`. If you don't have it yet:
|
You need `adb`, accessible from your `PATH`. If you don't have it yet:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# Homebrew >= 2.6.0
|
||||||
|
brew install --cask android-platform-tools
|
||||||
|
|
||||||
|
# Homebrew < 2.6.0
|
||||||
brew cask install android-platform-tools
|
brew cask install android-platform-tools
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -478,14 +478,14 @@ parse_port_range(const char *s, struct sc_port_range *port_range) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
parse_display_id(const char *s, uint16_t *display_id) {
|
parse_display_id(const char *s, uint32_t *display_id) {
|
||||||
long value;
|
long value;
|
||||||
bool ok = parse_integer_arg(s, &value, false, 0, 0xFFFF, "display id");
|
bool ok = parse_integer_arg(s, &value, false, 0, 0x7FFFFFFF, "display id");
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
*display_id = (uint16_t) value;
|
*display_id = (uint32_t) value;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -308,6 +308,8 @@ scrcpy(const struct scrcpy_options *options) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ret = false;
|
||||||
|
|
||||||
bool server_started = false;
|
bool server_started = false;
|
||||||
bool fps_counter_initialized = false;
|
bool fps_counter_initialized = false;
|
||||||
bool video_buffer_initialized = false;
|
bool video_buffer_initialized = false;
|
||||||
@@ -449,7 +451,7 @@ scrcpy(const struct scrcpy_options *options) {
|
|||||||
|
|
||||||
input_manager_init(&input_manager, options);
|
input_manager_init(&input_manager, options);
|
||||||
|
|
||||||
bool ret = event_loop(options);
|
ret = event_loop(options);
|
||||||
LOGD("quit...");
|
LOGD("quit...");
|
||||||
|
|
||||||
screen_destroy(&screen);
|
screen_destroy(&screen);
|
||||||
|
|||||||
+1
-1
@@ -65,7 +65,7 @@ struct scrcpy_options {
|
|||||||
int16_t window_y; // SC_WINDOW_POSITION_UNDEFINED for "auto"
|
int16_t window_y; // SC_WINDOW_POSITION_UNDEFINED for "auto"
|
||||||
uint16_t window_width;
|
uint16_t window_width;
|
||||||
uint16_t window_height;
|
uint16_t window_height;
|
||||||
uint16_t display_id;
|
uint32_t display_id;
|
||||||
bool show_touches;
|
bool show_touches;
|
||||||
bool fullscreen;
|
bool fullscreen;
|
||||||
bool always_on_top;
|
bool always_on_top;
|
||||||
|
|||||||
+14
-11
@@ -258,12 +258,12 @@ execute_server(struct server *server, const struct server_params *params) {
|
|||||||
char bit_rate_string[11];
|
char bit_rate_string[11];
|
||||||
char max_fps_string[6];
|
char max_fps_string[6];
|
||||||
char lock_video_orientation_string[5];
|
char lock_video_orientation_string[5];
|
||||||
char display_id_string[6];
|
char display_id_string[11];
|
||||||
sprintf(max_size_string, "%"PRIu16, params->max_size);
|
sprintf(max_size_string, "%"PRIu16, params->max_size);
|
||||||
sprintf(bit_rate_string, "%"PRIu32, params->bit_rate);
|
sprintf(bit_rate_string, "%"PRIu32, params->bit_rate);
|
||||||
sprintf(max_fps_string, "%"PRIu16, params->max_fps);
|
sprintf(max_fps_string, "%"PRIu16, params->max_fps);
|
||||||
sprintf(lock_video_orientation_string, "%"PRIi8, params->lock_video_orientation);
|
sprintf(lock_video_orientation_string, "%"PRIi8, params->lock_video_orientation);
|
||||||
sprintf(display_id_string, "%"PRIu16, params->display_id);
|
sprintf(display_id_string, "%"PRIu32, params->display_id);
|
||||||
const char *const cmd[] = {
|
const char *const cmd[] = {
|
||||||
"shell",
|
"shell",
|
||||||
"CLASSPATH=" DEVICE_SERVER_PATH,
|
"CLASSPATH=" DEVICE_SERVER_PATH,
|
||||||
@@ -393,6 +393,12 @@ static int
|
|||||||
run_wait_server(void *data) {
|
run_wait_server(void *data) {
|
||||||
struct server *server = data;
|
struct server *server = data;
|
||||||
cmd_simple_wait(server->process, NULL); // ignore exit code
|
cmd_simple_wait(server->process, NULL); // ignore exit code
|
||||||
|
|
||||||
|
mutex_lock(server->mutex);
|
||||||
|
server->process_terminated = true;
|
||||||
|
cond_signal(server->process_terminated_cond);
|
||||||
|
mutex_unlock(server->mutex);
|
||||||
|
|
||||||
// no need for synchronization, server_socket is initialized before this
|
// no need for synchronization, server_socket is initialized before this
|
||||||
// thread was created
|
// thread was created
|
||||||
if (server->server_socket != INVALID_SOCKET
|
if (server->server_socket != INVALID_SOCKET
|
||||||
@@ -401,12 +407,6 @@ run_wait_server(void *data) {
|
|||||||
// unblocked by closesocket(). Therefore, call both (close_socket()).
|
// unblocked by closesocket(). Therefore, call both (close_socket()).
|
||||||
close_socket(server->server_socket);
|
close_socket(server->server_socket);
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_lock(server->mutex);
|
|
||||||
server->process_terminated = true;
|
|
||||||
cond_signal(server->process_terminated_cond);
|
|
||||||
mutex_unlock(server->mutex);
|
|
||||||
|
|
||||||
LOGD("Server terminated");
|
LOGD("Server terminated");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -539,18 +539,21 @@ server_stop(struct server *server) {
|
|||||||
mutex_lock(server->mutex);
|
mutex_lock(server->mutex);
|
||||||
int r = 0;
|
int r = 0;
|
||||||
if (!server->process_terminated) {
|
if (!server->process_terminated) {
|
||||||
#define WATCHDOG_DELAY_MS 2000
|
#define WATCHDOG_DELAY_MS 1000
|
||||||
r = cond_wait_timeout(server->process_terminated_cond,
|
r = cond_wait_timeout(server->process_terminated_cond,
|
||||||
server->mutex,
|
server->mutex,
|
||||||
WATCHDOG_DELAY_MS);
|
WATCHDOG_DELAY_MS);
|
||||||
}
|
}
|
||||||
mutex_unlock(server->mutex);
|
mutex_unlock(server->mutex);
|
||||||
|
|
||||||
// After this delay, kill the server.
|
// After this delay, kill the server if it's not dead already.
|
||||||
// On some devices, closing the sockets is not sufficient to wake up the
|
// On some devices, closing the sockets is not sufficient to wake up the
|
||||||
// blocking calls while the device is asleep.
|
// blocking calls while the device is asleep.
|
||||||
if (r == SDL_MUTEX_TIMEDOUT) {
|
if (r == SDL_MUTEX_TIMEDOUT) {
|
||||||
LOGW("Killing the server");
|
// FIXME There is a race condition here: there is a small chance that
|
||||||
|
// the process is already terminated, and the PID assigned to a new
|
||||||
|
// process.
|
||||||
|
LOGW("Killing the server...");
|
||||||
cmd_terminate(server->process);
|
cmd_terminate(server->process);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -43,7 +43,7 @@ struct server_params {
|
|||||||
uint16_t max_fps;
|
uint16_t max_fps;
|
||||||
int8_t lock_video_orientation;
|
int8_t lock_video_orientation;
|
||||||
bool control;
|
bool control;
|
||||||
uint16_t display_id;
|
uint32_t display_id;
|
||||||
bool show_touches;
|
bool show_touches;
|
||||||
bool stay_awake;
|
bool stay_awake;
|
||||||
bool force_adb_forward;
|
bool force_adb_forward;
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ cmd_execute(const char *const argv[], HANDLE *handle) {
|
|||||||
|
|
||||||
bool
|
bool
|
||||||
cmd_terminate(HANDLE handle) {
|
cmd_terminate(HANDLE handle) {
|
||||||
return TerminateProcess(handle, 1) && CloseHandle(handle);
|
return TerminateProcess(handle, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
@@ -70,6 +70,7 @@ cmd_simple_wait(HANDLE handle, DWORD *exit_code) {
|
|||||||
if (exit_code) {
|
if (exit_code) {
|
||||||
*exit_code = code;
|
*exit_code = code;
|
||||||
}
|
}
|
||||||
|
CloseHandle(handle);
|
||||||
return !code;
|
return !code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
project('scrcpy', 'c',
|
project('scrcpy', 'c',
|
||||||
version: '1.16',
|
version: '1.17',
|
||||||
meson_version: '>= 0.48',
|
meson_version: '>= 0.48',
|
||||||
default_options: [
|
default_options: [
|
||||||
'c_std=c11',
|
'c_std=c11',
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@ android {
|
|||||||
applicationId "com.genymobile.scrcpy"
|
applicationId "com.genymobile.scrcpy"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode 19
|
versionCode 20
|
||||||
versionName "1.16"
|
versionName "1.17"
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
SCRCPY_DEBUG=false
|
SCRCPY_DEBUG=false
|
||||||
SCRCPY_VERSION_NAME=1.16
|
SCRCPY_VERSION_NAME=1.17
|
||||||
|
|
||||||
PLATFORM=${ANDROID_PLATFORM:-30}
|
PLATFORM=${ANDROID_PLATFORM:-30}
|
||||||
BUILD_TOOLS=${ANDROID_BUILD_TOOLS:-30.0.0}
|
BUILD_TOOLS=${ANDROID_BUILD_TOOLS:-30.0.0}
|
||||||
|
|||||||
Reference in New Issue
Block a user