From 15014f268931bd5bca39a50f80573bbe4b1a3a5e Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Fri, 23 Mar 2018 10:55:16 +0100 Subject: [PATCH 1/8] Clarify adb requirements Since _scrcpy_ also supports `adb forward`, remove the part about `adb reverse`. Make explicit that _adb_ is included in the prebuilt application for Windows (many users manually download the platform-tools for no reason). --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5be9a8a7..8757bb72 100644 --- a/README.md +++ b/README.md @@ -11,12 +11,12 @@ and _MacOS_. The Android part requires at least API 21 (Android 5.0). -You need [adb] (recent enough so that `adb reverse` is implemented, it works -with 1.0.36). It is available in the [Android SDK platform -tools][platform-tools], on packaged in your distribution (`android-adb-tools`). +You need [adb]. It is available in the [Android SDK platform +tools][platform-tools], or packaged in your distribution (`android-adb-tools`). -On Windows, just download the [platform-tools][platform-tools-windows] and -extract the following files to a directory accessible from your `PATH`: +On Windows, if you use the [prebuilt application](#windows), it is already +included. Otherwise, just download the [platform-tools][platform-tools-windows] +and extract the following files to a directory accessible from your `PATH`: - `adb.exe` - `AdbWinApi.dll` - `AdbWinUsbApi.dll` From 73c332e3e4c3a4bcc6a23528f2ad050a67391e20 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Fri, 23 Mar 2018 13:57:32 +0100 Subject: [PATCH 2/8] Unref last packet on exit --- app/src/decoder.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/decoder.c b/app/src/decoder.c index 1932875b..68c1c500 100644 --- a/app/src/decoder.c +++ b/app/src/decoder.c @@ -91,7 +91,11 @@ static int run_decoder(void *data) { packet.data = NULL; packet.size = 0; - while (!av_read_frame(format_ctx, &packet) && !avio_ctx->eof_reached) { + while (!av_read_frame(format_ctx, &packet)) { + if (avio_ctx->eof_reached) { + av_packet_unref(&packet); + goto run_quit; + } // the new decoding/encoding API has been introduced by: // #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 37, 0) From 35298bb0c60cdc6c55952de95ff7b92ff35130c7 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Fri, 23 Mar 2018 14:01:58 +0100 Subject: [PATCH 3/8] Process the last video frame On H.264 stream EOF, the eof_reached flag is set, but av_read_frame() still provides a frame, so check the flag only afterwards. As a side-effect, it also fixes a memory leak (the very last packet was not unref). --- app/src/decoder.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/decoder.c b/app/src/decoder.c index 68c1c500..94dc9401 100644 --- a/app/src/decoder.c +++ b/app/src/decoder.c @@ -92,10 +92,6 @@ static int run_decoder(void *data) { packet.size = 0; while (!av_read_frame(format_ctx, &packet)) { - if (avio_ctx->eof_reached) { - av_packet_unref(&packet); - goto run_quit; - } // the new decoding/encoding API has been introduced by: // #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 37, 0) @@ -129,6 +125,10 @@ static int run_decoder(void *data) { } #endif av_packet_unref(&packet); + + if (avio_ctx->eof_reached) { + break; + } } LOGD("End of frames"); From 3bb2cda955590ed3c9e5227220efa1348d01b60e Mon Sep 17 00:00:00 2001 From: Owen Campbell Date: Sat, 24 Mar 2018 00:55:05 -0700 Subject: [PATCH 4/8] Add links to FFmpeg and LibSDL2 dependencies --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8757bb72..cf72d38d 100644 --- a/README.md +++ b/README.md @@ -23,13 +23,14 @@ and extract the following files to a directory accessible from your `PATH`: Make sure you [enabled adb debugging][enable-adb] on your device(s). +The client requires [FFmpeg] and [LibSDL2]. + [adb]: https://developer.android.com/studio/command-line/adb.html [enable-adb]: https://developer.android.com/studio/command-line/adb.html#Enabling [platform-tools]: https://developer.android.com/studio/releases/platform-tools.html [platform-tools-windows]: https://dl.google.com/android/repository/platform-tools-latest-windows.zip - -The client requires _FFmpeg_ and _LibSDL2_. - +[ffmpeg]: https://ffmpeg.org/ +[LibSDL2]: https://www.libsdl.org/download-2.0.php ## Build and install From 324a2642330e12249530fa77652f091445356298 Mon Sep 17 00:00:00 2001 From: Owen Campbell Date: Sat, 24 Mar 2018 01:09:41 -0700 Subject: [PATCH 5/8] Change links to wikipedia --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cf72d38d..801cfe54 100644 --- a/README.md +++ b/README.md @@ -29,8 +29,8 @@ The client requires [FFmpeg] and [LibSDL2]. [enable-adb]: https://developer.android.com/studio/command-line/adb.html#Enabling [platform-tools]: https://developer.android.com/studio/releases/platform-tools.html [platform-tools-windows]: https://dl.google.com/android/repository/platform-tools-latest-windows.zip -[ffmpeg]: https://ffmpeg.org/ -[LibSDL2]: https://www.libsdl.org/download-2.0.php +[ffmpeg]: https://en.wikipedia.org/wiki/FFmpeg +[LibSDL2]: https://en.wikipedia.org/wiki/Simple_DirectMedia_Layer ## Build and install From b7d9b8739cff408b9964931ba11429c800f7be7d Mon Sep 17 00:00:00 2001 From: Pierre Gordon <16200219+pierlon@users.noreply.github.com> Date: Sat, 24 Mar 2018 23:15:14 -0500 Subject: [PATCH 6/8] Add instructions to run via Docker --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 801cfe54..d15abde2 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,10 @@ install it manually and make it available from the `PATH`: export PATH="$JAVA_HOME/bin:$PATH" ``` +#### Docker + +See [pierlon/scrcpy-docker](https://github.com/pierlon/scrcpy-docker). + ### Common steps Install the [Android SDK] (_Android Studio_), and set `ANDROID_HOME` to From 64963fff624ecd3ceaafb40679aa5f7aa29deadb Mon Sep 17 00:00:00 2001 From: Sean Date: Sun, 25 Mar 2018 17:51:29 +0800 Subject: [PATCH 7/8] Update README.md Fix Typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 801cfe54..a6ed1016 100644 --- a/README.md +++ b/README.md @@ -262,7 +262,7 @@ To run without installing: | click on `VOLUME_UP` | `Ctrl`+`+` | | click on `VOLUME_DOWN` | `Ctrl`+`-` | | click on `POWER` | `Ctrl`+`p` | - | turn screen on | _Right-click¹_ | + | turn screen on | _Right-click²_ | | paste computer clipboard to device | `Ctrl`+`v` | | enable/disable FPS counter (on stdout) | `Ctrl`+`i` | From 4d50832f8ea71e2039092a83e2523b41c77a00e8 Mon Sep 17 00:00:00 2001 From: Viktor Oreshkin Date: Tue, 13 Mar 2018 05:35:38 +0300 Subject: [PATCH 8/8] Add instructions to install Java 8 on macOS And remove gcc from the packages list, clang is available by default. --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fb516f56..2cfc2301 100644 --- a/README.md +++ b/README.md @@ -125,13 +125,16 @@ Use [Homebrew] to install the packages: brew install sdl2 ffmpeg # client build dependencies -brew install gcc pkg-config meson +brew install pkg-config meson ``` -Java (>= 7) is not available in Homebrew, so if you plan to build the server, -install it manually and make it available from the `PATH`: +Additionally, if you want to build the server, install Java 8 from Caskroom, and +make it avaliable from the `PATH`: ```bash +brew tap caskroom/versions +brew cask install java8 +export JAVA_HOME="$(/usr/libexec/java_home --version 1.8)" export PATH="$JAVA_HOME/bin:$PATH" ```