Compare commits

...

6 Commits

Author SHA1 Message Date
Romain Vimont
2b1fd581fd Use meson feature DONOTMERGEYET
Use: https://mesonbuild.com/Reference-manual_returned_feature.html#featurerequire
once we require meson 0.59
2023-01-06 11:29:42 +01:00
Romain Vimont
ebf8c4dbf9 Add FAQ section about HID/OTG on Windows
Refs #3654 <https://github.com/Genymobile/scrcpy/issues/3654>
2023-01-06 10:44:13 +01:00
Romain Vimont
bf8696d02e Avoid unnecessary copy on config packets demuxing
Use av_packet_ref() to reference the packet without copy.

This also simplifies the logic, by making the "offset" variable and the
memcpy() call local to the if-block.
2023-01-02 16:18:23 +01:00
Romain Vimont
d8c2fe6ef2 Revert "Remove continuous resizing workaround for Windows"
This reverts commit 18082f6069.

I can't reproduce, but it seems the workaround improves the behavior on
some Windows versions.

Fixes #3640 <https://github.com/Genymobile/scrcpy/issues/3640>
Refs #3458 <https://github.com/Genymobile/scrcpy/issues/3458>
2022-12-26 12:42:59 +01:00
Romain Vimont
54c7baceac Use "meson setup" from install_release.sh
Refs 64821466a1
2022-12-22 13:07:07 +01:00
Romain Vimont
4c43784fd1 Update links to v1.25 2022-12-22 12:44:01 +01:00
8 changed files with 36 additions and 24 deletions

View File

