change: AID_GRAPHICS -> AID_SYSTEM
add: fllag --root to launch server as root
cleanup: phantom whitespace
change: eliminate ambiguous description
add: autocompletion for --root
change: use getPackageName method rather than fixed constant for `--root` case
change: at least try audio when running as AID_SYSTEM on older versions
fixups: PACKAGE_SHELL constant where necessary, DRY
cleanup: usage of PACKAGE_NAME + PACKAGE_SHELL
On sway (a window manager), SDL_WINDOWEVENT_EXPOSED and
SDL_WINDOWEVENT_SIZE_CHANGED might not be called before a mouse event is
triggered. As a consequence, the "content rectangle" might not be
initialized when the mouse event is processed, causing a division by
zero.
To avoid the problem, initialize the content rect immediately when the
window is shown.
Fixes#4115 <https://github.com/Genymobile/scrcpy/issues/4115>
In the recorder, if the video or audio stream is disabled, do not wait
for its initialization (it will never happen) to process the header.
In that case (scrcpy --no-audio --record=file.mp4), this caused the
whole content to be buffered in memory, and written only on exit.
The sc_cond_wait() in sc_recorder_process_header() needs to be notified
of changes to video_init/audio_init (protected by stream_cond) and
video_queue/audio_queue (protected by queue_cond).
Use only one condition variable to simplify.
The comment was outdated:
- the "meta" header is now always present (not only when recording is
enabled);
- it is not only used for the video stream, but also for the audio
stream.
On some window managers (e.g. on Windows), performing a resize while the
window is minimized does nothing (the restored window keeps its old
size).
Therefore, like for maximized and fullscreen states, wait for the window
to be restored to apply a resize.
Refs #3947 <https://github.com/Genymobile/scrcpy/issues/3947>
When the scrcpy window is minimized on Windows with D3D9, texture
creation and update fail.
In that case, do not terminate scrcpy. Instead, store the pending size
or frame to update, to attempt again during the next update or
rendering.
Fixes#3947 <https://github.com/Genymobile/scrcpy/issues/3947>
Some server parameters may depend on one another. For example,
audio_bit_rate is meaningless if audio is false.
But it is inconsistent to disable some parameters based on these
dependencies checks, but not others. Handling all dependencies between
parameters would add too much complexity for no benefit.
So just pass individual parameters independently.
PR #3978 <https://github.com/Genymobile/scrcpy/pull/3978>
By default, SDL creates an OpenGL 2.1 context on macOS for an OpenGL
renderer. As a consequence, mipmapping is not supported.
Force to use a core profile context, to get a higher version.
Before:
INFO: Renderer: opengl
INFO: OpenGL version: 2.1 NVIDIA-14.0.32 355.11.11.10.10.143
WARN: Trilinear filtering disabled (OpenGL 3.0+ or ES 2.0+ required)
After:
INFO: Renderer: opengl
DEBUG: Creating OpenGL Core Profile context
INFO: OpenGL version: 4.1 NVIDIA-14.0.32 355.11.11.10.10.143
INFO: Trilinear filtering enabled
when running with:
scrcpy --verbosity=debug --render-driver=opengl
Note: Since SDL_CreateRenderer() causes a fallback to OpenGL 2.1, the
profile and version attributes have to be set and the context created
_after_.
PR #3895 <https://github.com/Genymobile/scrcpy/pull/3895>
Signed-off-by: Romain Vimont <rom@rom1v.com>
If a line did not end with '\r', then the final `\n' was replaced by
'\0' for parsing the current line. This `\0` was then mistakenly
considered as the end of the whole "ip route" output, so the remaining
lines were not parsed, causing "scrcpy --tcpip" to fail in some cases.
To fix the issue, read the final character of the current line before it
is (possibly) overwritten by '\0'.