mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-20 03:23:07 +00:00
Add support for selecting maximum stream bitrate
This commit is contained in:
parent
09e7ff0582
commit
a4098919b9
@ -3,11 +3,13 @@ package com.limelight.nvstream;
|
||||
public class StreamConfiguration {
|
||||
private int width, height;
|
||||
private int refreshRate;
|
||||
private int bitrate;
|
||||
|
||||
public StreamConfiguration(int width, int height, int refreshRate) {
|
||||
public StreamConfiguration(int width, int height, int refreshRate, int bitrate) {
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.refreshRate = refreshRate;
|
||||
this.bitrate = bitrate;
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
@ -21,4 +23,8 @@ public class StreamConfiguration {
|
||||
public int getRefreshRate() {
|
||||
return refreshRate;
|
||||
}
|
||||
|
||||
public int getBitrate() {
|
||||
return bitrate;
|
||||
}
|
||||
}
|
||||
|
@ -157,20 +157,28 @@ public class SdpGenerator {
|
||||
addSessionAttribute(config, "x-nv-vqos[0].ts.enable", "0");
|
||||
addSessionAttribute(config, "x-nv-vqos[0].ts.averageBitrate", "8");
|
||||
addSessionAttribute(config, "x-nv-vqos[0].ts.maximumBitrate", "10");
|
||||
addSessionAttribute(config, "x-nv-vqos[0].bw.flags", "823");
|
||||
addSessionAttribute(config, "x-nv-vqos[0].bw.flags", "819"); // Bit 2 being set causes picture problems (should be 823)
|
||||
|
||||
// Effective bitrate ceiling
|
||||
if (sc.getHeight() >= 1080) {
|
||||
addSessionAttribute(config, "x-nv-vqos[0].bw.maximumBitrate", "30000");
|
||||
addSessionAttribute(config, "x-nv-vqos[0].bw.minimumBitrate", "25000");
|
||||
}
|
||||
else if (sc.getRefreshRate() >= 60) {
|
||||
addSessionAttribute(config, "x-nv-vqos[0].bw.maximumBitrate", "13000");
|
||||
addSessionAttribute(config, "x-nv-vqos[0].bw.minimumBitrate", "13000");
|
||||
if (sc.getRefreshRate() >= 60) {
|
||||
addSessionAttribute(config, "x-nv-vqos[0].bw.maximumBitrate", ""+sc.getBitrate());
|
||||
addSessionAttribute(config, "x-nv-vqos[0].bw.minimumBitrate", "20000");
|
||||
}
|
||||
else {
|
||||
addSessionAttribute(config, "x-nv-vqos[0].bw.maximumBitrate", "10000");
|
||||
addSessionAttribute(config, "x-nv-vqos[0].bw.minimumBitrate", "2000");
|
||||
addSessionAttribute(config, "x-nv-vqos[0].bw.maximumBitrate", ""+sc.getBitrate());
|
||||
addSessionAttribute(config, "x-nv-vqos[0].bw.minimumBitrate", "10000");
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (sc.getRefreshRate() >= 60) {
|
||||
addSessionAttribute(config, "x-nv-vqos[0].bw.maximumBitrate", ""+sc.getBitrate());
|
||||
addSessionAttribute(config, "x-nv-vqos[0].bw.minimumBitrate", "8000");
|
||||
}
|
||||
else {
|
||||
addSessionAttribute(config, "x-nv-vqos[0].bw.maximumBitrate", ""+sc.getBitrate());
|
||||
addSessionAttribute(config, "x-nv-vqos[0].bw.minimumBitrate", "4000");
|
||||
}
|
||||
}
|
||||
|
||||
addSessionAttribute(config, "x-nv-vqos[0].bw.statsTime", "50");
|
||||
|
Loading…
x
Reference in New Issue
Block a user