(cherry picked from commit e15824304434d1721cf928fde35c870c1fc01698)
(cherry picked from commit a4ef318ae3)
(cherry picked from commit a5b83c19081d04346ef580dfff09ec4076822302)
(cherry picked from commit 1e3321cf58)
(cherry picked from commit 7e36540c21eef4964b73824d8845b2468899981e)
(cherry picked from commit ef95046c3e)
(cherry picked from commit fa3644cca2ba2c4a562a203ff773c021f9082175)
(cherry picked from commit a5d5ea1b73)
(cherry picked from commit d4fb6a0c19af23d0d3c57721f6ccc91e4fad67f3)
(cherry picked from commit e7f205ca19)
(cherry picked from commit ef5d72cbb785d48d412b437fee95bc8f61829680)
(cherry picked from commit 709a0c327a)
If the option is not requested with -c then the codec will be automatically choosen by the MediaCodec.
(cherry picked from commit 43aea79f6acc69f68feaee0494f45a05bce0f782)
(cherry picked from commit 504d6a42d5)
Some workarounds are needed on some devices. But applying them may cause
exceptions on other devices, where they are not necessary anyway.
Do not report these errors in release builds.
Closes#994 <https://github.com/Genymobile/scrcpy/issues/994>
Accept a range of ports to listen to, so that it does not fail if
another instance of scrcpy is currently starting.
The range can be passed via the command line:
scrcpy -p 27183:27186
scrcpy -p 27183 # implicitly 27183:27183, as before
The default is 27183:27199.
Closes#951 <https://github.com/Genymobile/scrcpy/issues/951>
Start the server socket in enable_tunnel() directly.
For the caller point of view, enabling the tunnel opens a port (either
the server socket locally or the "adb forward" process).
The platform-specific code for net.c was implemented in sys/*/net.c.
But the differences are quite limited, so use ifdef-blocks in the single
net.c instead.
The file 'E:\安安\scrcpy-win64-v1.12.1-1-g31bd950\scrcpy-server'
exists, however, it will show msg as follow:
INFO: scrcpy 1.12.1 <https://github.com/Genymobile/scrcpy>
stat: No such file or directory
ERROR: 'E:\安安\scrcpy-win64-v1.12.1-1-g31bd950\scrcpy-server' does
not exist or is not a regular file
Press any key to continue...
This patch fixes it.
Signed-off-by: Yu-Chen Lin <npes87184@gmail.com>
Signed-off-by: Romain Vimont <rom@rom1v.com>
The function get_server_path() sometimes returned an owned string,
sometimes a non-owned string.
Always return an allocated (owned) string, and free it after usage.
A proper solution could be to use "long long" instead (guaranteed to be
at least 64 bits), but it adds its own problems (e.g. "%lld" is not
supported as a printf format on all platforms).
In practice, we don't need such high values, so keep it simple.
Fixes#995 <https://github.com/Genymobile/scrcpy/issues/995>
If SCRCPY_SERVER_PATH points to a directory, then a directory will be
pushed to /data/local/tmp/scrcpy-server.jar.
When executing it, app_process will just abort and leave the directory
on the device, causing scrcpy to always fail.
To avoid the problem, check that the server is a regular file before
pushing it.
Closes#956 <https://github.com/Genymobile/scrcpy/issues/956>