In SDL3, texture rendering uses SDL_FRect, unlike SDL2 which used
SDL_Rect.
Compute content location using floating-point coordinates from the
start.
PR #6651 <https://github.com/Genymobile/scrcpy/pull/6651>
Replace SDL "logical rendering" with explicit computation of icon
location, and unify rendering of video frames and icons using the same
common code.
PR #6651 <https://github.com/Genymobile/scrcpy/pull/6651>
Three components are involved in displaying device content on screen:
- a window
- a renderer
- a texture
Originally, all three were handled by sc_screen.
Commit 051b74c883 later extracted the
renderer and texture into a separate component, sc_display.
However, the split was a bit awkward because the window size and
rendering location were managed by separate components.
Move rendering back to sc_screen, keeping only texture management
separated.
PR #6651 <https://github.com/Genymobile/scrcpy/pull/6651>
Make sc_screen the owner of both the SDL window and the SDL renderer.
This is the first step toward limiting the role of sc_display to texture
management.
PR #6651 <https://github.com/Genymobile/scrcpy/pull/6651>
When the scrcpy window is minimized on Windows with D3D9, texture
creation and updates fail.
As a workaround, a mechanism was implemented to reattempt applying the
requested changes.
Since SDL3 defaults to the D3D11 backend, remove this workaround,
which adds a lot of complexity for a backend that should almost never
be used.
However, do not close scrcpy when texture creation or updates fail; only
that specific rendering should fail.
Refs SDL/#7651 <https://github.com/libsdl-org/SDL/issues/7651>
Refs #3947 <https://github.com/Genymobile/scrcpy/issues/3947>
Refs 6298ef095f
PR #6651 <https://github.com/Genymobile/scrcpy/pull/6651>
Originally, the default scrcpy window always displayed the video stream.
Since the OTG mode window only contains the scrcpy logo, it was
implemented as a separate component [1].
Later, the --no-video option was added [2] to control the device without
mirroring (while still using an adb connection, unlike OTG mode). To
support this, sc_screen gained the ability to display a window
containing only the scrcpy logo, like in OTG mode.
As a result, the main sc_screen component can now be reused in OTG mode,
allowing removal of the OTG-specific duplicate implementation
(sc_screen_otg).
[1] commit 91418c79ab
[2] commit 8c650e53cd
Refs #2974 <https://github.com/Genymobile/scrcpy/pull/2974>
Refs #3978 <https://github.com/Genymobile/scrcpy/pull/3978>
PR #6649 <https://github.com/Genymobile/scrcpy/pull/6649>
The "file pusher" can be used when a window is present, but it was only
initialized when video playback was enabled, causing a segfault on file
drop when running without video playback.
Replace "fps=[15, 30, 60]" with "fps={15, 30, 60}".
The default toString() implementation for a SortedSet uses '[]', but
it is more correct to use '{}' to denote a set.
PR #6243 <https://github.com/Genymobile/scrcpy/pull/6243>
Introduce a new packet type, a "session" packet, containing metadata
about the encoding session. It is used only for the video stream and
currently includes the video resolution.
For illustration, here is a sequence of packets on the video stream:
device rotation
v
CODEC | SESSION | MEDIA | MEDIA | … | SESSION | MEDIA | MEDIA | …
1920x1080 <-----------------> 1080x1920 <------------------
encoding session 1 encoding session 2
This metadata is not strictly necessary, since the video resolution can
be determined after decoding. However, it allows detection of cases
where the encoder does not respect the requested size (and logs a
warning), even without decoding (e.g., when there is no video playback).
Additional metadata could be added later if necessary, for example the
actual device rotation.
Refs #5918 <https://github.com/Genymobile/scrcpy/pull/5918>
Refs #5894 <https://github.com/Genymobile/scrcpy/pull/5894>
PR #6159 <https://github.com/Genymobile/scrcpy/pull/6159>
Co-authored-by: gz0119 <liyong2@4399.com>
The stream metadata will contain both:
- the codec ID at the start of the stream
- the session metadata (video width and height) at the start of each
"session" (typically on rotation)
PR #6159 <https://github.com/Genymobile/scrcpy/pull/6159>