Commit Graph

422 Commits (e7b7b083aad8c2e016cd5207988f5775cdaa19e9)
 

Author SHA1 Message Date
Romain Vimont e7b7b083aa Store the recording request in a local bool
This avoids to test explicitly whether options->record_filename is NULL.
5 years ago
Romain Vimont 8aeb5c0e3c Fix cleanup order
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.
5 years ago
Romain Vimont bcd4090d51 Fix recording with old decoding/encoding API
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.
5 years ago
Romain Vimont 84270e2d18 Rename "stop" to "interrupt"
The purpose of video_buffer_stop() is to interrupt any blocking call, so
rename it to video_buffer_interrupt().
5 years ago
Romain Vimont fff87095d9 Rename "frames" to "video_buffer"
It better describes the purpose of the structure.
5 years ago
Romain Vimont aacb09a3d6 Remove unused mutex field in decoder 5 years ago
Romain Vimont 7d10ec2b5a Add shortcut to expand/collapse notification panel
Use Ctrl+n to expand, Ctrl+Shift+n to collapse.

Fixes <https://github.com/Genymobile/scrcpy/issues/392>
5 years ago
Romain Vimont 1c1fe5ec53 Use "always on top" only for SDL >= 2.0.5
The flag SDL_WINDOW_ALWAYS_ON_TOP is available since SDL 2.0.5.

Do not use it if SDL is older, to fix compilation failure.

Fixes <https://github.com/Genymobile/scrcpy/issues/432>
5 years ago
Romain Vimont 751600a7f9 Move all compat ifdefs definitions to compat.h
This allows to give a proper name to features requirements.
5 years ago
Romain Vimont 3fc11ee465 Update links to v1.7 in README and BUILD 5 years ago
Romain Vimont b7472a545e Bump version to 1.7 5 years ago
Romain Vimont f5f4e6b1c5 Allocate extradata with av_malloc()
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().
5 years ago
Romain Vimont 6c40dbd27d Regroup Windows-ifdefs in command.h 5 years ago
Romain Vimont 477c0a2cab Create process with wide chars on Windows
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>
5 years ago
Romain Vimont c0b65b14df Merge branch 'master' into dev 5 years ago
Romain Vimont b23cacfc1a Add recording logs
Log when recording is started and stopped.
5 years ago
Romain Vimont 0ed2373952 Support recording to MKV
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").
5 years ago
Romain Vimont 1aaad6ba35 Rescale packet timestamp to container time base
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>
5 years ago
Romain Vimont c8f0805b89 Write header file with correct extradata
When recording, the header must be written with extradata set to the
content of the very first packet.

Suggested-by: Steve Lhomme <robux4@ycbcr.xyz>

Fixes <https://github.com/Genymobile/scrcpy/issues/351>
Fixes <https://github.com/Genymobile/scrcpy/issues/416>
5 years ago
Romain Vimont ee3cba57a8 Forward FFmpeg logs
FFmpeg logs can be useful to understand the cause of issues.
5 years ago
Romain Vimont c11905b860 Add log verbose macro
This was the only log priority missing.
5 years ago
Romain Vimont 1a5ba59504 Fix memory leak on close
The buffer associated to the AVIOContext must be freed.
5 years ago
Romain Vimont aa07dfd2ca
Merge pull request #412 from npes87184/dev
app: add always_on_top
6 years ago
Yu-Chen Lin eca82e09c3 app: add always_on_top
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>
6 years ago
Romain Vimont eea478b9dc Add release script
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.
6 years ago
Romain Vimont 43ad402356
Merge pull request #411 from npes87184/master
tests: fix test_control_event_serialize
6 years ago
Yu-Chen Lin 4d30fa93ba tests: fix test_control_event_serialize
commit fefb9816a changed the protocol, fix the related testing case.

Signed-off-by: Yu-Chen Lin <npes87184@gmail.com>
6 years ago
Romain Vimont b35733edb6 Fix expected mouse event sizes
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>.
6 years ago
Romain Vimont 7764a836f1 Fix incorrect comment
Comment had not been updated along with the code.
6 years ago
Romain Vimont 0bfaf7b7ff Update links to v1.6 in README and BUILD 6 years ago
Romain Vimont 446c682374 Bump version to 1.6 6 years ago
Romain Vimont 3aacb7967d Merge branch 'dev' into master 6 years ago
Romain Vimont 06a0bbbc71 Update FFmpeg (4.1) for Windows
Include the last version of FFmpeg in Windows releases.
6 years ago
Romain Vimont d71e036f3a Do not disable screensaver
Keep screensaver enabled while scrcpy is running.

Fixes <https://github.com/Genymobile/scrcpy/issues/380>.
6 years ago
Romain Vimont b343a5dc59
Merge pull request #401 from npes87184/dev
input_manager: don't ignore double click event when clicking inside device
6 years ago
Yu-Chen Lin c5ec1a194c input_manager: don't ignore double click event when clicking inside device
Signed-off-by: Yu-Chen Lin <npes87184@gmail.com>
6 years ago
Romain Vimont 4f254d8232
Merge pull request #396 from npes87184/master
prepare-dep: use variable for better readability
6 years ago
Romain Vimont 1fdde490fd Mirror "secure" content
Some applications, like Silence, prevent the content of a window from
being viewed on non-secure displays:
<https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_SECURE>

We can mirror it by just creating a "secure" display:
<https://developer.android.com/reference/android/view/Display#FLAG_SECURE>
6 years ago
yuchenlin fb73aa101a prepare-dep: use variable for better readability
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>
6 years ago
Romain Vimont 39c5e71605 Make the server unlink itself
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.
6 years ago
Romain Vimont fefb9816a9 Handle mouse events outside device screen
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>.
6 years ago
Romain Vimont 7830859c21 Merge branch 'master' into dev 6 years ago
Romain Vimont 0e019f8ab8 Add a note to allow simulating input in README 6 years ago
Romain Vimont f7d02cad4b Add ninja-build to the packages list to install
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.
6 years ago
Romain Vimont a7fe9ad779 Ignore mouse events outside device screen
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.
6 years ago
Romain Vimont 1e22ebcac2 Always use non-empty arguments
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>.
6 years ago
Romain Vimont d81729ba39 Always expect 5 parameters for the server
The client always sends all the arguments, so there is no need to check.
6 years ago
Romain Vimont b2c3df7550 Point out that ninja must not be run as root
See https://github.com/Genymobile/scrcpy/issues/335.
6 years ago
Romain Vimont 46fec41b7b Move drag&drop features in README
Present how to install an APK and how to push a file in the "features"
section (instead of "shortcuts").
6 years ago
Romain Vimont 2876463d39 Fix read_packet() return value on error or EOF
Fix warning on error or EOF:

> Invalid return value 0 for stream protocol

See <http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=a606f27f4c610708fa96e35eed7b7537d3d8f712>.

Fixes <https://github.com/Genymobile/scrcpy/issues/333>.
6 years ago