mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-04-23 00:26:42 +00:00
fixed some formatting in the code
This commit is contained in:
@@ -84,25 +84,26 @@ public class SwingCpuDecoderRenderer implements VideoDecoderRenderer {
|
|||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nextFrameTime = computePresentationTimeMs(targetFps);
|
||||||
|
|
||||||
double widthScale = (double)frame.getWidth() / width;
|
double widthScale = (double)frame.getWidth() / width;
|
||||||
double heightScale = (double)frame.getHeight() / height;
|
double heightScale = (double)frame.getHeight() / height;
|
||||||
double lowerScale = Math.min(widthScale, heightScale);
|
double lowerScale = Math.min(widthScale, heightScale);
|
||||||
int newWidth = (int)(width * lowerScale);
|
int newWidth = (int)(width * lowerScale);
|
||||||
int newHeight = (int)(height * lowerScale);
|
int newHeight = (int)(height * lowerScale);
|
||||||
|
|
||||||
nextFrameTime = computePresentationTimeMs(targetFps);
|
|
||||||
int dx1 = 0;
|
int dx1 = 0;
|
||||||
int dy1 = 0;
|
int dy1 = 0;
|
||||||
if (frame.getWidth() > newWidth) {
|
if (frame.getWidth() > newWidth) {
|
||||||
dx1 = (frame.getWidth()-newWidth)/2;
|
dx1 = (frame.getWidth()-newWidth)/4;
|
||||||
}
|
}
|
||||||
if (frame.getHeight() > newHeight) {
|
if (frame.getHeight() > newHeight) {
|
||||||
dy1 = (frame.getHeight()-newHeight)/2;
|
dy1 = (frame.getHeight()-newHeight)/4;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AvcDecoder.getRgbFrameInt(imageBuffer, imageBuffer.length)) {
|
if (AvcDecoder.getRgbFrameInt(imageBuffer, imageBuffer.length)) {
|
||||||
graphics.drawImage(image, dx1, dy1, dx1+newWidth, dy1+newHeight, 0, 0, width, height, null);
|
graphics.drawImage(image, dx1, dy1, dx1+newWidth, dy1+newHeight, 0, 0, width, height, null);
|
||||||
//graphics.drawImage(image, 0, 0, newWidth, newHeight, null);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user