Commit Graph

794 Commits (9e78b765da01843b4986f93179b0c92701269062)
 

Author SHA1 Message Date
Romain Vimont 8b33c6c108 Adapt copy-paste methods for Android 10
The methods getPrimaryClip() and setPrimaryClip() expect an additional
parameter since Android 10.

Fixes <https://github.com/Genymobile/scrcpy/issues/796>.
5 years ago
Romain Vimont 5b7a0cd8e9 Extract String literal to static constant 5 years ago
Romain Vimont bab9361948 Do not crash on control error
Some devices do not have some methods that we invoke via reflection, or
their call do not return the expected value. In that case, do not crash
the whole controller.
5 years ago
Romain Vimont 6220456def Merge mouse and touch events
Both are handled the very same way on the device.
5 years ago
Romain Vimont 7e1d52c119 Rename "touch pointer" to "pointer"
There are only touch pointers now, mouse pointers have been removed.
5 years ago
Romain Vimont 280d5b718c Use common pointers for mouse and touch
The mouse is a pointer like any other.
5 years ago
Romain Vimont 30168f0428 Ignore duplicate mouse events
In SDL, a touch event may simulate an identical mouse event. Since we
already handle touch event, ignore these duplicates.
5 years ago
Romain Vimont b5a2d99bc2 Send touch events from the client
On SDL touch events, send control messages to the server.
5 years ago
Romain Vimont f765aae352 Inject touch events on the server
On receiving an "inject touch" control message, update the local
pointers state and inject touches.
5 years ago
Romain Vimont 77f876e29c Add "inject touch" control message
Add a control message type in the protocol to forward touch events to
the device.
5 years ago
Romain Vimont d90549d1e6 Rename "pointer" to "mouse pointer"
This will help to distinguish them from "touch pointers".
5 years ago
Romain Vimont 810ff80ba7 Add buffer_write64be()
Add a function to write 64 bits in big-endian from a uint64_t.
5 years ago
Romain Vimont 1f8ba1ca79 Include config.h everywhere
Ref: <https://github.com/Genymobile/scrcpy/issues/829>

Suggested-by: Louis Kruger <louisk@gmail.com>
5 years ago
Louis Kruger 129dabcfa4 Include config.h to fix HIDPI support
Ref: <https://github.com/Genymobile/scrcpy/issues/829>

Signed-off-by: Romain Vimont <rom@rom1v.com>
5 years ago
Romain Vimont f510f1de1c Remove "make" from build dependencies
The project is built with meson+ninja.
5 years ago
Romain Vimont 7d1932b907 Fix gradle warnings in tests 5 years ago
Yu-Chen Lin 795d103032 input_manager.c: Correct log
Signed-off-by: Yu-Chen Lin <npes87184@gmail.com>
5 years ago
Ta-da 513d1ac96d
Fix option "record-format" related short opt 5 years ago
Romain Vimont ffdbf5990b Rename event converter functions
Rename "XXX_from_sdl_to_android" to "convert_XXX", to avoid huge
function names.
5 years ago
Romain Vimont 9463850c24 Rename "convert.h" to "event_converter.h"
The filename gave no hint about what was converted.
5 years ago
Romain Vimont 6e38e0cbfe Rename variable names "event" to "msg"
Some variable names had not been renamed when "event" was renamed to
"message" (28980bbc90).
5 years ago
Romain Vimont 7040e8abc4 Fix control message reader test
The mouse event test actually tested a key event control message.
5 years ago
Romain Vimont da5b0ec0d5 Improve FAQ 5 years ago
Romain Vimont a9c8fa305d Fix segfault on recording with old FFmpeg
The AVPacket fields side_data and side_data_elems were not initialized
by av_packet_ref() in old FFmpeg versions (prior to [1]).

As a consequence, on av_packet_unref(), side_data was freed, causing a
segfault.

Fixes <https://github.com/Genymobile/scrcpy/issues/707>

[1]: <http://git.videolan.org/gitweb.cgi/ffmpeg.git/?p=ffmpeg.git;a=commitdiff;h=3b4026e15110547892d5d770b6b43c9e34df458f>
5 years ago
Romain Vimont 20b3f101a4 Print gradle output on compiling
Enable the attribute "console" of custom_target() introduced in meson
0.48. This allows to get a feedback of what gradle does (which can takes
a very long time).

This produces warnings because we declare to support meson >= 0.37, but
we don't want to stop supporting older versions for that. Older versions
just ignore the option:

