This allows users to compile and run the project in a dev environment.
meson setup x
meson compile -C x
meson devenv -C x
scrcpy
This is an alternative to `./run x`.
PR #5658 <https://github.com/Genymobile/scrcpy/pull/5658>
Signed-off-by: Romain Vimont <rom@rom1v.com>
Some options, such as --show-touches or --stay-awake, modify Android
settings and must be restored upon exit.
If scrcpy terminates (e.g. due to an early error) in the middle of the
clean up configuration, the device may be left in an inconsistent state
(some settings might be changed but not restored).
This issue can be reproduced with high probability by forcing scrcpy to
fail:
scrcpy --show-touches --video-encoder=fail
To prevent this problem, ensure that the clean up thread is not
interrupted until the clean up process is started.
Refs #5601 <https://github.com/Genymobile/scrcpy/issues/5601>
PR #5613 <https://github.com/Genymobile/scrcpy/pull/5613>
Add an option to disable the following flag for virtual displays:
DisplayManager.VIRTUAL_DISPLAY_FLAG_DESTROY_CONTENT_ON_REMOVAL
With this option, when the virtual display is closed, the running apps
are moved to the main display rather than being destroyed.
PR #5615 <https://github.com/Genymobile/scrcpy/pull/5615>
The position of touch and scroll must normally be "resolved" with a
"position mapper" associated to the display.
But to support the injection of such events with scrcpy-server alone
without video, handle the case where there is no display.
Fixes#5542 <https://github.com/Genymobile/scrcpy/issues/5542>
Allow capturing virtual displays at a lower resolution using
-m/--max-size.
In the original implementation in #5370, the virtual display size was
necessarily the same as the capture size. The --max-size value was only
allowed to determine the virtual display size when no explicit size was
provided.
Since the dpi was scaled down accordingly, it is often better to create
a virtual display at the target capture size directly. However, not
everything is rendered according to the virtual display DPI. For
example, a page in Firefox is rendered too big on small virtual
displays. Thus, it makes sense to be able create a virtual display at a
given size, and capture it at a lower resolution with --max-size. This
is now possible using OpenGL filters.
Therefore, change the behavior of --max-size for virtual displays:
- --max-size does not impact --new-display without size argument
anymore (the virtual display size is the main display size);
- it is used to limit the capture size (whether an explicit size is
provided or not).
This new behavior is consistent with main display capture.
Refs #5370 comment <https://github.com/Genymobile/scrcpy/pull/5370#issuecomment-2438944401>
Refs #5370 <https://github.com/Genymobile/scrcpy/pull/5370>
PR #5506 <https://github.com/Genymobile/scrcpy/pull/5506>
Add an option to disable the following flag for virtual displays:
DisplayManager.VIRTUAL_DISPLAY_FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS
Some devices render a broken UI when this flag is enabled.
Fixes#5494 <https://github.com/Genymobile/scrcpy/issues/5494>
If no size is provided with --new-display, the main display size is
used. But the actual size depended on the current device orientation.
To make it deterministic, use the size of the natural device orientation
(portrait for phones, landscape for tablets).
PR #5455 <https://github.com/Genymobile/scrcpy/pull/5455>
On rotation, it is expected that many successive events are ignored due
to size mismatch, when an event was generated from the mirroring window
having the old size, but was received on the device with the new size
(especially since mouse hover events are forwarded).
Do not flood the console with warnings.
PR #5455 <https://github.com/Genymobile/scrcpy/pull/5455>
Deprecate --lock-video-orientation in favor of a more general option
--capture-orientation, which supports all possible orientations
(0, 90, 180, 270, flip0, flip90, flip180, flip270), and a "locked" flag
via a '@' prefix.
All the old "locked video orientations" are supported:
- --lock-video-orientation -> --capture-orientation=@
- --lock-video-orientation=0 -> --capture-orientation=@0
- --lock-video-orientation=90 -> --capture-orientation=@90
- --lock-video-orientation=180 -> --capture-orientation=@180
- --lock-video-orientation=270 -> --capture-orientation=@270
In addition, --capture-orientation can rotate/flip the display without
locking, so that it follows the physical device rotation.
For example:
scrcpy --capture-orientation=flip90
always flips and rotates the capture by 90° clockwise.
The arguments are consistent with --display-orientation and
--record-orientation and --orientation (which provide separate
client-side orientation settings).
Refs #4011 <https://github.com/Genymobile/scrcpy/issues/4011>
PR #5455 <https://github.com/Genymobile/scrcpy/pull/5455>
On Android 14, DisplayListener may be broken (it never sends events).
This is fixed in recent Android 14 upgrades, but we can't really detect
it directly.
As a workaround, a RotationWatcher and DisplayFoldListener were
registered as a fallback, until a first "display changed" event was
triggered.
To simplify, on Android 14, register a DisplayWindowListener (introduced
in Android 11) to listen to configuration changes instead.
Refs #5455 comment <https://github.com/Genymobile/scrcpy/pull/5455#issuecomment-2481302084>
PR #5455 <https://github.com/Genymobile/scrcpy/pull/5455>
Co-authored-by: Romain Vimont <rom@rom1v.com>
Signed-off-by: Romain Vimont <rom@rom1v.com>
Detecting display size changes is not straightforward:
- from a DisplayListener, "display changed" events are received, but
this does not imply that the size has changed (it must be checked);
- on Android 14 (see e26bdb07a21493d096ea5c8cfd870fc5a3f015dc),
"display changed" events are not received on some versions, so as a
fallback, a RotationWatcher and a DisplayFoldListener are registered,
but unregistered as soon as a "display changed" event is actually
received, which means that the problem is fixed.
Extract a "display size monitor" to share the code between screen
capture and virtual display capture.
PR #5455 <https://github.com/Genymobile/scrcpy/pull/5455>
Expose two methods on Size directly:
- limit() to downscale a size;
- round8() to round both dimensions to multiples of 8.
This will allow removing ScreenInfo completely.
PR #5455 <https://github.com/Genymobile/scrcpy/pull/5455>
Introduce several key components to perform OpenGL filters:
- OpenGLRunner: a tool for running a filter to be rendered to a Surface
from an OpenGL-dedicated thread
- OpenGLFilter: a simple OpenGL filter API
- AffineOpenGLFilter: a generic OpenGL implementation to apply any 2D
affine transform
- AffineMatrix: an affine transform matrix, with helpers to build
matrices from semantic transformations (rotate, scale, translate…)
PR #5455 <https://github.com/Genymobile/scrcpy/pull/5455>