The texture was created as soon as the initial video size was known,
even before the first frame arrived.
However, texture creation will require other data, such as the color
range, which is only available once the first frame is received.
Therefore, delay texture creation until the first frame.
For Android >= 12, scrcpy executed "settings" commands (in a new
process) rather than using the ContentProvider directly, due to
permission issues [1].
However, these permission issues were resolved by introducing
FakeContext.getContentResolver() [2].
Therefore, remove the use of "settings" commands and use the
ContentProvider directly in all cases.
Refs [1] cc0902b13c
Refs [2] 91373d906b
Refs #6224 comment <https://github.com/Genymobile/scrcpy/issues/6224#issuecomment-3078418268>
The ninja package is already installed, so this triggered a warning:
> ninja 1.13.0 is already installed and up-to-date. To reinstall 1.13.0,
> run: brew reinstall ninja
Over HID, only integral scroll values can be sent. When SDL precise
scrolling is active, scroll events may include fractional values (e.g.,
0.05), which are truncated to 0 in the HID event.
To fix the problem, use the integral scroll value reported by SDL, which
internally accumulates fractional deltas.
Fixes#6156 <https://github.com/Genymobile/scrcpy/issues/6156>
PR #6172 <https://github.com/Genymobile/scrcpy/pull/6172>
SDL precise scrolling can sometimes produce values greater than 1 or
less than -1.
On the wire, the value is encoded as a 16-bit fixed-point number.
Previously, the range was interpreted as [-1, 1], using 1 bit for the
integral part (the sign) and 15 bits for the fractional part.
To support larger values, interpret the range as [-16, 16] instead,
using 5 bits for the integral part and 11 bits for the fractional part
(which is more than enough).
PR #6172 <https://github.com/Genymobile/scrcpy/pull/6172>
The ClipboardManager is instantiated by the first call to
ServiceManager.getClipboardManager().
Now that scrcpy uses android.content.ClipboardManager directly, it must
ensure that it is created on the main thread (or at least on a thread
with a Looper), to avoid the following error:
> Can't create handler inside thread that has not called
> Looper.prepare()
Refs 8a02e3c2f5Fixes#6151 <https://github.com/Genymobile/scrcpy/issues/6151>
Since a main looper is explicitly run in the main process, the
initialization of workarounds no longer calls
Looper.prepareMainLooper(), leading to a crash:
java.lang.RuntimeException: Can't create handler inside thread
Thread[main,5,main] that has not called Looper.prepare()
As a result, --power-off-on-close was broken.
Refs 283326b2f6Fixes#6146 <https://github.com/Genymobile/scrcpy/issues/6146>
Some devices require a specific option to be enabled in Developer
Options to avoid a permission issue when injecting input events.
When this error occurs, hide the stack trace and print a human-readable
message explaining how to fix the issue.
PR #6080 <https://github.com/Genymobile/scrcpy/pull/6080>
Although "licence" is correct in British English, the rest of the
statement uses "license," so change it for consistency.
PR #6017 <https://github.com/Genymobile/scrcpy/pull/6017>
Signed-off-by: Romain Vimont <rom@rom1v.com>