Handle rotation value errors and reduce judgment implementation

This commit is contained in:
gz0119 2025-04-10 22:04:12 +08:00
commit 08e1c9cb43
3 changed files with 6 additions and 3 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View file

@ -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);
}

View file

@ -130,6 +130,7 @@ public class DisplaySizeMonitor {
}
private synchronized void setSessionInfo(SessionInfo sessionInfo) {
Ln.e("@@@@@@@@@@@@@@@@@@@@@@"+sessionInfo.rotation);
this.sessionInfo = sessionInfo;
}