Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic resolution scaling of virtual displays. #5651

Open
TheLastFlame opened this issue Dec 11, 2024 · 1 comment
Open

Dynamic resolution scaling of virtual displays. #5651

TheLastFlame opened this issue Dec 11, 2024 · 1 comment

Comments

@TheLastFlame
Copy link

Get rid of the need to restart the virtual display to change the aspect ratio.

How feasible is this?

I envision this feature working according to the following algorithm:

  1. In the process of resizing the window, the image is not rebuilt
  2. When the action is completed (releasing the mouse key), the current virtual display is deleted and the open content is transferred to a new one created with the new resolution.

This seems quite feasible, but perhaps there are some pitfalls?

@rom1v
Copy link
Collaborator

rom1v commented Dec 11, 2024

This branch from @anirudhb (referenced from #5370) implemented parts of it: https://github.com/anirudhb/scrcpy/commits/virtual-display/

the current virtual display is deleted and the open content is transferred to a new one created with the new resolution.

VirtualDisplay has a resize() method: https://developer.android.com/reference/android/hardware/display/VirtualDisplay#resize(int,%20int,%20int)

When the action is completed (releasing the mouse key)

Unfortunately, SDL does not provide specific events for "resize start", "resize end", we just receive resize events.

But that's not a problem, just introduce some delay (200~500ms) before considering a new resize event to request a virtual display resize.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants