From 8a465edad93fa60a5c95fc5155ce5e33118d818a Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 27 Oct 2015 00:18:18 -0700 Subject: [PATCH] We might as well just keep the bitrate constant rather than doing all the complex logic to decide on a minimum. The dynamic scaling behavior is awful anyway. --- .../limelight/nvstream/rtsp/SdpGenerator.java | 46 ++----------------- 1 file changed, 4 insertions(+), 42 deletions(-) diff --git a/moonlight-common/src/com/limelight/nvstream/rtsp/SdpGenerator.java b/moonlight-common/src/com/limelight/nvstream/rtsp/SdpGenerator.java index 3474cfd0..d6ef75bd 100644 --- a/moonlight-common/src/com/limelight/nvstream/rtsp/SdpGenerator.java +++ b/moonlight-common/src/com/limelight/nvstream/rtsp/SdpGenerator.java @@ -96,49 +96,11 @@ public class SdpGenerator { addSessionAttribute(config, "x-nv-video[0].timeoutLengthMs", "7000"); addSessionAttribute(config, "x-nv-video[0].framesWithInvalidRefThreshold", "0"); - - // Lock the bitrate if we're not scaling resolution so the picture doesn't get too bad - if (context.streamConfig.getHeight() >= 2160 && context.streamConfig.getRefreshRate() >= 60) { - if (context.streamConfig.getBitrate() < 80000) { - addSessionAttribute(config, "x-nv-vqos[0].bw.minimumBitrate", ""+context.streamConfig.getBitrate()); - } - else { - addSessionAttribute(config, "x-nv-vqos[0].bw.minimumBitrate", "80000"); - } - } - else if (context.streamConfig.getHeight() >= 2160) { - if (context.streamConfig.getBitrate() < 40000) { - addSessionAttribute(config, "x-nv-vqos[0].bw.minimumBitrate", ""+context.streamConfig.getBitrate()); - } - else { - addSessionAttribute(config, "x-nv-vqos[0].bw.minimumBitrate", "40000"); - } - } - else if (context.streamConfig.getHeight() >= 1080 && context.streamConfig.getRefreshRate() >= 60) { - if (context.streamConfig.getBitrate() < 20000) { - addSessionAttribute(config, "x-nv-vqos[0].bw.minimumBitrate", ""+context.streamConfig.getBitrate()); - } - else { - addSessionAttribute(config, "x-nv-vqos[0].bw.minimumBitrate", "20000"); - } - } - else if (context.streamConfig.getHeight() >= 1080 || context.streamConfig.getRefreshRate() >= 60) { - if (context.streamConfig.getBitrate() < 10000) { - addSessionAttribute(config, "x-nv-vqos[0].bw.minimumBitrate", ""+context.streamConfig.getBitrate()); - } - else { - addSessionAttribute(config, "x-nv-vqos[0].bw.minimumBitrate", "10000"); - } - } - else { - if (context.streamConfig.getBitrate() < 5000) { - addSessionAttribute(config, "x-nv-vqos[0].bw.minimumBitrate", ""+context.streamConfig.getBitrate()); - } - else { - addSessionAttribute(config, "x-nv-vqos[0].bw.minimumBitrate", "5000"); - } - } + // We don't support dynamic bitrate scaling properly (it tends to bounce between min and max and never + // settle on the optimal bitrate if it's somewhere in the middle), so we'll just latch the bitrate + // to the requested value. + addSessionAttribute(config, "x-nv-vqos[0].bw.minimumBitrate", ""+context.streamConfig.getBitrate()); addSessionAttribute(config, "x-nv-vqos[0].bw.maximumBitrate", ""+context.streamConfig.getBitrate()); // Using FEC turns padding on which makes us have to take the slow path