Commit graph

1265 commits

Author SHA1 Message Date
Romain Vimont
157c60feb4 Fix indentation 2019-11-07 09:48:48 +01:00
Romain Vimont
2d90e1befd Fix include recorder.h 2019-11-06 22:22:46 +01:00
Romain Vimont
0e301ddf19 Factorize scrcpy options and command-line args
Do not duplicate all scrcpy options fields in the structure storing the
parsed command-line arguments.
2019-11-06 22:06:54 +01:00
Romain Vimont
c42ff75b74 Pass screen to mouse event converters
Mouse events coordinates depend on the screen size and location, so the
converter need to access the screen.

The fact that it needs the position or the size is an internal detail,
so pass a pointer to the whole screen structure.
2019-11-06 21:24:36 +01:00
Romain Vimont
b0db1178d1 Move event conversion to input_manager
Only keep helper functions separated.

This will help to convert coordinates internally when necessary.
2019-11-06 21:24:36 +01:00
Romain Vimont
8d601d3210 Rename "input_manager" variables to "im"
It is used a lot, a short name improves readability.
2019-11-06 21:24:36 +01:00
Romain Vimont
683f7ca848 Document how to attach a debugger to the server 2019-11-03 19:42:37 +01:00
Romain Vimont
120f08ee96 Fix manpage option parameter format
The parameter for --window-title was not underlined the same way as
others.
2019-11-03 16:51:47 +01:00
Romain Vimont
0415672a75 Merge branch 'master' into dev 2019-11-03 15:56:10 +01:00
Romain Vimont
3ea4742321 Call ninja without changing directory
In build instructions, use:

    ninja -Cx ...

instead of:

    cd x
    ninja ...
2019-10-31 21:05:04 +01:00
Romain Vimont
95fd64b5de Add scrcpy version in recorded video metadata
It might help to understand problems in recorded videos.
2019-10-31 20:57:57 +01:00
Romain Vimont
ab205084dc
Merge pull request #896 from yangfl/upstream
Add manpage for scrcpy
2019-10-31 13:44:01 +01:00
yangfl
4696878a97 Add manpage for scrcpy 2019-10-31 18:18:19 +08:00
Romain Vimont
3da95b52bd Rename scrcpy-server.jar to scrcpy-server
The server name ending with .jar has several drawbacks:
 - meson requires the jar executable to attempt to modify it:
     <https://github.com/Genymobile/scrcpy/issues/404#issuecomment-456065923>
     <https://github.com/mesonbuild/meson/issues/4844>
 - meson warns during "ninja install"
     <https://github.com/Genymobile/scrcpy/issues/458>
 - some users try to execute it on the computer as a java executable

Removing the extension solves all these problems.
2019-10-31 10:54:29 +01:00
Romain Vimont
c72f677435 Merge branch 'master' into dev 2019-10-30 23:29:44 +01:00
Romain Vimont
1380f6e00f Fix help for --record-format
Record format requires a parameter.
2019-10-30 22:51:40 +01:00
Romain Vimont
d841718956 Add a script to build the server without gradle
Gradle versions may sometimes cause problems. This script offers an
alternative.
2019-10-30 21:47:20 +01:00
Romain Vimont
17d53be3ef Fix mouse events conversion
The conversion from SDL mouse state to Android mouse state used wrong
constants as mask.

Fixes <https://github.com/Genymobile/scrcpy/issues/635>
2019-10-25 11:09:06 +02:00
Romain Vimont
f9938dbf88 Inject button state for touch/mouse events
The buttons state was forwarded, but ignored by the server.
2019-10-25 11:04:04 +02:00
Romain Vimont
f6c8460ebb Rename window size functions for clarity
Now, get_window_size() returns the current window size (fullscreen or
not), while get_windowed_window_size() always returned the windowed size
(the size when fullscreen is disabled).
2019-10-20 16:08:16 +02:00
Romain Vimont
c33a147fd0 Fix "turn screen off" on Android Q
Call getInternalDisplayToken(), which retrieve the id of the first
physical display (which is not necessarily 0 anymore).

