Skip to content

Commit

Permalink
Video: Fix null fps structure
Browse files Browse the repository at this point in the history
  • Loading branch information
stephendade committed Feb 4, 2024
1 parent 1fba8e2 commit 954ffc2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions server/videostream.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ class videoStream {
if (!this.active) {
return callback(null, this.devices, this.active, this.devices[0], this.devices[0].caps[0],
{ label: '0°', value: 0 }, 1100, fpsSelected, false, '127.0.0.1', 5400, false,
this.devices[0].caps[0].fps, this.devices[0].caps[0].fpsmax, this.devices[0].caps)
(this.devices[0].caps[0].fps !== undefined) ? this.devices[0].caps[0].fps : [],
this.devices[0].caps[0].fpsmax, this.devices[0].caps)
} else {
// format saved settings
const seldevice = this.devices.filter(it => it.value === this.savedDevice.device)
Expand All @@ -86,7 +87,8 @@ class videoStream {
this.resetVideo()
return callback(null, this.devices, this.active, this.devices[0], this.devices[0].caps[0],
{ label: '0°', value: 0 }, 1100, fpsSelected, false, '127.0.0.1', 5400, false,
this.devices[0].caps[0].fps, this.devices[0].caps[0].fpsmax, this.devices[0].caps)
(this.devices[0].caps[0].fps !== undefined) ? this.devices[0].caps[0].fps : [],
this.devices[0].caps[0].fpsmax, this.devices[0].caps)
}
const selRes = seldevice[0].caps.filter(it => it.value === this.savedDevice.width.toString() + 'x' + this.savedDevice.height.toString() + 'x' + this.savedDevice.format.toString().split('/')[1])
let selFPS = this.savedDevice.fps
Expand All @@ -99,7 +101,7 @@ class videoStream {
return callback(null, this.devices, this.active, seldevice[0], selRes[0],
{ label: this.savedDevice.rotation.toString() + '°', value: this.savedDevice.rotation },
this.savedDevice.bitrate, selFPS, this.savedDevice.useUDP, this.savedDevice.useUDPIP,
this.savedDevice.useUDPPort, this.savedDevice.useTimestamp, selRes[0].fps,
this.savedDevice.useUDPPort, this.savedDevice.useTimestamp, (selRes[0].fps !== undefined) ? selRes[0].fps : [],
selRes[0].fpsmax, seldevice[0].caps)
} else {
// bad settings
Expand All @@ -108,7 +110,8 @@ class videoStream {
this.resetVideo()
return callback(null, this.devices, this.active, this.devices[0], this.devices[0].caps[0],
{ label: '0°', value: 0 }, 1100, fpsSelected, false, '127.0.0.1', 5400, false,
this.devices[0].caps[0].fps, this.devices[0].caps[0].fpsmax, this.devices[0].caps)
(this.devices[0].caps[0].fps !== undefined) ? this.devices[0].caps[0].fps : [],
this.devices[0].caps[0].fpsmax, this.devices[0].caps)
}
}
}
Expand Down

0 comments on commit 954ffc2

Please sign in to comment.