Commit Graph

794 Commits (9e78b765da01843b4986f93179b0c92701269062)
 

Author SHA1 Message Date
Harsh Shandilya 9e78b765da Update to Gradle 6.3
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Signed-off-by: Romain Vimont <rom@rom1v.com>

-- Note from committer:

The binary gradle/wrapper/gradle-wrapper.jar has the expected SHA-256
checksum:

    $ curl -L https://services.gradle.org/distributions/gradle-6.3-wrapper.jar.sha256
    1cef53de8dc192036e7b0cc47584449b0cf570a00d560bfaa6c9eabe06e1fc06

All the changed files match an upgrade executed independently:
<https://docs.gradle.org/current/userguide/gradle_wrapper.html#sec:upgrading_wrapper>
4 years ago
Harsh Shandilya 271de0954a Update to AGP 3.6.2
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
4 years ago
Romain Vimont 54ccccd883 Replace SDL_Atomic by stdatomic from C11
There is no reason to use SDL atomics.
4 years ago
Romain Vimont bea1c11f8e Do not log success on failure
If calling the private API does not work, an exception is printed. In
that case, do not log that the action succeeded.
4 years ago
Romain Vimont 94e1696869 Do not warn on terminating the server
If the server is already dead, terminating it fails. This is expected.
4 years ago
Romain Vimont a346bb80f4 Do not block on accept() if server died
The server may die before connecting to the client. In that case, the
client was blocked indefinitely (until Ctrl+C) on accept().

To avoid the problem, close the server socket once the server process is
dead.
4 years ago
Romain Vimont d421741a83 Wait server from a separate thread
Create a thread just to wait for the server process exit.

This paves the way to simply wake up a blocking accept() in a portable
way.
4 years ago
Romain Vimont 64d5edce92 Refactor server_start() error handling
This avoids cleanup duplication.
4 years ago
e_vigurskiy 4150eedcdf Add display id parameter
Add --display command line parameter to specify a display id.

PR #1238 <https://github.com/Genymobile/scrcpy/pull/1238>

Signed-off-by: Romain Vimont <rom@rom1v.com>
4 years ago
Romain Vimont 5031b2c8ff Remove MagicNumber checkstyle
There are a lot of "magic numbers" that we really don't want to extract
as a constant.

Until now, many @SuppressWarnings annotations were added, but it makes
no sense to check for magic number if we silent the warnings everywhere.
4 years ago
Romain Vimont 4adf5fde6d Log device details on server start 4 years ago
Romain Vimont e050cfdcd6 Fix static_assert() parameters
In C11, static_assert() expects a message.
4 years ago
Romain Vimont dc7c677728 Accept negative window position
It seems to work on some window managers.

Fixes #1242 <https://github.com/Genymobile/scrcpy/issues/1242>
4 years ago
Romain Vimont 3504c0016b Add tests for control message length
This will avoid regressions for #1245.

<https://github.com/Genymobile/scrcpy/issues/1245>
4 years ago
Romain Vimont 89d1602185 Fix expected message length for touch events
The expected length for a touch event control message was incorrect. As
a consequence, a BufferUnderflowException could occur.

Fixes #1245 <https://github.com/Genymobile/scrcpy/issues/1245>
4 years ago
Romain Vimont 566ba766af Remove unused constant
It has not been removed when mouse and touch events have been merged.
4 years ago
Tzah Mazuz a0af402d96 Fix the printed versions (were opposite)
PR #1224 <https://github.com/Genymobile/scrcpy/pull/1224>

Signed-off-by: Romain Vimont <rom@rom1v.com>
4 years ago
Romain Vimont 600df37753 Mention AutoAdb in README 4 years ago
Romain Vimont 902b99174d Fix server debugger for Android >= 9
Add a compilation flag to select the debugger method to use:
 - old: Android < 9
 - new: Android >= 9

See <https://github.com/Genymobile/scrcpy/issues/1187#issuecomment-599075661>
4 years ago
Jaafar Biyadi cd69eb4a4f Handle NumPad events when NumLock is disabled
PR #1188 <https://github.com/Genymobile/scrcpy/pull/1188>
Fixes #1048 <https://github.com/Genymobile/scrcpy/issues/1048>

Signed-off-by: Romain Vimont <rom@rom1v.com>
4 years ago
Romain Vimont ae2d094362 Handle locked video orientation from ScreenInfo
Centralize video size management in ScreenInfo.

This allows to always send the correct initial video size to the client
if the video orientation is locked.
4 years ago
Romain Vimont c5f5d1e456 Rename "rotation" to "device rotation"
This paves the way to reduce confusion in ScreenInfo when it will handle
locked video orientation.
4 years ago
Romain Vimont 63286424bb Compute all screen info from ScreenInfo
Screen information was partially initialized from Device. Move this
initialization to ScreenInfo.
4 years ago
Romain Vimont da18c9cdab Remove useles import 4 years ago
yangfl d3281f4b67 Show a friendly hint for adb installation
Signed-off-by: Romain Vimont <rom@rom1v.com>
4 years ago
George Stamoulis 1982bc439b Add option to lock video orientation
PR #1151 <https://github.com/Genymobile/scrcpy/pull/1151>