> WARNING: Unknown keyword arguments in target scrcpy-server: console

Newer meson versions use it, but warn because we declare supporting
older versions:

> WARNING: Project targetting '>= 0.37' but tried to use feature
> introduced in '0.48.0': console arg in custom_target

Meson does not support conditional branches to suppress such warnings,
so just keep the warnings.
5 years ago
Romain Vimont 686733023b
Merge pull request #708 from toddsierens/patch-1
Update WindowManager.java
5 years ago
toddsierens 27eacc3c11
Update WindowManager.java 5 years ago
Romain Vimont 8507fea271 Record a packet with its duration
Record a packet only once the following has been received, so that we
can set its duration before muxing it.

Fixes <https://github.com/Genymobile/scrcpy/issues/702>
5 years ago
Romain Vimont 8a08ca0f3d Merge pull request #692 from msfjarvis/msf/uprev-dependencies
Upgrade build dependencies
5 years ago
Harsh Shandilya 44fb692a64 Uprev Gradle wrapper to latest stable
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
Signed-off-by: Romain Vimont <rom@rom1v.com>
5 years ago
Harsh Shandilya 3f77c29c95 Uprev AGP to latest stable
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
5 years ago
Romain Vimont 9a50b65b33
Merge pull request #695 from schwabe/schwabe/fix_null_queue
Fix building on OS X (missing NULL in queue.h)
5 years ago
Arne Schwabe c05056343b Fix building on OS X (missing NULL in queue.h)
Headers seem to be a bit different in Apple land and you need to include
stddef.h explicitly to the NULL declaration.

This also makes the code a bit more correct, as stddef.h is the header
in the C standard that defines NULL
(https://en.cppreference.com/w/cpp/header/cstddef).
5 years ago
Romain Vimont 9bcee4ea42 Update links to v1.10 in README and BUILD 5 years ago
Romain Vimont c28619e4e8 Bump version to 1.10 5 years ago
Romain Vimont 8969444ff2 List scrcpy characteristics in README
They were listed in the blog post introducing scrcpy:
<https://blog.rom1v.com/2018/03/introducing-scrcpy/>
5 years ago
Romain Vimont b54f0bfe48 Upgrade SDL (2.0.10) for Windows
Include the latest version of SDL in Windows releases.
5 years ago
Romain Vimont 0aec1e502e Update platform-tools (29.0.2) for Windows
Include the latest version of adb in Windows releases.
5 years ago
Romain Vimont c3a58ad10f Upgrade FFmpeg (4.1.4) for Windows
Include the latest version of FFmpeg in Windows releases.
5 years ago
Romain Vimont b0184f2869 Initialize queue "last" field
The compiler is not always able to see that "last" is always initialized
before being used, so always initialize it.
5 years ago
Romain Vimont e2ac996183 Use Cmd instead of Ctrl on macOS when possible
Fixes <https://github.com/Genymobile/scrcpy/issues/642>
5 years ago
Romain Vimont 5e4ccfd832 Use generic FIFO queue for recording
Replace the specific recording queue by the new generic FIFO queue
implementation.
5 years ago
Romain Vimont 53b6ee2cf4 Add generic intrusive FIFO queue
We need several FIFO queues (a queue of packets, a queue of messages,
etc.).

Some of them are implemented using cbuf, a generic circular buffer. But
for recording, we need to store the packets in an unbounded queue until
they are written, so the queue was implemented manually.

Create a generic implementation (using macros) to avoid reimplementing
it every time.
5 years ago
Romain Vimont 26213f1031 Fix cbuf documentation 5 years ago
Romain Vimont 96b5067cbf Remove unnecessary backslash in cbuf 5 years ago
Romain Vimont 421e4be399 Remove root directory from Windows zip releases
Put the scrcpy files at the root of the zip archive. This avoids an
unnecessary level of directories when extracting.
5 years ago
Romain Vimont 6abb4902c6 Log recording failure
If recording fails, log "recording failed" instead of "recording
complete".
5 years ago
Romain Vimont d4ed8b6f26 Log scrcpy version and URL on start
Keep --version which also print the version of dependencies.
5 years ago
Romain Vimont 35d9185f6c Record asynchronously
The record file was written from the stream thread. As a consequence,
any blocking I/O to write the file delayed the decoder.

For maximum performance even when recording is enabled, send
(refcounted) packets to a separate recording thread.
5 years ago
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>
5 years ago