Romain Vimont
1eae139b6e
Add missing consts
...
String parsing functions should not be able to modify their input.
5 years ago
Romain Vimont
419c869c9c
Use ARRAY_LEN() macro in tests
5 years ago
Romain Vimont
929bf48c7e
Add tests for command-line parsing
5 years ago
Romain Vimont
d950383b72
Move command-line parsing to a separate file
5 years ago
Romain Vimont
61274a7cdb
Factorize integer argument parsing
...
Add util functions for integer parsing (with tests), and factorize
integer argument parsing to avoid code duplication.
5 years ago
Romain Vimont
64bcac9157
Refuse to push a non-regular file server
...
If SCRCPY_SERVER_PATH points to a directory, then a directory will be
pushed to /data/local/tmp/scrcpy-server.jar.
When executing it, app_process will just abort and leave the directory
on the device, causing scrcpy to always fail.
To avoid the problem, check that the server is a regular file before
pushing it.
Closes #956 <https://github.com/Genymobile/scrcpy/issues/956 >
5 years ago
Romain Vimont
3259c60b22
Fix test compilation on mingw
...
Including SDL2/SDL.h redefines main to SDL_main by default.
5 years ago
Romain Vimont
e0b117de13
Fix checkstyle warning
5 years ago
Romain Vimont
eb0f339271
Add shortcut to rotate screen
...
On Ctrl+r, disable auto-rotation (if enabled), set the screen rotation
and re-enable auto-rotation (if it was enabled).
Closes #11 <https://github.com/Genymobile/scrcpy/issues/11 >
5 years ago
Romain Vimont
bdd05b4a16
Refactor wrappers for Android SDK classes
...
Internally, a failure to invoke a method via reflection was partially
managed using exceptions, partially using a null return value.
Handle all errors at the same place, by not catching
NoSuchMethodException too early.
5 years ago
Romain Vimont
525d6d4a75
Try new methods before legacy ones
...
Use the legacy methods when the new ones do not exist.
5 years ago
Romain Vimont
4041043d1c
Merge pull request #967 into dev
...
Add some tests
<https://github.com/Genymobile/scrcpy/pull/967 >
5 years ago
Yu-Chen Lin
fbc86a616c
Correct coding style
...
Signed-off-by: Yu-Chen Lin <npes87184@gmail.com>
5 years ago
Yu-Chen Lin
b2bf25c52c
Add test_buffer_util
...
Signed-off-by: Yu-Chen Lin <npes87184@gmail.com>
5 years ago
Yu-Chen Lin
5eeaed09ae
Add test_strquote
...
Signed-off-by: Yu-Chen Lin <npes87184@gmail.com>
5 years ago
Romain Vimont
3100533e56
Fix "natural scrolling"
...
> Movements down (scroll backward) generate negative y values and up
> (scroll forward) generate positive y values.
> If direction is SDL_MOUSEWHEEL_FLIPPED the values in x and y will be
> opposite. Multiply by -1 to change them back.
<https://wiki.libsdl.org/SDL_MouseWheelEvent#Remarks >
The x and y values already take the scrolling configuration into
account. Reversing the values when the direction is flipped cancels the
scrolling configuration.
Therefore, just ignore the direction field.
Fixes <https://github.com/Genymobile/scrcpy/issues/966 >
5 years ago
Romain Vimont
8a694a9785
Suggest workaround for error 0xfffffc0e
...
When the hardware encoder is not able to encode at the given definition,
it fails with an error 0xfffffc0e.
It is documented in the FAQ:
<https://github.com/Genymobile/scrcpy/blob/master/FAQ.md#i-get-an-error-could-not-open-video-stream >
But it is better to directly suggest the workaround in the console.
5 years ago
Romain Vimont
26529d377f
Use virtual device id to avoid NPE
...
Inject mouse events using id -1 (virtual device) instead of 0 which
does not exist (and causes the InputDevice to be null).
Fixes <https://github.com/Genymobile/scrcpy/issues/962 >
5 years ago
Romain Vimont
15a206b7fc
Assert return value of mutex functions
...
Mutex functions may only fail due to a programming error.
Use assertions in debug builds, and ignore the value in release builds.
5 years ago
Romain Vimont
d0f5a7fd9f
Remove unused includes
...
No mutex is used in decoder.c and stream.c.
5 years ago
Romain Vimont
510caff0cd
Replace SDL_assert() by assert()
...
SDL_assert() open a dialog on assertion failure.
There is no reason not to use assert() directly.
5 years ago
Romain Vimont
b5ebb234dd
Replace BUILD_DEBUG by NDEBUG
...
Use the "standard" NDEBUG definition, which is used by assert().
5 years ago
Romain Vimont
73e8ec1b35
Remove path argument from cmd_execute()
...
It is always equal to argv[0] (or not used on Windows).
5 years ago
Romain Vimont
8dc11a0286
Fix warnings on Windows
...
fix warnings reported with -Dwarning_level=2 on Windows.
5 years ago
Romain Vimont
06104a701b
Fix windows build
...
Utilities have been moved to util/, but includes had not been updated
in Windows-specific files.
Ref: dfd0707a29
5 years ago
Romain Vimont
7637a113e3
Compile with warning_level=2 by default
5 years ago
Romain Vimont
31d9d56117
Fix warnings
...
Fix warnings reported with -Dwarning_level=2.
5 years ago
Romain Vimont
6abb8fd0cd
Reformat Java code
...
Reformated by Android studio to match the 150 characters column defined
in checkstyle.
5 years ago
Romain Vimont
2b845680b0
Initialize Application object to avoid NPE
...
When an ApplicationInfo is set (commit
90293240cc
), some devices (Nvidia Shield
TV) attempt to access the Application object, causing a
NullPointerException.
As a workaround, initialize an Application object.
Fixes <https://github.com/Genymobile/scrcpy/issues/940 >
5 years ago
Romain Vimont
ebdc2ee8b5
Rename variable for consistency
...
Use suffix "Field" for fields variables.
5 years ago
Romain Vimont
dfd0707a29
Move utilities to util/
5 years ago
Romain Vimont
83ace84280
Restore the .jar extension on the device side
...
Commit 3da95b52bd
renamed
'scrcpy-server.jar' to 'scrcpy-server' to avoid issues on the client
side.
However, removing the extension may cause issues with app_process, so
restore the extension only on the device side.
Fixes <https://github.com/Genymobile/scrcpy/issues/944 >
5 years ago
Romain Vimont
c9d886f38b
Use the existing constants for device server path
5 years ago
yangfl
7d7f3daff2
Fix aidl option in build_without_gradle.sh
...
Debian's aidl complains about the missing path for -o option.
Signed-off-by: Romain Vimont <rom@rom1v.com>
5 years ago
Romain Vimont
40c3c57613
Update links to v1.11 in README and BUILD
5 years ago
Romain Vimont
2aa65015bc
Bump version to 1.11
5 years ago
Romain Vimont
4906aff454
Upgrade platform-tools (29.0.5) for Windows
...
Include the latest version of adb in Windows releases.
5 years ago
Romain Vimont
cb6b300483
Upgrade FFmpeg (4.2.1) for Windows
...
Include the latest version of FFmpeg in Windows releases.
5 years ago
Romain Vimont
c2116082ab
Remove deprecated options from help and manpage
...
Ref: ff061b4f30
5 years ago
Romain Vimont
3599fcaae5
Fix help for --window-width and --window-height
...
The default value is 0 (automatic), not -1.
5 years ago
Romain Vimont
c610a6b3c7
Document scrcpy via SSH tunnel in README
5 years ago
Romain Vimont
704c0ff4dd
Document copy-paste and --prefer-text in README
5 years ago
Romain Vimont
b145b8d5f4
Reorganize features in README
5 years ago
act262
90293240cc
Fix meizu 16th NPE
...
Fill AppInfo to avoid NullPointerException on some devices.
Fixes <https://github.com/Genymobile/scrcpy/issues/365 >
Signed-off-by: Romain Vimont <rom@rom1v.com>
5 years ago
Romain Vimont
213c468c20
Move workarounds to a separate class
...
Extract workarounds (currently only one) to a separate class to avoid
polluting the main code.
5 years ago
Romain Vimont
18f2e33a8b
Fix noconsole.exe
...
The linker flag "-mwindows" has no effect on my current MinGW.
Instead, passing "-Wl,--subsystem,windows" works.
Fixes <https://github.com/Genymobile/scrcpy/issues/691 >
5 years ago
senta2006
7aed5d5b60
Fix typos
...
PR <https://github.com/Genymobile/scrcpy/pull/927 >
Signed-off-by: Romain Vimont <rom@rom1v.com>
5 years ago
Romain Vimont
601b0fecdd
Extract DEBUG flag in build_without_gradle.sh
5 years ago
Romain Vimont
7fd800d583
Generate VERSION_NAME in build_without_gradle.sh
...
Since commit b963a3b9d5
, the server uses
BuildConfig.VERSION_NAME.
Generate this field manually for building without gradle.
5 years ago
Romain Vimont
1d97d7213d
Add option --max-fps
...
Add an option to limit the capture frame rate. It only works for devices
with Android >= 10.
Fixes <https://github.com/Genymobile/scrcpy/issues/488 >
5 years ago