@@ -272,10 +272,10 @@ install` must be run as root)._
#### Option 2: Use prebuilt server #### Option 2: Use prebuilt server
- [`scrcpy-server-v1.24`][direct-scrcpy-server] - [`scrcpy-server-v1.25`][direct-scrcpy-server]
<sub>SHA-256: `ae74a81ea79c0dc7250e586627c278c0a9a8c5de46c9fb5c38c167fb1a36f056`</sub> <sub>SHA-256: `ce0306c7bbd06ae72f6d06f7ec0ee33774995a65de71e0a83813ecb67aec9bdb`</sub>
[direct-scrcpy-server]: https://github.com/Genymobile/scrcpy/releases/download/v1.24/scrcpy-server-v1.24 [direct-scrcpy-server]: https://github.com/Genymobile/scrcpy/releases/download/v1.25/scrcpy-server-v1.25
Download the prebuilt server somewhere, and specify its path during the Meson Download the prebuilt server somewhere, and specify its path during the Meson
configuration: configuration:

17
FAQ.md
View File

@@ -7,7 +7,7 @@ Here are the common reported problems and their status.
If you encounter any error, the first step is to upgrade to the latest version. If you encounter any error, the first step is to upgrade to the latest version.
## `adb` issues ## `adb` and USB issues
`scrcpy` execute `adb` commands to initialize the connection with the device. If `scrcpy` execute `adb` commands to initialize the connection with the device. If
`adb` fails, then scrcpy will not work. `adb` fails, then scrcpy will not work.
@@ -133,6 +133,21 @@ Try with another USB cable or plug it into another USB port. See [#281] and
[#283]: https://github.com/Genymobile/scrcpy/issues/283 [#283]: https://github.com/Genymobile/scrcpy/issues/283
## HID/OTG issues on Windows
On Windows, if `scrcpy --otg` (or `--hid-keyboard`/`--hid-mouse`) results in:
> ERROR: Could not find any USB device
(or if only unrelated USB devices are detected), there might be drivers issues.
Please read [#3654], in particular [this comment][#3654-comment1] and [the next
one][#3654-comment2].
[#3654]: https://github.com/Genymobile/scrcpy/issues/3654
[#3654-comment1]: https://github.com/Genymobile/scrcpy/issues/3654#issuecomment-1369278232
[#3654-comment2]: https://github.com/Genymobile/scrcpy/issues/3654#issuecomment-1369295011
## Control issues ## Control issues

View File

@@ -1,4 +1,4 @@
# scrcpy (v1.24) # scrcpy (v1.25)
<img src="app/data/icon.svg" width="128" height="128" alt="scrcpy" align="right" /> <img src="app/data/icon.svg" width="128" height="128" alt="scrcpy" align="right" />
@@ -106,10 +106,10 @@ process][BUILD_simple]).
For Windows, a prebuilt archive with all the dependencies (including `adb`) is For Windows, a prebuilt archive with all the dependencies (including `adb`) is
available: available:
- [`scrcpy-win64-v1.24.zip`][direct-win64] - [`scrcpy-win64-v1.25.zip`][direct-win64]
<sub>SHA-256: `6ccb64cba0a3e75715e85a188daeb4f306a1985f8ce123eba92ba74fc9b27367`</sub> <sub>SHA-256: `db65125e9c65acd00359efb7cea9c05f63cc7ccd5833000cd243cc92f5053028`</sub>
[direct-win64]: https://github.com/Genymobile/scrcpy/releases/download/v1.24/scrcpy-win64-v1.24.zip [direct-win64]: https://github.com/Genymobile/scrcpy/releases/download/v1.25/scrcpy-win64-v1.25.zip
It is also available in [Chocolatey]: It is also available in [Chocolatey]:

View File

@@ -69,12 +69,12 @@ else
endif endif
endif endif
v4l2_support = get_option('v4l2') and host_machine.system() == 'linux' v4l2_support = get_option('v4l2').enabled() and host_machine.system() == 'linux'
if v4l2_support if v4l2_support
src += [ 'src/v4l2_sink.c' ] src += [ 'src/v4l2_sink.c' ]
endif endif
usb_support = get_option('usb') usb_support = get_option('usb').enabled()
if usb_support if usb_support
src += [ src += [
'src/usb/aoa_hid.c', 'src/usb/aoa_hid.c',

View File

@@ -95,29 +95,27 @@ sc_demuxer_push_packet(struct sc_demuxer *demuxer, AVPacket *packet) {
// A config packet must not be decoded immediately (it contains no // A config packet must not be decoded immediately (it contains no
// frame); instead, it must be concatenated with the future data packet. // frame); instead, it must be concatenated with the future data packet.
if (demuxer->pending || is_config) { if (demuxer->pending || is_config) {
size_t offset;
if (demuxer->pending) { if (demuxer->pending) {
offset = demuxer->pending->size; size_t offset = demuxer->pending->size;
if (av_grow_packet(demuxer->pending, packet->size)) { if (av_grow_packet(demuxer->pending, packet->size)) {
LOG_OOM(); LOG_OOM();
return false; return false;
} }
memcpy(demuxer->pending->data + offset, packet->data, packet->size);
} else { } else {
offset = 0;
demuxer->pending = av_packet_alloc(); demuxer->pending = av_packet_alloc();
if (!demuxer->pending) { if (!demuxer->pending) {
LOG_OOM(); LOG_OOM();
return false; return false;
} }
if (av_new_packet(demuxer->pending, packet->size)) { if (av_packet_ref(demuxer->pending, packet)) {
LOG_OOM(); LOG_OOM();
av_packet_free(&demuxer->pending); av_packet_free(&demuxer->pending);
return false; return false;
} }
} }
memcpy(demuxer->pending->data + offset, packet->data, packet->size);
if (!is_config) { if (!is_config) {
// prepare the concat packet to send to the decoder // prepare the concat packet to send to the decoder
demuxer->pending->pts = packet->pts; demuxer->pending->pts = packet->pts;

View File

@@ -306,14 +306,13 @@ sc_screen_render(struct sc_screen *screen, bool update_content_rect) {
} }
#if defined(__APPLE__) #if defined(__APPLE__) || defined(__WINDOWS__)
# define CONTINUOUS_RESIZING_WORKAROUND # define CONTINUOUS_RESIZING_WORKAROUND
#endif #endif
#ifdef CONTINUOUS_RESIZING_WORKAROUND #ifdef CONTINUOUS_RESIZING_WORKAROUND
// On Windows and MacOS, resizing blocks the event loop, so resizing events are // On Windows and MacOS, resizing blocks the event loop, so resizing events are
// not triggered. On MacOS, as a workaround, handle them in an event handler // not triggered. As a workaround, handle them in an event handler.
// (it does not work for Windows unfortunately).
// //
// <https://bugzilla.libsdl.org/show_bug.cgi?id=2077> // <https://bugzilla.libsdl.org/show_bug.cgi?id=2077>
// <https://stackoverflow.com/a/40693139/1987178> // <https://stackoverflow.com/a/40693139/1987178>

View File

@@ -2,8 +2,8 @@
set -e set -e
BUILDDIR=build-auto BUILDDIR=build-auto
PREBUILT_SERVER_URL=https://github.com/Genymobile/scrcpy/releases/download/v1.24/scrcpy-server-v1.24 PREBUILT_SERVER_URL=https://github.com/Genymobile/scrcpy/releases/download/v1.25/scrcpy-server-v1.25
PREBUILT_SERVER_SHA256=ae74a81ea79c0dc7250e586627c278c0a9a8c5de46c9fb5c38c167fb1a36f056 PREBUILT_SERVER_SHA256=ce0306c7bbd06ae72f6d06f7ec0ee33774995a65de71e0a83813ecb67aec9bdb
echo "[scrcpy] Downloading prebuilt server..." echo "[scrcpy] Downloading prebuilt server..."
wget "$PREBUILT_SERVER_URL" -O scrcpy-server wget "$PREBUILT_SERVER_URL" -O scrcpy-server
@@ -12,7 +12,7 @@ echo "$PREBUILT_SERVER_SHA256 scrcpy-server" | sha256sum --check
echo "[scrcpy] Building client..." echo "[scrcpy] Building client..."
rm -rf "$BUILDDIR" rm -rf "$BUILDDIR"
meson "$BUILDDIR" --buildtype=release --strip -Db_lto=true \ meson setup "$BUILDDIR" --buildtype=release --strip -Db_lto=true \
-Dprebuilt_server=scrcpy-server -Dprebuilt_server=scrcpy-server
cd "$BUILDDIR" cd "$BUILDDIR"
ninja ninja

View File

@@ -4,5 +4,5 @@ option('prebuilt_server', type: 'string', description: 'Path of the prebuilt ser
option('portable', type: 'boolean', value: false, description: 'Use scrcpy-server from the same directory as the scrcpy executable') option('portable', type: 'boolean', value: false, description: 'Use scrcpy-server from the same directory as the scrcpy executable')
option('server_debugger', type: 'boolean', value: false, description: 'Run a server debugger and wait for a client to be attached') option('server_debugger', type: 'boolean', value: false, description: 'Run a server debugger and wait for a client to be attached')
option('server_debugger_method', type: 'combo', choices: ['old', 'new'], value: 'new', description: 'Select the debugger method (Android < 9: "old", Android >= 9: "new")') option('server_debugger_method', type: 'combo', choices: ['old', 'new'], value: 'new', description: 'Select the debugger method (Android < 9: "old", Android >= 9: "new")')
option('v4l2', type: 'boolean', value: true, description: 'Enable V4L2 feature when supported') option('v4l2', type: 'feature', value: 'enabled', description: 'Enable V4L2 feature when supported')
option('usb', type: 'boolean', value: true, description: 'Enable HID/OTG features when supported') option('usb', type: 'feature', value: 'enabled', description: 'Enable HID/OTG features when supported')