mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-08-11 18:50:34 +00:00
Handle rotation value errors and reduce judgment implementation
This commit is contained in:
parent
81a65c3da1
commit
08e1c9cb43
3 changed files with 6 additions and 3 deletions
BIN
.DS_Store
vendored
Normal file
BIN
.DS_Store
vendored
Normal file
Binary file not shown.
|
@ -60,10 +60,12 @@ public final class Streamer {
|
|||
buffer.put((byte) 0xff);
|
||||
buffer.putInt(videoSize.getWidth());
|
||||
buffer.putInt(videoSize.getHeight());
|
||||
rotation = rotation * 90;
|
||||
buffer.put((byte) (isFlip ? 1 : 0));
|
||||
buffer.put((byte) (rotation >= 180 ? 1 : 0));
|
||||
buffer.put((byte) (rotation >= 90 ? 1 : 0));
|
||||
|
||||
int[] vertical = {0, 0, 1, 1};
|
||||
int[] horizontal = {0, 1, 0, 1};
|
||||
buffer.put((byte) vertical[rotation]);
|
||||
buffer.put((byte) horizontal[rotation]);
|
||||
buffer.flip();
|
||||
IO.writeFully(fd, buffer);
|
||||
}
|
||||
|
|
|
@ -130,6 +130,7 @@ public class DisplaySizeMonitor {
|
|||
}
|
||||
|
||||
private synchronized void setSessionInfo(SessionInfo sessionInfo) {
|
||||
Ln.e("@@@@@@@@@@@@@@@@@@@@@@"+sessionInfo.rotation);
|
||||
this.sessionInfo = sessionInfo;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue