mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-20 19:42:45 +00:00
Improve HEVC check to add Titan X support and more importantly stop requesting H.265 on mobile GPUs that may not support it
This commit is contained in:
parent
b91ab53219
commit
8d1417c636
@ -166,15 +166,31 @@ public class NvConnection {
|
|||||||
|
|
||||||
// Determine whether we should request H.265 video
|
// Determine whether we should request H.265 video
|
||||||
String gpuType = h.getGpuType(serverInfo);
|
String gpuType = h.getGpuType(serverInfo);
|
||||||
if (context.streamConfig.getHevcSupported() && // Client wants it
|
if (gpuType == null || h.getMaxLumaPixelsHEVC(serverInfo) <= 0) // Check if GFE version supports it
|
||||||
h.getMaxLumaPixelsHEVC(serverInfo) > 0 && gpuType != null && // Check if GFE version supports it
|
|
||||||
gpuType.contains("GTX 9")) // Check if GPU can do it (only 900-series) - TODO: Find a better way to detect this
|
|
||||||
{
|
{
|
||||||
context.negotiatedVideoFormat = VideoFormat.H265;
|
context.negotiatedVideoFormat = VideoFormat.H264;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
context.negotiatedVideoFormat = VideoFormat.H264;
|
// Check if GPU can do it (only 900-series non-M)
|
||||||
|
//
|
||||||
|
// This check is pretty broken. It's not handling mobile GPUs, but it
|
||||||
|
// only has false negatives which is absolutely required to avoid breaking
|
||||||
|
// streaming on GPUs with an H.265 compatible client.
|
||||||
|
//
|
||||||
|
// TODO: I think the correct way to do this is by examining the SDP attributes which
|
||||||
|
// should contain parameter sets for HEVC if the GPU supports it.
|
||||||
|
|
||||||
|
gpuType = gpuType.toUpperCase();
|
||||||
|
if (context.streamConfig.getHevcSupported() && // Client wants it
|
||||||
|
((gpuType.contains("GTX 9") || gpuType.contains("GTX TITAN X")) && !gpuType.contains("M")))
|
||||||
|
{
|
||||||
|
context.negotiatedVideoFormat = VideoFormat.H265;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
context.negotiatedVideoFormat = VideoFormat.H264;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NvApp app = context.streamConfig.getApp();
|
NvApp app = context.streamConfig.getApp();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user