Commit Graph

565 Commits (e2996e85c0e2e75b012b259ba4346b0b6d7b1e9a)
 

Author SHA1 Message Date
Romain Vimont e2996e85c0 Update links to v1.9 in README and BUILD 5 years ago
Romain Vimont c2df0228a3 Merge branch 'dev' 5 years ago
Romain Vimont 259d3aee93 Bump version to 1.9 5 years ago
Romain Vimont 90859f1dcf Upgrade tarketSdkVersion to 29
This fixes a lint warning.
5 years ago
Romain Vimont 1afe9ce2ee Fix deprecation warning in Java unit test 5 years ago
Romain Vimont 273cec8a92 Fix typo in test name 5 years ago
Romain Vimont 02f189b1de Remove obsolete detail in README
Now that scrcpy-server.jar is found in the same directory as the
scrcpy executable, using SCRCPY_SERVER_PATH is not particularly useful
on Windows anymore
5 years ago
Romain Vimont 4abe163233 Remove obsolete explanation in FAQ
Issue 9 was about stdout/stderr not printed in Windows console. This is
solved since the Windows version is cross-compiled from Linux.
5 years ago
Romain Vimont 5ffdcbb7be Update DEVELOP.md 5 years ago
Romain Vimont ffe0417228 Update platform-tools (29.0.1) for Windows
Include the latest version of adb in Windows releases.
5 years ago
Romain Vimont e3afb67e7f Downgrade SDL to 2.0.8 for Windows
Revert "Update SDL (2.0.9) for Windows"

Several users experienced freezes with SDL 2.0.9.

This reverts commit a5787dccd6.

See:
 - <https://github.com/Genymobile/scrcpy/issues/425>
 - <https://discourse.libsdl.org/t/unstable-frame-rate-unexpectedly/25783>
5 years ago
Romain Vimont 4ee1391361 Upgrade FFmpeg (4.1.3) for Windows
Include the latest version of FFmpeg in Windows releases.
5 years ago
Romain Vimont 2755bfc255 Improve portable builds
In portable builds, scrcpy-server.jar was supposed to be present in the
current directory, so in practice it worked only if scrcpy was launched
from its own directory.

Instead, find the absolute path of the executable and build a suitable
path to use scrcpy-server.jar from the same directory.
5 years ago
Romain Vimont 3b17ff7c86 Add functions to convert wide char to UTF-8
There was already utf8_to_wide_char(), used to correctly execute
commands on Windows.

Add the reverse converter: utf8_from_wide_char(). We will need it to
build the scrcpy-server path based on the executable directory.
5 years ago
Romain Vimont 4eb6b26c93 Extract "scrcpy-server.jar" string
The filename is used at several places.
5 years ago
Romain Vimont eb34098add Simplify portable build configuration
To create a portable build (with scrcpy-server.jar accessible from the
scrcpy directory), replace OVERRIDE_SERVER_PATH by a simple compilation
flag: PORTABLE.

This paves the way to use more complex rules to determine the path of
scrcpy-server.jar in portable builds.
5 years ago
Romain Vimont b777760bca Simplify scrcpy-server path configuration
The full path of scrcpy-server.jar was partially configured from
meson.build then concatenated by C code.

Instead, directly write the path in C.
5 years ago
Romain Vimont 72bdfbc7a6 Never return 0 for stream protocol
On socket disconnection, on Linux, recv() returns -1 and errno is set.
But on Windows, errno is 0.

In that case, AVERROR(errno) == 0, leading to the warning:

> Invalid return value 0 for stream protocol

To avoid the problem, if errno is 0, return AVERROR_EOF.

Ref: commit 2876463d39
5 years ago
Romain Vimont 8604f16b30 Truncate device name at UTF-8 code point boundary
Just in case.
5 years ago
Romain Vimont 5d11339259 Inline lock_util functions
They are just tiny wrappers.
5 years ago
Romain Vimont e2a272bf99 Improve framerate counting
The FPS counter was called only on new frames, so it could not print
values regularly, especially when there are very few FPS (when the
device surface does not change).

To the extreme, it was never able to display 0 fps.

Add a separate thread to print framerate every second.
5 years ago
Romain Vimont d104d3bda9 Add cond_wait_timeout()
Add a "timed out" version of cond_wait().
5 years ago
Romain Vimont eda44b6068 Fix controller cleanup
After commit bfb86ca2c2, the controller
was not stopped and destroyed on quit.
5 years ago
Romain Vimont ebccb9f6cc Add runtime option to render expired frames
Replace the compilation flag SKIP_FRAMES by a runtime flag to force
rendering of expired frames. By default, the expired frames are skipped.
5 years ago
Romain Vimont a143b8b07a Indent command-line options
Prepare indentation for --render-expired-frames.
5 years ago
Romain Vimont 9253996873 Add README section explaining --turn-screen-off 5 years ago
Romain Vimont a13524e7f9 Replace android-tools-adb by adb
Here is the description of the adb package in Debian:

