From 330f40cc182743a8a8713c686e4fd3408ee8499d Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 20 Sep 2014 02:34:53 -0700 Subject: [PATCH] Disable resolution scaling for now --- .../limelight/nvstream/rtsp/SdpGenerator.java | 33 ++++++++++++++++--- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/moonlight-common/src/com/limelight/nvstream/rtsp/SdpGenerator.java b/moonlight-common/src/com/limelight/nvstream/rtsp/SdpGenerator.java index caff4aa9..53484c8d 100644 --- a/moonlight-common/src/com/limelight/nvstream/rtsp/SdpGenerator.java +++ b/moonlight-common/src/com/limelight/nvstream/rtsp/SdpGenerator.java @@ -64,15 +64,38 @@ public class SdpGenerator { addSessionAttribute(config, "x-nv-video[0].timeoutLengthMs", "7000"); addSessionAttribute(config, "x-nv-video[0].framesWithInvalidRefThreshold", "0"); - - if (sc.getAdaptiveResolutionEnabled()) { + // Adding 100 causes the stream to start at a lower resolution + /*if (sc.getAdaptiveResolutionEnabled()) { addSessionAttribute(config, "x-nv-vqos[0].bw.flags", "16183"); } - else { - addSessionAttribute(config, "x-nv-vqos[0].bw.flags", "16083"); + else*/ { + addSessionAttribute(config, "x-nv-vqos[0].bw.flags", "14083"); // Lock the bitrate if we're not scaling resolution so the picture doesn't get too bad - addSessionAttribute(config, "x-nv-vqos[0].bw.minimumBitrate", ""+sc.getBitrate()); + if (sc.getHeight() >= 1080 && sc.getRefreshRate() >= 60) { + if (sc.getBitrate() < 10000) { + addSessionAttribute(config, "x-nv-vqos[0].bw.minimumBitrate", ""+sc.getBitrate()); + } + else { + addSessionAttribute(config, "x-nv-vqos[0].bw.minimumBitrate", "10000"); + } + } + else if (sc.getHeight() >= 1080 || sc.getRefreshRate() >= 60) { + if (sc.getBitrate() < 7000) { + addSessionAttribute(config, "x-nv-vqos[0].bw.minimumBitrate", ""+sc.getBitrate()); + } + else { + addSessionAttribute(config, "x-nv-vqos[0].bw.minimumBitrate", "7000"); + } + } + else { + if (sc.getBitrate() < 3000) { + addSessionAttribute(config, "x-nv-vqos[0].bw.minimumBitrate", ""+sc.getBitrate()); + } + else { + addSessionAttribute(config, "x-nv-vqos[0].bw.minimumBitrate", "3000"); + } + } } addSessionAttribute(config, "x-nv-vqos[0].bw.maximumBitrate", ""+sc.getBitrate());