Fixes <https://github.com/Genymobile/scrcpy/issues/835>
2019-10-17 23:25:00 +02:00
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>.
2019-10-17 22:21:47 +02:00
Romain Vimont
5b7a0cd8e9 Extract String literal to static constant 2019-10-17 22:11:39 +02:00
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.
2019-10-17 22:09:54 +02:00
Romain Vimont
6220456def Merge mouse and touch events
Both are handled the very same way on the device.
2019-10-03 20:37:49 +02:00
Romain Vimont
7e1d52c119 Rename "touch pointer" to "pointer"
There are only touch pointers now, mouse pointers have been removed.
2019-10-03 20:27:28 +02:00
Romain Vimont
280d5b718c Use common pointers for mouse and touch
The mouse is a pointer like any other.
2019-10-03 20:05:29 +02:00
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.
2019-10-03 20:05:29 +02:00
Romain Vimont
b5a2d99bc2 Send touch events from the client
On SDL touch events, send control messages to the server.
2019-10-03 20:05:29 +02:00
Romain Vimont
f765aae352 Inject touch events on the server
On receiving an "inject touch" control message, update the local
pointers state and inject touches.
2019-10-03 20:05:29 +02:00
Romain Vimont
77f876e29c Add "inject touch" control message
Add a control message type in the protocol to forward touch events to
the device.
2019-10-03 20:05:27 +02:00
Romain Vimont
d90549d1e6 Rename "pointer" to "mouse pointer"
This will help to distinguish them from "touch pointers".
2019-10-02 21:40:26 +02:00
Romain Vimont
810ff80ba7 Add buffer_write64be()
Add a function to write 64 bits in big-endian from a uint64_t.
2019-10-02 21:40:26 +02:00
Romain Vimont
1f8ba1ca79 Include config.h everywhere
Ref: <https://github.com/Genymobile/scrcpy/issues/829>

Suggested-by: Louis Kruger <louisk@gmail.com>
2019-09-29 22:39:53 +02:00
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>
2019-09-29 22:39:47 +02:00
Romain Vimont
f510f1de1c Remove "make" from build dependencies
The project is built with meson+ninja.
2019-09-28 14:46:44 +02:00
Romain Vimont
7d1932b907 Fix gradle warnings in tests 2019-09-28 12:23:54 +02:00
Yu-Chen Lin
795d103032 input_manager.c: Correct log
Signed-off-by: Yu-Chen Lin <npes87184@gmail.com>
2019-09-28 10:37:25 +08:00
Ta-da
513d1ac96d
Fix option "record-format" related short opt 2019-09-27 10:04:41 +08:00
Romain Vimont
ffdbf5990b Rename event converter functions
Rename "XXX_from_sdl_to_android" to "convert_XXX", to avoid huge
function names.
2019-09-15 17:29:03 +02:00
Romain Vimont
9463850c24 Rename "convert.h" to "event_converter.h"
The filename gave no hint about what was converted.
2019-09-15 17:29:03 +02:00
Romain Vimont
6e38e0cbfe Rename variable names "event" to "msg"
Some variable names had not been renamed when "event" was renamed to
"message" (28980bbc90).
2019-09-15 17:29:03 +02:00
Romain Vimont
7040e8abc4 Fix control message reader test
The mouse event test actually tested a key event control message.
2019-09-15 17:29:03 +02:00
Romain Vimont
da5b0ec0d5 Improve FAQ 2019-08-14 22:32:46 +02:00
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>
2019-08-13 18:58:36 +02:00
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.
2019-08-09 15:15:28 +02:00
Romain Vimont
686733023b
Merge pull request #708 from toddsierens/patch-1
Update WindowManager.java
2019-08-08 23:24:47 +02:00
toddsierens
27eacc3c11
Update WindowManager.java 2019-08-08 17:17:48 -04:00
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>
2019-08-08 18:57:52 +02:00
Romain Vimont
8a08ca0f3d Merge pull request #692 from msfjarvis/msf/uprev-dependencies
Upgrade build dependencies
2019-08-07 23:42:06 +02:00