Commit Graph

794 Commits (9e78b765da01843b4986f93179b0c92701269062)
 

Author SHA1 Message Date
Romain Vimont a0f8e7fd9f Bump version to 1.12 5 years ago
Romain Vimont e4cebc8d4c Do not build tests in release mode
Assertions would not be executed.

And as a side effect, it causes "unused variable" warnings.
5 years ago
Romain Vimont ba1b36758e Define SDL_MAIN_HANDLED in all tests
Each test defines its own main() function. If this flag is not set, then
SDL redefines it to SDL_main(), causing compilation failures.
5 years ago
Romain Vimont ad92a192b5 Fix meson.build codestyle 5 years ago
Romain Vimont 81a8e503e5 Describe screen rotation shortcut in README 5 years ago
Romain Vimont 242e57d69b Merge branch 'master' into dev 5 years ago
Romain Vimont 024c2f7e6b Configure log priority early
The log priority must be configured before parsing command-line
arguments, in order to get logs as expected.
5 years ago
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
Seb Leo 684e0abb74 Update BUILD.md to install adb package
PR <https://github.com/Genymobile/scrcpy/pull/965>

Signed-off-by: Romain Vimont <rom@rom1v.com>
5 years ago
Romain Vimont 86fcd89d80 Fix max size default value
Suggested-by: jurkov

Closes <https://github.com/Genymobile/scrcpy/issues/978>
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
yangfl 8bc056b9c6 Fix manpage format 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
seoyeonK 8ec077ce1b Add Korean translation for README and FAQ
PR <https://github.com/Genymobile/scrcpy/pull/934>

Signed-off-by: Romain Vimont <rom@rom1v.com>
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