Meson decided to crossbuild for Windows as soon as
meson.is_cross_build() returned true. This made non-Windows crossbuilds
fail.
Instead, add an explicit option "crossbuild_windows".
Fixes <https://github.com/Genymobile/scrcpy/issues/165>.
On Windows, an application is either console or gui, it cannot be both.
Scrcpy should be both: it outputs important information to console, but
we still want to be able to ignore the console and launch it without a
visible cmd.exe window.
Therefore, build two binaries:
- scrcpy.exe
- scrcpy-noconsole.exe
Build the Windows binary from mingw on Linux, using the official
prebuilt binaries for ffmpeg, SDL2 and adb.
MSYS2 and all its packaged dll are not necessary anymore.
In practice, proc_show_touches may not be used uninitialized, since it
checks the flag options->show_touches, but the compiler can't know that,
so initialize it to avoid the warning.
I could not make Ctrl+'+' and Ctrl+'-' work for every keyboard on every
platform.
Instead, use Ctrl+UP and Ctrl+DOWN (like in VLC) to change the volume.
Fixes <https://github.com/Genymobile/scrcpy/issues/103>.
The application is now packaged for Homebrew:
<https://github.com/Homebrew/homebrew-core/pull/25173>
Give instructions to install it from Homebrew for macOS (it's much
easier).
Thanks to @stek29 for the formula ;-)
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().
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>.
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.
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.
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).
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).