Commit Graph

251 Commits (api19)
 

Author SHA1 Message Date
Romain Vimont 1de8506a0d Support Android API 19
Since "adb forward" fallback has been implemented, it is easy to support
API 19.

Replace the incompatible calls related to MediaCodec to use
minSdkVersion 19 instead of 21.
6 years ago
Romain Vimont 71f50fb697 Merge branch 'master' into dev 6 years ago
Romain Vimont 82efff34e8 Factorize texture creation
SDL_CreateTexture() is called both during initialization and on frame
size change.

To avoid inconsistent changes to arguments value, factorize them to a
single function create_texture().
6 years ago
Romain Vimont 860006e082 Forward double-click events
Double-clicks were not sent to the device anymore since the
"double-click on black borders" feature.

When a double click occurs inside the device screen, send the event to
the device normally.

Fixes <https://github.com/Genymobile/scrcpy/issues/97>.
6 years ago
Romain Vimont 57eaf05289 Improve startup time when show_touches is enabled
Enabling "show touches" involves the execution of an adb command, which
takes some time.

In order to parallelize, execute the command as soon as possible, but
reap the process only once everything is initialized.
6 years ago
Romain Vimont dd2a5c1ecf Disable "show touches" once window is closed
If --show-touches is set, then the option must be disabled on quit.

Since it executes an adb command, it takes some time, so close the
window beforehand so that the close window button does not seem
unresponsive.
6 years ago
Romain Vimont 66ec252893 Add an option to enable "show touches"
Add -t/--show-touches option to show physical touches while scrcpy is
running.

See <https://github.com/Genymobile/scrcpy/issues/96>.
6 years ago
Romain Vimont b13d25b9f4 Group scrcpy options into a struct
The scrcpy() function accepts as many parameters as there are options.

To simplify, group all options in a separate struct.
6 years ago
Romain Vimont b449c09442 Merge branch 'master' into dev 6 years ago
Romain Vimont 8b84492830 Merge branch 'stek29/macos' (#56)
macOS specific README changes
6 years ago
Viktor Oreshkin 4d50832f8e Add instructions to install Java 8 on macOS
And remove gcc from the packages list, clang is available by default.
6 years ago
Romain Vimont e0e8dfeb3b
Merge pull request #94 from pierlon/pierlon-patch-1
Add instructions to run via Docker
6 years ago
Romain Vimont f4d6449af7
Merge pull request #95 from Sea-n/patch-1
Update README.md
6 years ago
Sean 64963fff62
Update README.md
Fix Typo
6 years ago
Pierre Gordon b7d9b8739c
Add instructions to run via Docker 6 years ago
Romain Vimont 88f6b43c8f
Merge pull request #93 from CampbellOwen/patch-1
Add links to FFmpeg and LibSDL2 dependencies
6 years ago
Owen Campbell 324a264233
Change links to wikipedia 6 years ago
Owen Campbell 3bb2cda955
Add links to FFmpeg and LibSDL2 dependencies 6 years ago
Romain Vimont 35298bb0c6 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).
6 years ago
Romain Vimont 73c332e3e4 Unref last packet on exit 6 years ago
Romain Vimont 15014f2689 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).
6 years ago
Romain Vimont 29b5c5b8f4 Merge branch 'arich/addShake' into dev (#85)
Add support for CTRL+S to send hardware "shake" to device
6 years ago
Romain Vimont 88ee6bc928 Swap MENU and APP_SWITCH shortcuts
Ctrl+s was mapped to MENU, while Ctrl+m was mapped to APP_SWITCH.

To avoid confusion, swap the shortcuts:
 - Ctrl+m like _M_enu
 - Ctrl+s like _S_witch
6 years ago
Romain Vimont 35e9a64c34 Rename "shake" to "menu"
The action sends AKEYCODE_MENU, so just name it "menu".

See <https://github.com/Genymobile/scrcpy/pull/85>.
6 years ago
Romain Vimont 9cac38fe58 Describe workaround to get output on Windows
Since nothing is printed to the console, we need a way to get the output
in case of errors.

Describe how in the README.
6 years ago
Andy Rich 301c52b603 Add support for CTRL+S to send hardware "shake" to device w/readme 6 years ago
Romain Vimont f00c6c5b13 Disable custom SDL signal handlers
Request SDL not to replace the SIGINT and SIGTERM handlers, so that the
process is immediately terminated on Ctrl+C.

This avoids process hanging on Ctrl+C during network calls on
initialization.

Some of them accepted a timeout, but it was not used since
commit 9b056f5091 anymore.
6 years ago
Romain Vimont 3b3803da0d Remove useless blocks in switch/case
Remove unnecessary additional blocks.
6 years ago
Romain Vimont f5cf6c1b2c Include source root directory
All headers and sources are in src/. To avoid using relative includes
from subdirectories ("../../"), include the source root directory.
6 years ago
Romain Vimont 2573df9727 Document the step to clone the project
This is not obvious to everyone, especially non-developers.
6 years ago
Romain Vimont c65cb36d3b Increase the number of connection attempts
In "adb forward" mode, it may take a while before the server socket is
listening, so increase the number of connection attempts.

See <https://github.com/Genymobile/scrcpy/issues/5#issuecomment-373718551>.
6 years ago
Romain Vimont 821ec9843c Fix win32 build
The types size_t and ssize_t are defined on Windows (in MSYS2), so there
is no need to typedef SIZE_T and SSIZE_T.

Exit code is "unsigned long" both on Windows 32 and 64 bits.

See <https://github.com/Genymobile/scrcpy/issues/46#issuecomment-373603596>.
6 years ago
Romain Vimont f16bd88802 Remove useless cast
For consistency with mouse button events handling, directly assign from
Sint32 to Uint16.
6 years ago
Romain Vimont f3e8834a3c Fix warning message
Mouse "wheel button" is meaningless :)
6 years ago
Romain Vimont 080df5eb5d Fix switch/case code style
For readability and consistency, indent case statatements, and remove
unnecessary additional blocks.
6 years ago
Romain Vimont 047179f232 Add FAQ section about mouse clicks
On some devices, mouse clicks do not work by default. Enabling an option
is required.
6 years ago
Romain Vimont 2992dda497 Add link to the article for v1.1 in README 6 years ago
Romain Vimont 6406f64edc Update FAQ after v1.1 release
Two issues described in the FAQ have been fixed by V1.1. Remove them
from the FAQ.
6 years ago
Romain Vimont f3f19d4e1d Update links to v1.1 in README 6 years ago
Romain Vimont d744837f13 Bump version to 1.1 6 years ago
Romain Vimont f7bc0bd5b5 Merge branch 'dev' into release 6 years ago
Romain Vimont 8a3c6a3ae7 Remove useless argument
Do not pass any data to the event watcher, it is unused.
6 years ago
Romain Vimont c530d95881 Immediately close the server socket on the device
In "adb forward" mode, close the server socket as soon as the client is
connected.

