mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-19 19:13:03 +00:00
Always include resolutions that fit on the display
This commit is contained in:
parent
3a5ba820cb
commit
a56689aea3
@ -116,11 +116,21 @@ public class StreamSettings extends Activity {
|
|||||||
|
|
||||||
int maxSupportedResW = 0;
|
int maxSupportedResW = 0;
|
||||||
|
|
||||||
|
// Always allow resolutions that are smaller or equal to the active
|
||||||
|
// display resolution because decoders can report total non-sense to us.
|
||||||
|
// For example, a p201 device reports:
|
||||||
|
// AVC Decoder: OMX.amlogic.avc.decoder.awesome
|
||||||
|
// HEVC Decoder: OMX.amlogic.hevc.decoder.awesome
|
||||||
|
// AVC supported width range: 64 - 384
|
||||||
|
// HEVC supported width range: 64 - 544
|
||||||
for (Display.Mode candidate : display.getSupportedModes()) {
|
for (Display.Mode candidate : display.getSupportedModes()) {
|
||||||
if (candidate.getPhysicalWidth() >= 3840) {
|
if ((candidate.getPhysicalWidth() >= 3840 || candidate.getPhysicalHeight() >= 2160) &&
|
||||||
// Always include 4K if the display is physically large enough
|
maxSupportedResW < 3840) {
|
||||||
maxSupportedResW = candidate.getPhysicalWidth();
|
maxSupportedResW = 3840;
|
||||||
break;
|
}
|
||||||
|
else if ((candidate.getPhysicalWidth() >= 1920 || candidate.getPhysicalHeight() >= 1080) &&
|
||||||
|
maxSupportedResW < 1920) {
|
||||||
|
maxSupportedResW = 1920;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user