> Description: Android Debug Bridge
>
> A versatile command line tool that lets you communicate with an
> emulator instance or connected Android-powered device.
>
> This package recommends "android-sdk-platform-tools-common" which
> contains the udev rules for Android devices. Without this package, adb
> and fastboot need to be running with root permission.

And android-tools-adb:

> Description: transitional package
>
> This is a transitional package. It can safely be removed.
5 years ago
Romain Vimont f3f3433163
Merge pull request #574 from crow1170/patch-1
Fix dependencies
5 years ago
Chris Knowles 232aaa386e
Fix dependencies
Some missing or misspelled dependencies. Checked on Ubuntu 19.04.
5 years ago
Romain Vimont 8e66b33000 Add option to turn device screen off
In addition to the shortcut (Ctrl+o) to turn the device screen off, add
a command-line argument to turn it off on start.
5 years ago
Romain Vimont 7f07b13446 Indent command-line options
Preparse indentation for --turn-screen-off.
5 years ago
Romain Vimont acc4dcd520 Disable server controller if --no-control
If --no-control is disabled, there is no need for a controller.

It also avoids to power on the device on start if control is disabled.
5 years ago
Romain Vimont ca767ba364 Group server params in a struct
Starting the server requires more and more parameters. For clarity,
group them in a struct.
5 years ago
Romain Vimont c8a6783494 Use positive options names internally
For clarity, store the flag resulting of the command-line options
--no-control and --no-display into "control" and "display".
5 years ago
Romain Vimont 5b56900e2b Rename unused field
The flag is used only in the server_start() implementation, there is no
need to store it in the structure.
5 years ago
Romain Vimont 8c8649cfcd Remove "turn device screen on" feature
Only keep "turn device screen off" and POWER button.

After we turn the device screen off (with Ctrl+o), turning it back on
does not always work, and leaves the device in a weird state, where even
the power button may not be sufficient:
<https://github.com/Genymobile/scrcpy/issues/175#issuecomment-497946596>

This is not an acceptable behavior, so disable the shortcut to turn the
physical device screen on. We can use the POWER button (or Ctrl+p)
instead.
5 years ago
Romain Vimont e572d81fa2 Rename function to "power on"
This will reduce confusion between "power on" when the device is off and
"turn device screen off" while mirroring.
5 years ago
Romain Vimont 41225c3e41 Improve key processing readability
The condition "event->type == SDL_KEYDOWN" and the variable
input_manager->controller are used many times. Replace them by local
variables to reduce verbosity.
5 years ago
Romain Vimont 296047d82a Use net_close() to close sockets
So that it also works on Windows.
5 years ago
Romain Vimont 0792998cc2 Remove unused import
Introduced by the previous commit.
5 years ago
Romain Vimont 12a3bb25d3 Implement device screen off while mirroring
Add two shortcuts:
 - Ctrl+o to turn the device screen off while mirroring
 - Ctrl+Shift+o to turn it back on

On power on (either via the POWER key or BACK while screen is off), both
the device screen and the mirror are turned on.

<https://github.com/Genymobile/scrcpy/issues/175>
5 years ago
Romain Vimont 3ee9560ece Fix comment style
For consistency.
5 years ago
Yu-Chen Lin a56045dd80 Prevent socket leak on error
Signed-off-by: Yu-Chen Lin <npes87184@gmail.com>
Signed-off-by: Romain Vimont <rom@rom1v.com>
5 years ago
Yu-Chen Lin fcf225049d Use consistent variable names
Use the same variable name in functions declaration and definition.

Signed-off-by: Yu-Chen Lin <npes87184@gmail.com>
Signed-off-by: Romain Vimont <rom@rom1v.com>
5 years ago
Romain Vimont 6537c2ef01 Add clipboard logs
Synchronizing local and device clipboards in invisible. Add INFO logs
on success.
5 years ago
Romain Vimont 9712cb8123 Do not minimize on focus loss
The default behavior seems annoying.

Fixes <https://github.com/Genymobile/scrcpy/issues/554>
5 years ago
Romain Vimont ad55a9addc Prefix server logs
Sometimes, it is not obvious whether a log is generated by the server or
by the client. Prefix server logs for clarity.
5 years ago
Romain Vimont 28980bbc90 Rename "event" to "message"
After the recent refactorings, a "control event" is not necessarily an
"event" (it may be a "command"). Similarly, the unique "device event"
used to send the device clipboard content is more a "reponse" to the
request from the client than an "event".

Rename both to "message", and rename the message types to better
describe their intent.
5 years ago
Romain Vimont f710d76c9e
Merge pull request #568 from npes87184/dev
Correct return value type in handle_event
5 years ago
Yu-Chen Lin 2a8a3e6ed5 Correct return value type in handle_event
handle_event return the type enum event_result not bool

Signed-off-by: Yu-Chen Lin <npes87184@gmail.com>
5 years ago