While moving code, commit 874eaec487 added
a condition `if (displayId == 0)` to register a rotation watcher,
without good reasons.
This condition was kept when the rotation watcher was moved to a
fallback in e26bdb07a2.
Note: use `git show -b` to show this commit ignoring whitespace changes.
Refs #5428 <https://github.com/Genymobile/scrcpy/issues/5428>
Accept a single boolean "on" rather than a "mode" (which, in practice,
could only take 2 values: NORMAL and OFF).
Also rename "screen power mode" to "display power".
PR #5418 <https://github.com/Genymobile/scrcpy/pull/5418>
By adding the '?' prefix, the app is searched by its name instead of its
package name (retrieving app names on the device may take some time):
scrcpy --start-app=?firefox
An app matches if its label starts with the given name,
case-insensitive.
If '+' is also passed to force-stop the app before starting, then the
prefixes must be in that order:
scrcpy --start-app=+?firefox
PR #5370 <https://github.com/Genymobile/scrcpy/pull/5370>
The previous commit introduced:
scrcpy --start-app=name
By adding a '+' prefix, the app is stopped beforehand:
scrcpy --start-app=+name
This may be useful to start a fresh app on a new virtual display:
scrcpy --new-display --start-app=+org.mozilla.firefox
PR #5370 <https://github.com/Genymobile/scrcpy/pull/5370>
Add a command line option --start-app=name to start an Android app by
its package name. For example:
scrcpy --start-app=org.mozilla.firefox
The app will be started on the correct target display:
scrcpy --new-display=1920x1080 --start-app=org.videolan.vlc
PR #5370 <https://github.com/Genymobile/scrcpy/pull/5370>
Co-authored-by: Simon Chan <1330321+yume-chan@users.noreply.github.com>
Add a feature to create a new (separate) virtual display instead of
mirroring the device screen:
scrcpy --new-display=1920x1080
scrcpy --new-display=1920x1080/420 # force 420 dpi
scrcpy --new-display # use the main display size and density
scrcpy --new-display -m1920 # scaled to fit a max size of 1920
scrcpy --new-display=/240 # use the main display size and 240 dpi
Fixes#1887 <https://github.com/Genymobile/scrcpy/issues/1887>
PR #5370 <https://github.com/Genymobile/scrcpy/pull/5370>
Co-authored-by: Simon Chan <1330321+yume-chan@users.noreply.github.com>
Co-authored-by: anirudhb <anirudhb@users.noreply.github.com>
When a new capture starts, send a new PositionMapper to the Controller
without using the global Device as an intermediate.
Now all Device methods are static.
PR #5370 <https://github.com/Genymobile/scrcpy/pull/5370>
Extract the function that converts coordinates from video space to
display space into a separate component.
It only requires the specific data it uses and does not need a full
ScreenInfo object (although it can be created from a ScreenInfo
instance).
PR #5370 <https://github.com/Genymobile/scrcpy/pull/5370>
Remove from Device the functions using an implicit displayId.
Move them to Controller, which knows best which displayId it must use.
This will allow to properly dispatch events either to the origin display
or to the virtual display created for mirroring.
PR #5370 <https://github.com/Genymobile/scrcpy/pull/5370>
Add a function called before each capture starts (before getSize() is
called).
This allows to compute the ScreenInfo instance once exactly when needed.
PR #5370 <https://github.com/Genymobile/scrcpy/pull/5370>
Move the code related to screen size and rotation/fold to ScreenCapture.
For now, keep the ScreenInfo instance in the Device class to communicate
with the Controller, but it will be removed by further commits.
PR #5370 <https://github.com/Genymobile/scrcpy/pull/5370>
Scrcpy requires Android 5.0+, so there is no point testing for older
versions.
Btw, there were two mistakes:
- the constant name in AndroidVersions should have been
API_20_ANDROID_4_4W (Android 4.4 without 'W' is API 19)
- the method isInteractive() was introduced in Android 5.0, not 4.4W:
<037c33eae7%5E%21/>
Also adapt the call to build-tools/35.0.0/aidl, which now requires an
import path (-I. for the current directory).
Otherwise, it fails with:
ERROR: android/view/IRotationWatcher.aidl:23.1-10: directory ./ is not found in any of the import paths:
-
Also upgrade AGP (8.7.1) and Gradle (8.9), required for SDK 35.
<https://developer.android.com/build/releases/gradle-plugin#updating-gradle>
Os.write() did not update the ByteBuffer position before Android 6.
A workaround was added by commit
b882322f73, which fixed part of the
problem, but the position was still not updated across calls, causing
the wrong chunk to be written.
Refs <d9f7e57f5d%5E%21/>
Replace argument suggestion:
--video-encoder='c2.android.avc.encoder'
by:
--video-encoder=c2.android.avc.encoder
On Linux, the quotes are interpreted by the shell, but on Windows they
are passed as is.
This was harmless, because even transmitted as is, they were interpreted
by the shell on the device. However, special characters are now
validated since commit bec3321fff, making
the command fail.
Fixes#5329 <https://github.com/Genymobile/scrcpy/issues/5329>
Moving classes into subpackages changed the expected imports order.
Reorganize them all at once automatically to avoid spurious changes in
future commits.
Initialize UHID devices with a custom name:
- "scrcpy: $GAMEPAD_NAME" for gamepads
- "scrcpy" for keyboard and mouse (or if no gamepad name is available)
The name may appear in Android apps.
PR #5270 <https://github.com/Genymobile/scrcpy/pull/5270>
Similar to UHID keyboard and mouse, but for gamepads.
Can be enabled with --gamepad=uhid or -G.
It is not enabled by default because not all devices support UHID
(there is a permission error on old Android versions).
PR #5270 <https://github.com/Genymobile/scrcpy/pull/5270>
This message will be sent on gamepad disconnection.
Contrary to keyboard and mouse devices, which are registered once and
unregistered when scrcpy exists, each physical gamepad is mapped with
its own HID id, and they can be plugged and unplugged dynamically.
PR #5270 <https://github.com/Genymobile/scrcpy/pull/5270>
Android accepts a float value, there is no reason to limit the option
to be an integer.
In particular, it allows to capture at a rate lower than 1 fps. For
example, to capture 1 frame every 5 seconds:
scrcpy --video-source=camera --max-fps=0.2
It was already possible to pass a float manually:
scrcpy --video-source=camera \
--video-codec-options=max-fps-to-encoder:float=0.2
But accepting a float directly for --max-fps is more convenient.
Refs <https://developer.android.com/reference/android/media/MediaFormat#KEY_MAX_FPS_TO_ENCODER>
A video width or height of 0 triggered an assert.
Fail explicitly instead: the server may actually send this size in
practice (for example on cropping with small dimensions, even if the
requested crop size is not 0).