The order of cleanup was not the reverse as the initialization order. As
a consequence, recorder_destroy() could theoretically be called even if
recorder_init() failed.
The deprecated avcodec_decode_video2() should always the whole packet,
so there is no need to loop (cf doc/examples/demuxing_decoding.c in
FFmpeg).
This hack changed the packet size and data pointer. This broke recording
which used the same packet.
The extradata buffer is owned by libav, so it must be allocated with
av_malloc(), not SDL_malloc().
This fixes a crash on Windows during avformat_free_context().
Windows does not support UTF-8, so pushing a file with non-ASCII
characters failed.
Convert the UTF-8 command line to a wide characters string and call
CreateProcessW().
Fixes <https://github.com/Genymobile/scrcpy/issues/422>
Implement recording to Matroska files.
The format to use is determined by the option -F/--record-format if set,
or by the file extension (".mp4" or ".mkv").
Some containers force their own time base. For example, matroska
overwrite time_base to (AVRational) {1, 1000}.
Therefore, rescale our packet timestamps to the output stream time base.
Suggested-by: Steve Lhomme <robux4@ycbcr.xyz>
It is very convenient when I play mobile game and watch video at the
same time.
Tested on Linux mint Cinnamon as well as Windows 10.
Signed-off-by: Yu-Chen Lin <npes87184@gmail.com>
Add a script to generate the whole release properly.
It first builds locally in release mode, then execute tests. Then it
builds archives for Windows. Finally, it puts all release files (Windows
archives, prebuilt server and checksums) in a separate release
directory.
Commit fefb9816a9 modified mouse events
serialization. The server-side parsing was updated to correctly read the
position, but the expected size of these events was not updated.
As a result, the server might try to parse incomplete events, leading
to BufferUnderflowException.
Fixes
<https://github.com/Genymobile/scrcpy/issues/350#issuecomment-456298816>.
The arguments are saved to variable when script started. Instead of
using $1, $2 and $3, we can use these variables.
Signed-off-by: yuchenlin <npes87184@gmail.com>
To clean up the device, the client executed "adb shell rm" once the
server was guaranteed to be started (after the connection succeeded).
This implied to track whether the installation state, and failed if an
additional tunnel was used in "forward" mode:
<https://github.com/Genymobile/scrcpy/issues/386#issuecomment-453936034>
Instead, make the server unlink itself on start.
Mouse events position were unsigned (so negative values could not be
handled properly).
To avoid issues with negative values, mouse events outside the device
screen were ignored (commit a7fe9ad779).
But as a consequence, drag&drop were "broken" if the "drop" occurred
outside the device screen.
Instead, use signed 32-bits to store the position, and forward events
outside the device screen.
Fixes <https://github.com/Genymobile/scrcpy/issues/357>.
The package ninja-build should be installed automatically as a meson
dependency, but some users need to install a newer meson from pip3, so
ninja must be installed explicitly.
Never create a "struct point" with a position possibly outside the
device screen (i.e. in the black borders area), and do not transmit such
events.
This fixes an assertion failure on mouse wheel events outside the device
screen area.
The client passes parameters to the server via "adb shell" arguments.
Use "-" instead of "" when no crop is specified to avoid empty
arguments, which are not handled the same way on all devices.
Fixed <https://github.com/Genymobile/scrcpy/issues/337>.