Some minor changes and fixes

canary
WolverinDEV 2020-11-22 16:11:00 +01:00
parent 0bde320faa
commit 0e030215db
5 changed files with 36 additions and 14 deletions

View File

@ -1,4 +1,9 @@
# Changelog:
** 22.11.20**
- Added a ton of video settings
- Added screen sharing (Currently via the camera channel)
- Using codec H264 instead of VP8
** 14.11.20**
- Fixed bug where the microphone has been requested when muting it.

View File

@ -182,8 +182,6 @@ export function initialize(event_registry: Registry<ClientGlobalControlEvents>)
spawnVideoSourceSelectModal(event.broadcastType, true).then(async source => {
if(!source) { return; }
const videoTrack = source.getStream().getVideoTracks()[0];
try {
event.connection.getServerConnection().getVideoConnection().startBroadcasting("camera", source)
.catch(error => {

View File

@ -131,15 +131,15 @@ function initializeController(events: Registry<ModalVideoSourceEvents>, currentS
if(typeof currentSource === "object") {
const videoTrack = currentSource.getStream().getVideoTracks()[0];
const settings = videoTrack.getSettings();
const capabilities = videoTrack.getCapabilities();
const capabilities = "getCapabilities" in videoTrack ? videoTrack.getCapabilities() : undefined;
events.fire_react("notify_setting_dimension", {
setting: {
minWidth: capabilities.width ? capabilities.width.min : settings.width,
maxWidth: capabilities.width ? capabilities.width.max : settings.width,
minWidth: capabilities?.width ? capabilities.width.min : 1,
maxWidth: capabilities?.width ? capabilities.width.max : settings.width,
minHeight: capabilities.height ? capabilities.height.min : settings.height,
maxHeight: capabilities.height ? capabilities.height.max : settings.height,
minHeight: capabilities?.height ? capabilities.height.min : 1,
maxHeight: capabilities?.height ? capabilities.height.max : settings.height,
originalWidth: settings.width,
originalHeight: settings.height,
@ -157,13 +157,13 @@ function initializeController(events: Registry<ModalVideoSourceEvents>, currentS
if(typeof currentSource === "object") {
const videoTrack = currentSource.getStream().getVideoTracks()[0];
const settings = videoTrack.getSettings();
const capabilities = videoTrack.getCapabilities();
const capabilities = "getCapabilities" in videoTrack ? videoTrack.getCapabilities() : undefined;
const round = (value: number) => Math.round(value * 100) / 100;
events.fire_react("notify_settings_framerate", {
frameRate: {
min: round(capabilities.frameRate ? capabilities.frameRate.min : settings.frameRate),
max: round(capabilities.frameRate ? capabilities.frameRate.max : settings.frameRate),
min: round(capabilities?.frameRate ? capabilities.frameRate.min : 1),
max: round(capabilities?.frameRate ? capabilities.frameRate.max : settings.frameRate),
original: round(settings.frameRate)
}
});

View File

@ -583,6 +583,11 @@ const BpsInfo = () => {
}
const Settings = () => {
if(window.detectedBrowser.name === "firefox") {
/* Firefox does not seem to give a fuck about any of our settings */
return null;
}
const [ advanced, setAdvanced ] = useState(false);
return (

View File

@ -53,9 +53,9 @@ export class SdpProcessor {
rtcpFb: [ "nack", "nack pli", "ccm fir", "transport-cc" ],
//42001f | Original: 42e01f
fmtp: {
"level-asymmetry-allowed": 1, "packetization-mode": 1, "profile-level-id": "42e01f", "max-br": 25000, "max-fr": 60,
"level-asymmetry-allowed": 1, "packetization-mode": 1, "profile-level-id": "42e01f", "max-br": 25000, "max-fr": 30,
"x-google-max-bitrate": 22 * 1000,
"x-google-start-bitrate": 22 * 1000, /* Fun fact: This actually controls the max bitrate for google chrome */
"x-google-start-bitrate": 22 * 1000,
}
}
];
@ -87,8 +87,22 @@ export class SdpProcessor {
const sdp = sdpTransform.parse(sdpString);
this.rtpRemoteChannelMapping = SdpProcessor.generateRtpSSrcMapping(sdp);
/* FIXME! */
SdpProcessor.patchLocalCodecs(sdp);
/* Fix for Firefox to acknowledge the max bandwidth */
for(const media of sdp.media) {
if(media.type !== "video") { continue; }
if(media.bandwidth?.length > 0) { continue; }
const config = media.fmtp.find(e => e.config.indexOf("x-google-start-bitrate") !== -1);
if(!config) { continue; }
const bitrate = config.config.split(";").find(e => e.startsWith("x-google-start-bitrate="))?.substr(23);
if(!bitrate) { continue; }
media.bandwidth = [{
type: "AS",
limit: bitrate
}];
}
return sdpTransform.write(sdp);
}