mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-02-23 06:44:28 +01:00
Add --angle
Add an option to rotate the video content by a custom angle. Fixes #4135 <https://github.com/Genymobile/scrcpy/issues/4135> Fixes #4345 <https://github.com/Genymobile/scrcpy/issues/4345> Refs #4658 <https://github.com/Genymobile/scrcpy/pull/4658> PR #5455 <https://github.com/Genymobile/scrcpy/pull/5455>
This commit is contained in:
@@ -33,6 +33,7 @@ public class ScreenCapture extends SurfaceCapture {
|
||||
private final Rect crop;
|
||||
private Orientation.Lock captureOrientationLock;
|
||||
private Orientation captureOrientation;
|
||||
private final float angle;
|
||||
|
||||
private DisplayInfo displayInfo;
|
||||
private Size videoSize;
|
||||
@@ -55,6 +56,7 @@ public class ScreenCapture extends SurfaceCapture {
|
||||
this.captureOrientation = options.getCaptureOrientation();
|
||||
assert captureOrientationLock != null;
|
||||
assert captureOrientation != null;
|
||||
this.angle = options.getAngle();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -92,6 +94,7 @@ public class ScreenCapture extends SurfaceCapture {
|
||||
|
||||
boolean locked = captureOrientationLock != Orientation.Lock.Unlocked;
|
||||
filter.addOrientation(displayInfo.getRotation(), locked, captureOrientation);
|
||||
filter.addAngle(angle);
|
||||
|
||||
transform = filter.getInverseTransform();
|
||||
videoSize = filter.getOutputSize().limit(maxSize).round8();
|
||||
|
||||
Reference in New Issue
Block a user