feat: Voice Gateway v8
This commit is contained in:
@@ -16,7 +16,40 @@ const BaseDispatcher = require('./BaseDispatcher');
|
||||
class VideoDispatcher extends BaseDispatcher {
|
||||
constructor(player, highWaterMark = 12, streams, fps, payloadType) {
|
||||
super(player, highWaterMark, payloadType, true, streams);
|
||||
/**
|
||||
* Video FPS
|
||||
* @type {number}
|
||||
*/
|
||||
this.fps = fps;
|
||||
|
||||
this.mtu = 1200;
|
||||
}
|
||||
|
||||
get TIMESTAMP_INC() {
|
||||
return 90000 / this.fps;
|
||||
}
|
||||
|
||||
get FRAME_LENGTH() {
|
||||
return 1000 / this.fps;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the type of the dispatcher
|
||||
* @returns {'video'}
|
||||
*/
|
||||
getTypeDispatcher() {
|
||||
return 'video';
|
||||
}
|
||||
|
||||
partitionMtu(data) {
|
||||
const out = [];
|
||||
const dataLength = data.length;
|
||||
|
||||
for (let i = 0; i < dataLength; i += this.mtu) {
|
||||
out.push(data.slice(i, i + this.mtu));
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -26,6 +59,10 @@ class VideoDispatcher extends BaseDispatcher {
|
||||
setFPSSource(value) {
|
||||
this.fps = value;
|
||||
}
|
||||
|
||||
_codecCallback() {
|
||||
throw new Error('The _codecCallback method must be implemented');
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = VideoDispatcher;
|
||||
|
||||
Reference in New Issue
Block a user