Even if unlikely to be useful, it allows to run several instances of
scrcpy also in "adb forward" mode.
6 years ago
Romain Vimont 0b1e59186f Workaround continuous resizing on Windows/MacOS
On Windows and MacOS, resizing blocks the event loop, so resizing events
are not triggered:
 - <https://bugzilla.libsdl.org/show_bug.cgi?id=2077>
 - <https://stackoverflow.com/a/40693139/1987178>

As a workaround, register an event watcher to render the screen from
another thread.

Since the whole event loop is blocked during resizing, the screen
content is not refreshed (on Windows and MacOS) until resizing ends.
6 years ago
Romain Vimont e69f6f710d Disable stdout/stderr buffering on Windows
In MSYS2 on Windows, the output is buffered by default. Disable
buffering to print output immediately.

Note that in cmd.exe, it still prints nothing.
6 years ago
Romain Vimont b858204786 Remove black borders on double-click
Resize the window to fit the device screen on click on black borders
(same as Ctrl+x).

Suggested-by: Guillaume Roche <groche@genymobile.com>
6 years ago
Romain Vimont e8510a8cc3 Add links to AUR packages in README 6 years ago
Romain Vimont 1038bad385 Make it work over tcpip
"adb reverse" currently does not work over tcpip (i.e. on a device
connected by "adb connect"):
<https://issuetracker.google.com/issues/37066218>

To work around the problem, if the call to "adb reverse" fails, then
fallback to "adb forward", and reverse the client/server roles.

Keep the "adb reverse" mode as the default because it does not involve
connection retries: when using "adb forward", the client must try to
connect successively until the server listens.

Due to the tunnel, every connect() will succeed, so the client must
attempt to read() to detect a connection failure. For this purpose, when
using the "adb forward" mode, the server initially writes a dummy byte,
read by the client.

Fixes <https://github.com/Genymobile/scrcpy/issues/5>.
6 years ago
Romain Vimont 2b3ed5bcdb Store serial in server instance
The serial is needed for many server actions, but this is an
implementation detail, so the caller should not have to provide it on
every call.

Instead, store the serial in the server instance on server_start().

This paves the way to implement the "adb forward" fallback properly.
6 years ago
Romain Vimont 9e328ef98b Always use the best render scale quality available
Because why not.

See <https://wiki.libsdl.org/SDL_HINT_RENDER_SCALE_QUALITY>.
6 years ago