Merge branch 'master' into dev

This commit is contained in:
Romain Vimont 2018-04-08 12:41:51 +02:00
commit 78da66f126
7 changed files with 43 additions and 8 deletions

9
FAQ.md
View file

@ -79,3 +79,12 @@ meson x --buildtype release -Dhidpi_support=false
``` ```
However, the video will be displayed at lower resolution. However, the video will be displayed at lower resolution.
### KWin compositor crashes
On Plasma Desktop, compositor is disabled while _scrcpy_ is running.
As a workaround, [disable "Block compositing"][kwin].
[kwin]: https://github.com/Genymobile/scrcpy/issues/114#issuecomment-378778613

View file

@ -9,6 +9,9 @@
# #
# "make release-portable" builds a zip containing the client and the server. # "make release-portable" builds a zip containing the client and the server.
# #
# On Windows with MSYS2/mingw64, execute:
# GRADLE="$PWD/gradlew" mingw32-make release-portable
#
# This is a simple Makefile because Meson is not flexible enough to execute some # This is a simple Makefile because Meson is not flexible enough to execute some
# arbitrary commands. # arbitrary commands.

View file

@ -107,6 +107,20 @@ pacman -S mingw-w64-x86_64-make \
mingw-w64-x86_64-meson mingw-w64-x86_64-meson
``` ```
For a 32 bits version, replace `x86_64` by `i686`:
```bash
# runtime dependencies
pacman -S mingw-w64-i686-SDL2 \
mingw-w64-i686-ffmpeg
# client build dependencies
pacman -S mingw-w64-i686-make \
mingw-w64-i686-gcc \
mingw-w64-i686-pkg-config \
mingw-w64-i686-meson
```
Java (>= 7) is not available in MSYS2, so if you plan to build the server, Java (>= 7) is not available in MSYS2, so if you plan to build the server,
install it manually and make it available from the `PATH`: install it manually and make it available from the `PATH`:
@ -116,10 +130,17 @@ export PATH="$JAVA_HOME/bin:$PATH"
#### Mac OS #### Mac OS
Use [Homebrew] to install the packages: The application is available in [Homebrew]. Just install it:
[Homebrew]: https://brew.sh/ [Homebrew]: https://brew.sh/
```bash
brew install scrcpy
```
Instead, you may want to build it manually. Install the packages:
```bash ```bash
# runtime dependencies # runtime dependencies
brew install sdl2 ffmpeg brew install sdl2 ffmpeg

View file

@ -73,6 +73,7 @@ static enum android_metastate convert_meta_state(SDL_Keymod mod) {
static SDL_bool convert_keycode(SDL_Keycode from, enum android_keycode *to) { static SDL_bool convert_keycode(SDL_Keycode from, enum android_keycode *to) {
switch (from) { switch (from) {
MAP(SDLK_RETURN, AKEYCODE_ENTER); MAP(SDLK_RETURN, AKEYCODE_ENTER);
MAP(SDLK_KP_ENTER, AKEYCODE_NUMPAD_ENTER);
MAP(SDLK_ESCAPE, AKEYCODE_ESCAPE); MAP(SDLK_ESCAPE, AKEYCODE_ESCAPE);
MAP(SDLK_BACKSPACE, AKEYCODE_DEL); MAP(SDLK_BACKSPACE, AKEYCODE_DEL);
MAP(SDLK_TAB, AKEYCODE_TAB); MAP(SDLK_TAB, AKEYCODE_TAB);

View file

@ -82,11 +82,11 @@ ssize_t net_recv_all(socket_t socket, void *buf, size_t len) {
return recv(socket, buf, len, MSG_WAITALL); return recv(socket, buf, len, MSG_WAITALL);
} }
ssize_t net_send(socket_t socket, void *buf, size_t len) { ssize_t net_send(socket_t socket, const void *buf, size_t len) {
return send(socket, buf, len, 0); return send(socket, buf, len, 0);
} }
ssize_t net_send_all(socket_t socket, void *buf, size_t len) { ssize_t net_send_all(socket_t socket, const void *buf, size_t len) {
ssize_t w; ssize_t w;
while (len > 0) { while (len > 0) {
w = send(socket, buf, len, 0); w = send(socket, buf, len, 0);
@ -94,7 +94,7 @@ ssize_t net_send_all(socket_t socket, void *buf, size_t len) {
return -1; return -1;
} }
len -= w; len -= w;
buf += w; buf = (char *) buf + w;
} }
return w; return w;
} }

View file

@ -26,8 +26,8 @@ socket_t net_accept(socket_t server_socket);
// the _all versions wait/retry until len bytes have been written/read // the _all versions wait/retry until len bytes have been written/read
ssize_t net_recv(socket_t socket, void *buf, size_t len); ssize_t net_recv(socket_t socket, void *buf, size_t len);
ssize_t net_recv_all(socket_t socket, void *buf, size_t len); ssize_t net_recv_all(socket_t socket, void *buf, size_t len);
ssize_t net_send(socket_t socket, void *buf, size_t len); ssize_t net_send(socket_t socket, const void *buf, size_t len);
ssize_t net_send_all(socket_t socket, void *buf, size_t len); ssize_t net_send_all(socket_t socket, const void *buf, size_t len);
// how is SHUT_RD (read), SHUT_WR (write) or SHUT_RDWR (both) // how is SHUT_RD (read), SHUT_WR (write) or SHUT_RDWR (both)
SDL_bool net_shutdown(socket_t socket, int how); SDL_bool net_shutdown(socket_t socket, int how);
SDL_bool net_close(socket_t socket); SDL_bool net_close(socket_t socket);

View file

@ -3,6 +3,9 @@ package com.genymobile.scrcpy;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.MotionEvent; import android.view.MotionEvent;
import org.junit.Assert;
import org.junit.Test;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream; import java.io.DataOutputStream;
@ -10,8 +13,6 @@ import java.io.IOException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.Arrays; import java.util.Arrays;
import org.junit.Assert;
import org.junit.Test;
public class ControlEventReaderTest { public class ControlEventReaderTest {