mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-07 08:07:18 +02:00
Add setting to force HQ codec
This commit is contained in:
parent
e63f998f5a
commit
8dd17bb021
@ -48,9 +48,15 @@ class Preferences {
|
|||||||
'default': false,
|
'default': false,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
'id': Preferences.USE_DESKTOP_CODEC,
|
||||||
|
'label': 'Force high quality stream (same as desktop)',
|
||||||
|
'default': false,
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
'id': Preferences.DISABLE_BANDWIDTH_CHECKING,
|
'id': Preferences.DISABLE_BANDWIDTH_CHECKING,
|
||||||
'label': 'Force HD stream',
|
'label': 'Disable bandwitdh checking',
|
||||||
'default': false,
|
'default': false,
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -824,6 +830,31 @@ function patchVideoApi() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function patchRtcCodecs() {
|
||||||
|
if (typeof RTCRtpTransceiver === 'undefined' || !PREFS.get(Preferences.USE_DESKTOP_CODEC)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
RTCRtpTransceiver.prototype.orgSetCodecPreferences = RTCRtpTransceiver.prototype.setCodecPreferences;
|
||||||
|
RTCRtpTransceiver.prototype.setCodecPreferences = function(codecs) {
|
||||||
|
// Use the same codecs as desktop
|
||||||
|
codecs = [
|
||||||
|
{
|
||||||
|
'clockRate': 90000,
|
||||||
|
'mimeType': 'video/H264',
|
||||||
|
'sdpFmtpLine': 'level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=4d001f',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'clockRate': 90000,
|
||||||
|
'mimeType': 'video/H264',
|
||||||
|
'sdpFmtpLine': 'level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=4d001f',
|
||||||
|
}
|
||||||
|
].concat(codecs);
|
||||||
|
this.orgSetCodecPreferences(codecs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function numberPicker(key) {
|
function numberPicker(key) {
|
||||||
let value = PREFS.get(key);
|
let value = PREFS.get(key);
|
||||||
let $text, $decBtn, $incBtn;
|
let $text, $decBtn, $incBtn;
|
||||||
@ -1037,6 +1068,8 @@ if (PREFS.get(Preferences.DISABLE_BANDWIDTH_CHECKING)) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
patchRtcCodecs();
|
||||||
|
|
||||||
interceptHttpRequests();
|
interceptHttpRequests();
|
||||||
|
|
||||||
patchVideoApi();
|
patchVideoApi();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user