Not all key processors support text injection (HID keyboard does not
support it).
Instead of providing a dummy op function, set it to NULL and check on
the caller side before calling it.
Pass scrcpy input events instead of SDL input events to mouse
processors.
These events represent exactly what mouse processors need, abstracted
from any visual orientation and scaling applied on the SDL window.
This makes the mouse processors independent of the "screen" instance,
and the implementation source code independent of the SDL API.
This aims to make the key/mouse processors independent of the "screen",
by processing scrcpy-specific input events instead of SDL events.
In particular, these scrcpy events are not impacted by any UI window
scaling or rotation (contrary to SDL events).
The input manager exposed functions taking an "actions" parameter,
containing a bitmask-OR of ACTION_UP and ACTION_DOWN.
But they are never called with both actions simultaneously anymore, so
simplify.
Refs 964b6d2243
Refs d0739911a3
This allows to report a meaningful error message if an unsupported
feature is used on an incompatible platform. This is consistent with the
behavior of -K/--hid-keyboard.
The "resize to fit" feature (MOD+w or double-click on black borders)
computed the "optimal size" using the same function computing the
initial window size on start.
However, on "resize to fit", only the black borders must be removed (the
content size must be preserved), so the display bounds must not be
considered.
Since commit 0426708544, the server is run
in a dedicated thread. For SDL, many signals, including SIGINT and
SIGTERM, are masked for new threads. As a result, if the adb server is
not already running, adb commands invoked by scrcpy will start an adb
server that ignores those signals and cannot be terminated at system
shutdown.
Fixes#2873 <https://github.com/Genymobile/scrcpy/issues/2873>
PR #2870 <https://github.com/Genymobile/scrcpy/pull/2870>
Signed-off-by: Romain Vimont <rom@rom1v.com>
The icon will be associated to scrcpy.exe in the Windows explorer.
The .ico was created using imagemagick:
convert icon.png icon.ico
It is included as a binary for simplicity.
Refs #2815 <https://github.com/Genymobile/scrcpy/issues/2815>
Prefix the name of threads by "scrcpy-". This improves readability in
the output of `top -H` for example.
Limit the thread names to 16 bytes, because it is limited on some
platforms.
The sockets were never interrupted or closed by the client since recent
changes to run the server from a dedicated thread (see commit
0426708544).
As a side effect, the server could never terminate properly (it was
waiting on socket blocking calls), so it was always killed by the client
after the WATCHDOG_DELAY.
Interrupt the sockets on stop to give the servera chance to terminate
property, then close them.
If --no-control is enabled, then it is not necessary to create a second
communication socket between the client and the server.
This also facilitates the use of the server alone (without the client)
to receive only the raw video stream.
In ffmpeg/doc/APIchanges:
> 2016-04-21 - 7fc329e - lavc 57.37.100 - avcodec.h
> Add a new audio/video encoding and decoding API with decoupled input
> and output -- avcodec_send_packet(), avcodec_receive_frame(),
> avcodec_send_frame() and avcodec_receive_packet().
Refs de9b79ec2d
Refs #2862 <https://github.com/Genymobile/scrcpy/issues/2862>
Thank you clang:
../app/src/control_msg.c:45:5: warning: suspicious concatenation of
string literals in an array initialization; did you mean to separate
the elements with a comma? [-Wstring-concatenation]
"hover-exit",
^
In function ‘memcpy’,
inlined from ‘control_msg_serialize.constprop’ at ../app/src/control_msg.c:77:5,
inlined from ‘run_controller’ at ../app/src/controller.c:69:12:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10:
warning: ‘__builtin___memcpy_chk’ writing 262138 bytes into a region
of size 262130 overflows the destination [-Wstringop-overflow=]
return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
Refs 901d837165
PR #2859 <https://github.com/Genymobile/scrcpy/pull/2859>
Signed-off-by: Yu-Chen Lin <npes87184@gmail.com>
Signed-off-by: Romain Vimont <rom@rom1v.com>