When the virtual display size is not aligned, a resize filter may be
inserted to compensate for small dimension mismatches, increasing
processing and resulting in a blurry image.
PR #6771 <https://github.com/Genymobile/scrcpy/pull/6771>
`DisplayMonitor` previously only triggered a capture reset when the
display size changed. In most cases, rotation also changes dimensions,
so the behavior was correct… except for square displays where width and
height remain unchanged.
However, rotation still requires a capture reset even when dimensions do
not change, to ensure the orientation filter is applied so virtual
displays are rendered correctly.
To reproduce the issue:
scrcpy --new-display=600x600 --start-app=com.android.settings
Then press Alt+r to rotate the Settings app.
PR #6770 <https://github.com/Genymobile/scrcpy/pull/6770>
Encoders require a minimum video size.
Use video capabilities to constrain a given size by the declared minimum
size of the selected encoder.
Contrary to the maximum size constraints (but like the alignment
constraint), use the same value in both directions for simplicity and so
that rotating the device does not change the shape of the video.
PR #6766 <https://github.com/Genymobile/scrcpy/pull/6766>
Encoders cannot encode at any resolution.
Use video capabilities to constrain a given size by the limits of the
selected encoder.
These video capabilities describe the range of supported widths and
heights, as well as the supported heights for a given width (and
vice-versa). Use this information to compute the maximum portrait size
and the maximum landscape size.
PR #6766 <https://github.com/Genymobile/scrcpy/pull/6766>
Group video constraints into a dedicated class. For now it only contains
the `alignment` field; additional constraints will be added in further
commits.
PR #6766 <https://github.com/Genymobile/scrcpy/pull/6766>
Previously, the size was scaled to fit the requested maximum size and
then aligned. If the maximum size was not a multiple of the alignment,
the resulting size was suboptimal as it preserved the aspect ratio less
accurately.
This also prepares for additional video constraints.
PR #6766 <https://github.com/Genymobile/scrcpy/pull/6766>
A mechanism was introduced to retry capture at a lower resolution to
support devices unable to encode at the device screen resolution.
While useful, this approach is inherently limited and will not be able
to handle the dynamic resizing required for resizable virtual displays.
Disable this mechanism entirely. Further commits will add support for
adjusting the size in advance according to video encoder capabilities.
Refs #2947 <https://github.com/Genymobile/scrcpy/pull/2947>
PR #6766 <https://github.com/Genymobile/scrcpy/pull/6766>
It was assumed that the video packet immediately following a config
packet was a non-config packet. This is not necessarily true: for
example, if the capture is reset (due to resizing or rotation) before
the first frame is produced.
By default, the window aspect ratio is preserved when resizing.
Add `--no-window-aspect-ratio-lock` to disable this behavior.
PR #6761 <https://github.com/Genymobile/scrcpy/pull/6761>
Signed-off-by: Romain Vimont <rom@rom1v.com>
On Windows and macOS, resizing the window with the mouse blocks the
event loop until the click is released. To keep rendering during
resizing, an event watcher is registered to handle resize events.
Avoid handling resize events twice by ensuring
`SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED` is processed only once.
PR #6758 <https://github.com/Genymobile/scrcpy/pull/6758>
Add --min-size-alignment to force a minimal size alignment.
This is a power-of-2 value (1, 2, 4, 8 or 16) that the video width and
height must be multiples of.
The actual alignment will be the maximum of this value and the video
codec's alignment requirement.
PR #6746 <https://github.com/Genymobile/scrcpy/pull/6746>
The sc_vector and sc_vecdeque utilities define insert_hole() and
push_hole() functions to insert uninitialized items (to be initialized
after the call).
However, "hole" is a poor name. Rename it to "uninitialized" for
clarity.
Previously, when the connection to the device was lost while mirroring,
the window closed immediately, suggesting scrcpy had crashed.
To make it clear that a disconnection occurred, display a disconnected
icon for 2 seconds before closing the window.
PR #6662 <https://github.com/Genymobile/scrcpy/pull/6662>
Replace scrcpy_icon_load(), which loaded the unique scrcpy app icon,
with sc_icon_load(filename), which can load any icon from the icons
directory.
PR #6662 <https://github.com/Genymobile/scrcpy/pull/6662>