Remove useless setSize() method
Inline its content. It makes the logic of internalStreamScreen() more readable (it reduces the number of indirections).
This commit is contained in:
parent
6cccf3ab2a
commit
b53d2c66e0
1 changed files with 4 additions and 6 deletions
|
@ -84,13 +84,16 @@ public class ScreenEncoder implements Device.RotationListener {
|
||||||
do {
|
do {
|
||||||
ScreenInfo screenInfo = device.getScreenInfo();
|
ScreenInfo screenInfo = device.getScreenInfo();
|
||||||
Rect contentRect = screenInfo.getContentRect();
|
Rect contentRect = screenInfo.getContentRect();
|
||||||
|
|
||||||
// include the locked video orientation
|
// include the locked video orientation
|
||||||
Rect videoRect = screenInfo.getVideoSize().toRect();
|
Rect videoRect = screenInfo.getVideoSize().toRect();
|
||||||
|
format.setInteger(MediaFormat.KEY_WIDTH, videoRect.width());
|
||||||
|
format.setInteger(MediaFormat.KEY_HEIGHT, videoRect.height());
|
||||||
|
|
||||||
// does not include the locked video orientation
|
// does not include the locked video orientation
|
||||||
Rect unlockedVideoRect = screenInfo.getUnlockedVideoSize().toRect();
|
Rect unlockedVideoRect = screenInfo.getUnlockedVideoSize().toRect();
|
||||||
int videoRotation = screenInfo.getVideoRotation();
|
int videoRotation = screenInfo.getVideoRotation();
|
||||||
int layerStack = device.getLayerStack();
|
int layerStack = device.getLayerStack();
|
||||||
setSize(format, videoRect.width(), videoRect.height());
|
|
||||||
|
|
||||||
Surface surface = null;
|
Surface surface = null;
|
||||||
try {
|
try {
|
||||||
|
@ -279,11 +282,6 @@ public class ScreenEncoder implements Device.RotationListener {
|
||||||
return SurfaceControl.createDisplay("scrcpy", secure);
|
return SurfaceControl.createDisplay("scrcpy", secure);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void setSize(MediaFormat format, int width, int height) {
|
|
||||||
format.setInteger(MediaFormat.KEY_WIDTH, width);
|
|
||||||
format.setInteger(MediaFormat.KEY_HEIGHT, height);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void setDisplaySurface(IBinder display, Surface surface, int orientation, Rect deviceRect, Rect displayRect, int layerStack) {
|
private static void setDisplaySurface(IBinder display, Surface surface, int orientation, Rect deviceRect, Rect displayRect, int layerStack) {
|
||||||
SurfaceControl.openTransaction();
|
SurfaceControl.openTransaction();
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue