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

It is recommended to send the current rotation direction of the device when the device is rotated. #5704

Open
sbfkcel opened this issue Dec 26, 2024 · 2 comments

Comments

@sbfkcel
Copy link

sbfkcel commented Dec 26, 2024

Is your feature request related to a problem? Please describe.
Monitors the device's rotation direction.

Describe the solution you'd like
When the screen size changes, the screen rotation direction is obtained and sent out through the socket along with the key frame data before or after SPS.

Describe alternatives you've considered
This is useful if you need to draw the device appearance correctly. Although it is also possible to obtain it through adb, there are delays or instabilities.

Additional context
Related Discussions

#3605

#925

@rom1v
Copy link
Collaborator

rom1v commented Dec 26, 2024

In scrcpy, the video frame size (known once the frame is decoded) is sufficient, so it does not transmit an additional rotation.

Moreover, it is not always obvious what the rotation value should be in all cases:

  • scrcpy --new-display=1920x1080
  • scrcpy --new-display=1080x1920
  • scrcpy --capture-orientation=90 (when the device is initially portrait)
  • scrcpy --capture-orientation=90 (when the device is initially landscape)
  • scrcpy --capture-orientation=flip90 (…)
  • scrcpy --video-source=camera …

@sbfkcel
Copy link
Author

sbfkcel commented Dec 27, 2024

Yes, for the screen display, the exact direction is not required. By parsing the SPS of the keyframe, the width and height of the screen can be obtained, thereby determining whether the screen is displayed in landscape or portrait.

But in some cases, it would be good to have the correct device rotation direction. For example, it is necessary to correctly draw the appearance of a device, or simulate the shape of the screen (so far, there are too many screens of different shapes);

image

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