Commit graph

1045 commits

Author SHA1 Message Date
Romain Vimont
63af7fbafe Reduce latency by 1 frame
To packetize the H.264 raw stream, av_parser_parse2() (called by
av_read_frame()) knows that it has received a full frame only after it
has received some data for the next frame. As a consequence, the client
always waited until the next frame before sending the current frame to
the decoder!

On the device side, we know packets boundaries. To reduce latency,
make the device always transmit the "frame meta" to packetize the stream
manually (it was already implemented to send PTS, but only enabled on
recording).

On the client side, replace av_read_frame() by manual packetizing and
parsing.

<https://stackoverflow.com/questions/50682518/replacing-av-read-frame-to-reduce-delay>
<https://trac.ffmpeg.org/ticket/3354>
2019-07-31 01:55:32 +02:00
Romain Vimont
a90ccbdf3b Add option to change the push target
A drag & drop always pushed the file to /sdcard/.

Add an option to customize the target directory.

Fixes <https://github.com/Genymobile/scrcpy/issues/659>
2019-07-31 01:53:16 +02:00
Romain Vimont
ca970e8aa6 Merge branch 'master' into dev 2019-07-31 00:14:17 +02:00
Romain Vimont
6b3d9e3eab Add unit test for device message serialization
There was a test for the deserialization, but not for the serialization.
2019-07-30 12:17:33 +02:00
Romain Vimont
02692ffa42 Rename "build_" to "compile_"
Recent versions of meson complain about an option having name starting
with "build_":

> DEPRECATION: Option uses prefix "build_", which is reserved for Meson.
> This will become an error in the future.

Use "compile_" instead.
2019-07-29 15:19:07 +02:00
Jonathan
3b69463e61 Update README.md
Signed-off-by: Romain Vimont <rom@rom1v.com>
2019-07-29 14:59:44 +02:00
Romain Vimont
9dea6d2384 Add me as copyright owner 2019-07-29 14:59:44 +02:00
Romain Vimont
3c55d0c69b Fix double-free on error
If writing the recording header fails, do not clean the resources
immediately to avoid double-free.
2019-07-12 21:07:06 +02:00
Romain Vimont
4961256123 Close decoder on stream ended
Add missing call to decoder_close().
2019-06-26 23:50:39 +02:00
Romain Vimont
e4ac943d86 Document --window-title in README 2019-06-24 21:37:38 +02:00
Romain Vimont
4b997239f3 Merge pull request #614 from beango1:window-title-simple
add option window-title to set the title
2019-06-24 21:32:45 +02:00
beango1
8e65c10720 Add option --window-title
Add an option to set a custom window title.

Signed-off-by: Romain Vimont <rom@rom1v.com>
2019-06-24 19:58:00 +02:00
Romain Vimont
056e47e752 Replace "cannot" by "could not" 2019-06-23 20:52:03 +02:00
Romain Vimont
439b009a79 Fix expected parameters count in error message 2019-06-23 20:47:21 +02:00
Romain Vimont
91ecb4f218 Close socket on error
Suggested-by: barry-ran

<https://github.com/Genymobile/scrcpy/issues/607>
2019-06-20 12:15:45 +02:00
Romain Vimont
bfb3f0842f Prevent to turn screen off if no control
If --no-control is set, then the controller is not initialized (both in
the client and the server), so it is not possible to control the device
to turn its screen off.

See <https://github.com/Genymobile/scrcpy/issues/608>.
2019-06-20 10:59:19 +02:00
Romain Vimont
87d7a157a9 Reference USBaudio from README 2019-06-20 10:47:02 +02:00
Romain Vimont
b91ecf5225 Fix --serial help
Make explicit that --serial excepts a parameter.
2019-06-18 17:13:53 +02:00
Romain Vimont
1807de4955 Merge pull request #595 from taaem/fix_build_fedora
The Java JDK is needed to build the server
2019-06-15 15:14:22 +02:00
taaem
0a233fd27f Fix required java package for Fedora
The Java JDK is needed to build the server. The relevant Fedora package
is java-devel, not java.

Signed-off-by: Romain Vimont <rom@rom1v.com>
2019-06-15 15:10:51 +02:00
Romain Vimont
4940746bcb Remove useless else
The if-block ends with a return.
2019-06-14 10:15:53 +02:00
Romain Vimont
fe758e6e15 Improve comment
Rephrase to simplify and add a link to the issue.
2019-06-14 10:11:15 +02:00
Romain Vimont
b29a568f08
Merge pull request #587 from schwabe/fix_586_screen_off_qbeta
Use getPhysicalDisplayToken if getBuiltInDisplay is not found
2019-06-14 10:04:12 +02:00
Arne Schwabe
b769083a5b Use getPhysicalDisplayToken on Anroid Q+ instead of getBuiltInDisplay
This makes the -S (screen off) parameter work on Android Q beta 4

Closes #586
2019-06-13 13:30:54 +02:00
Romain Vimont
8ca36406b9 Remove compilation flag "skip_frames"
It is unused since ebccb9f6cc.
2019-06-12 11:43:18 +02:00
Romain Vimont
53310a925a Disable portable build by default
The default value of a boolean meson option is true. We want
non-portable build by default.
2019-06-12 11:26:23 +02:00
Romain Vimont
0cb902d58b Merge pull request #587 from zzndb/patch-1 2019-06-12 11:23:15 +02:00
zzndb
bcd0a876f7 Fix a spell mistake
After commented default portable option in `app/meson.build` get some
error and then find this. :)

Signed-off-by: Romain Vimont <rom@rom1v.com>
2019-06-12 11:22:50 +02:00
Romain Vimont
de2016a48e Add link to Snap package in README
<https://github.com/Genymobile/scrcpy/issues/523>
2019-06-11 23:41:56 +02:00
Romain Vimont
19ca6a0d66 Fix typo in README 2019-06-11 23:01:23 +02:00
Romain Vimont
e2996e85c0 Update links to v1.9 in README and BUILD 2019-06-11 23:00:09 +02:00
Romain Vimont
c2df0228a3 Merge branch 'dev' 2019-06-11 22:54:58 +02:00
Romain Vimont
259d3aee93 Bump version to 1.9 2019-06-11 21:50:29 +02:00
Romain Vimont
90859f1dcf Upgrade tarketSdkVersion to 29
This fixes a lint warning.
2019-06-11 21:49:14 +02:00
Romain Vimont
1afe9ce2ee Fix deprecation warning in Java unit test 2019-06-11 21:48:58 +02:00
Romain Vimont
273cec8a92 Fix typo in test name 2019-06-11 21:47:31 +02:00
Romain Vimont
02f189b1de Remove obsolete detail in README
Now that scrcpy-server.jar is found in the same directory as the
scrcpy executable, using SCRCPY_SERVER_PATH is not particularly useful
on Windows anymore
2019-06-11 21:37:09 +02:00
Romain Vimont
4abe163233 Remove obsolete explanation in FAQ
Issue 9 was about stdout/stderr not printed in Windows console. This is
solved since the Windows version is cross-compiled from Linux.
2019-06-11 21:20:06 +02:00
Romain Vimont
5ffdcbb7be Update DEVELOP.md 2019-06-11 21:18:43 +02:00
Romain Vimont
ffe0417228 Update platform-tools (29.0.1) for Windows
Include the latest version of adb in Windows releases.
2019-06-11 19:19:47 +02:00
Romain Vimont
e3afb67e7f Downgrade SDL to 2.0.8 for Windows
Revert "Update SDL (2.0.9) for Windows"

Several users experienced freezes with SDL 2.0.9.

This reverts commit a5787dccd6.

See:
 - <https://github.com/Genymobile/scrcpy/issues/425>
 - <https://discourse.libsdl.org/t/unstable-frame-rate-unexpectedly/25783>
2019-06-11 19:18:45 +02:00
Romain Vimont
4ee1391361 Upgrade FFmpeg (4.1.3) for Windows
Include the latest version of FFmpeg in Windows releases.
2019-06-11 19:18:45 +02:00
Romain Vimont
2755bfc255 Improve portable builds
In portable builds, scrcpy-server.jar was supposed to be present in the
current directory, so in practice it worked only if scrcpy was launched
from its own directory.

Instead, find the absolute path of the executable and build a suitable
path to use scrcpy-server.jar from the same directory.
2019-06-11 17:44:07 +02:00
Romain Vimont
3b17ff7c86 Add functions to convert wide char to UTF-8
There was already utf8_to_wide_char(), used to correctly execute
commands on Windows.

Add the reverse converter: utf8_from_wide_char(). We will need it to
build the scrcpy-server path based on the executable directory.
2019-06-11 17:44:07 +02:00
Romain Vimont
4eb6b26c93 Extract "scrcpy-server.jar" string
The filename is used at several places.
2019-06-11 17:44:07 +02:00
Romain Vimont
eb34098add Simplify portable build configuration
To create a portable build (with scrcpy-server.jar accessible from the
scrcpy directory), replace OVERRIDE_SERVER_PATH by a simple compilation
flag: PORTABLE.

This paves the way to use more complex rules to determine the path of
scrcpy-server.jar in portable builds.
2019-06-11 17:44:07 +02:00
Romain Vimont
b777760bca Simplify scrcpy-server path configuration
The full path of scrcpy-server.jar was partially configured from
meson.build then concatenated by C code.

Instead, directly write the path in C.
2019-06-11 17:44:07 +02:00
Romain Vimont
72bdfbc7a6 Never return 0 for stream protocol
On socket disconnection, on Linux, recv() returns -1 and errno is set.
But on Windows, errno is 0.

In that case, AVERROR(errno) == 0, leading to the warning:

> Invalid return value 0 for stream protocol

To avoid the problem, if errno is 0, return AVERROR_EOF.

Ref: commit 2876463d39
2019-06-11 17:44:07 +02:00
Romain Vimont
8604f16b30 Truncate device name at UTF-8 code point boundary
Just in case.
2019-06-07 17:45:03 +02:00
Romain Vimont
5d11339259 Inline lock_util functions
They are just tiny wrappers.
2019-06-07 17:19:00 +02:00