Signed-off-by: Romain Vimont <rom@rom1v.com>
4 years ago
Romain Vimont ef56cc6ff7 Retrieve screen info once
The method getScreenInfo() is synchronized, and the result may change
between calls.

Call it once and store the result in a local variable.
4 years ago
Romain Vimont c0f428eb05 Merge branch 'master' into dev 4 years ago
Romain Vimont 4794ca8ae7 Use linear filtering
Anisotropic filtering makes no sense for scrcpy use case.

This (semantically) reverts 9e328ef98b.
4 years ago
George Stamoulis f903cd376d Documentation rectifications
PR #1151 <https://github.com/Genymobile/scrcpy/pull/1151>

Signed-off-by: Romain Vimont <rom@rom1v.com>
4 years ago
Camilo Martinez e8127375ae Add Chocolatey for Windows install
PR #1144 <https://github.com/Genymobile/scrcpy/pull/1144>

Signed-off-by: Romain Vimont <rom@rom1v.com>
4 years ago
Romain Vimont 1144f64214 Indicate that -s can also be used for TCP/IP 4 years ago
Romain Vimont 39356602ed Mention scrcpy Debian package in README 4 years ago
Romain Vimont 0fb22c3e98 Happy new year 2020! 4 years ago
Romain Vimont 96bd2c974d Do not report workarounds errors
Some workarounds are needed on some devices. But applying them may cause
exceptions on other devices, where they are not necessary anyway.

Do not report these errors in release builds.

Closes #994 <https://github.com/Genymobile/scrcpy/issues/994>
4 years ago
Romain Vimont dc7fcf3c7a Accept port range
Accept a range of ports to listen to, so that it does not fail if
another instance of scrcpy is currently starting.

The range can be passed via the command line:

    scrcpy -p 27183:27186
    scrcpy -p 27183  # implicitly 27183:27183, as before

The default is 27183:27199.

Closes #951 <https://github.com/Genymobile/scrcpy/issues/951>
4 years ago
Romain Vimont 2a3a9d4ea9 Add util function to parse a list of integers
This will help parsing arguments like '1234:5678' into a list of
integers.
4 years ago
Romain Vimont ca0031cbde Refactor server tunnel initialization
Start the server socket in enable_tunnel() directly.

For the caller point of view, enabling the tunnel opens a port (either
the server socket locally or the "adb forward" process).
4 years ago
Romain Vimont d1a9a76cc6 Reorder functions
Move functions so that they can be called from enable_tunnel() (in the
following commit).
4 years ago
Romain Vimont a8ceaf5284 Fix include order 4 years ago
Romain Vimont 83d48267a7 Accept --max-fps before Android 10
KEY_MAX_FPS_TO_ENCODER existed privately before Android 10:
<https://github.com/Genymobile/scrcpy/issues/488#issuecomment-567321437>
4 years ago
Romain Vimont db6252e52b Simplify net.c
The platform-specific code for net.c was implemented in sys/*/net.c.

But the differences are quite limited, so use ifdef-blocks in the single
net.c instead.
4 years ago
Romain Vimont 229eeb24a2 Merge pull request #1002 into dev
Fix utf-8 char path in windows

<https://github.com/Genymobile/scrcpy/pull/1002>
4 years ago
Yu-Chen Lin f9786e5034 Get env in windows correctly
Signed-off-by: Yu-Chen Lin <npes87184@gmail.com>
Signed-off-by: Romain Vimont <rom@rom1v.com>
4 years ago
Yu-Chen Lin 78a320a763 Fix utf-8 char path in windows
The file 'E:\安安\scrcpy-win64-v1.12.1-1-g31bd950\scrcpy-server'
exists, however, it will show msg as follow:

    INFO: scrcpy 1.12.1 <https://github.com/Genymobile/scrcpy>
    stat: No such file or directory
    ERROR: 'E:\安安\scrcpy-win64-v1.12.1-1-g31bd950\scrcpy-server' does
    not exist or is not a regular file
    Press any key to continue...

This patch fixes it.

Signed-off-by: Yu-Chen Lin <npes87184@gmail.com>
Signed-off-by: Romain Vimont <rom@rom1v.com>
4 years ago
Romain Vimont 7d5845196e Fix memory leak on portable builds
The function get_server_path() sometimes returned an owned string,
sometimes a non-owned string.

Always return an allocated (owned) string, and free it after usage.
4 years ago
Romain Vimont 31bd95022b Update links to v1.12.1 in README and BUILD 5 years ago
Romain Vimont 4687a0ebac Bump version to 1.12.1 5 years ago
Romain Vimont 6965d051ae Limit bitrate range to 31 bits integer
A proper solution could be to use "long long" instead (guaranteed to be
at least 64 bits), but it adds its own problems (e.g. "%lld" is not
supported as a printf format on all platforms).

In practice, we don't need such high values, so keep it simple.

Fixes #995 <https://github.com/Genymobile/scrcpy/issues/995>
5 years ago
Romain Vimont 71df3175bd Update links to v1.12 in README and BUILD 5 years ago