UNPKG

mediasoup

Version:

Cutting Edge WebRTC Video Conferencing

322 lines (321 loc) 15.3 kB
"use strict"; // automatically generated by the FlatBuffers compiler, do not modify Object.defineProperty(exports, "__esModule", { value: true }); exports.StatsT = exports.Stats = void 0; /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ const flatbuffers = require("flatbuffers"); class Stats { bb = null; bb_pos = 0; __init(i, bb) { this.bb_pos = i; this.bb = bb; return this; } static getRootAsStats(bb, obj) { return (obj || new Stats()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } static getSizePrefixedRootAsStats(bb, obj) { bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); return (obj || new Stats()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } transportId(optionalEncoding) { const offset = this.bb.__offset(this.bb_pos, 4); return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null; } timestamp() { const offset = this.bb.__offset(this.bb_pos, 6); return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0'); } sctpState() { const offset = this.bb.__offset(this.bb_pos, 8); return offset ? this.bb.readUint8(this.bb_pos + offset) : null; } bytesReceived() { const offset = this.bb.__offset(this.bb_pos, 10); return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0'); } recvBitrate() { const offset = this.bb.__offset(this.bb_pos, 12); return offset ? this.bb.readUint32(this.bb_pos + offset) : 0; } bytesSent() { const offset = this.bb.__offset(this.bb_pos, 14); return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0'); } sendBitrate() { const offset = this.bb.__offset(this.bb_pos, 16); return offset ? this.bb.readUint32(this.bb_pos + offset) : 0; } rtpBytesReceived() { const offset = this.bb.__offset(this.bb_pos, 18); return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0'); } rtpRecvBitrate() { const offset = this.bb.__offset(this.bb_pos, 20); return offset ? this.bb.readUint32(this.bb_pos + offset) : 0; } rtpBytesSent() { const offset = this.bb.__offset(this.bb_pos, 22); return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0'); } rtpSendBitrate() { const offset = this.bb.__offset(this.bb_pos, 24); return offset ? this.bb.readUint32(this.bb_pos + offset) : 0; } rtxBytesReceived() { const offset = this.bb.__offset(this.bb_pos, 26); return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0'); } rtxRecvBitrate() { const offset = this.bb.__offset(this.bb_pos, 28); return offset ? this.bb.readUint32(this.bb_pos + offset) : 0; } rtxBytesSent() { const offset = this.bb.__offset(this.bb_pos, 30); return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0'); } rtxSendBitrate() { const offset = this.bb.__offset(this.bb_pos, 32); return offset ? this.bb.readUint32(this.bb_pos + offset) : 0; } probationBytesSent() { const offset = this.bb.__offset(this.bb_pos, 34); return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0'); } probationSendBitrate() { const offset = this.bb.__offset(this.bb_pos, 36); return offset ? this.bb.readUint32(this.bb_pos + offset) : 0; } availableOutgoingBitrate() { const offset = this.bb.__offset(this.bb_pos, 38); return offset ? this.bb.readUint32(this.bb_pos + offset) : null; } availableIncomingBitrate() { const offset = this.bb.__offset(this.bb_pos, 40); return offset ? this.bb.readUint32(this.bb_pos + offset) : null; } maxIncomingBitrate() { const offset = this.bb.__offset(this.bb_pos, 42); return offset ? this.bb.readUint32(this.bb_pos + offset) : null; } maxOutgoingBitrate() { const offset = this.bb.__offset(this.bb_pos, 44); return offset ? this.bb.readUint32(this.bb_pos + offset) : null; } minOutgoingBitrate() { const offset = this.bb.__offset(this.bb_pos, 46); return offset ? this.bb.readUint32(this.bb_pos + offset) : null; } rtpPacketLossReceived() { const offset = this.bb.__offset(this.bb_pos, 48); return offset ? this.bb.readFloat64(this.bb_pos + offset) : null; } rtpPacketLossSent() { const offset = this.bb.__offset(this.bb_pos, 50); return offset ? this.bb.readFloat64(this.bb_pos + offset) : null; } static startStats(builder) { builder.startObject(24); } static addTransportId(builder, transportIdOffset) { builder.addFieldOffset(0, transportIdOffset, 0); } static addTimestamp(builder, timestamp) { builder.addFieldInt64(1, timestamp, BigInt('0')); } static addSctpState(builder, sctpState) { builder.addFieldInt8(2, sctpState, null); } static addBytesReceived(builder, bytesReceived) { builder.addFieldInt64(3, bytesReceived, BigInt('0')); } static addRecvBitrate(builder, recvBitrate) { builder.addFieldInt32(4, recvBitrate, 0); } static addBytesSent(builder, bytesSent) { builder.addFieldInt64(5, bytesSent, BigInt('0')); } static addSendBitrate(builder, sendBitrate) { builder.addFieldInt32(6, sendBitrate, 0); } static addRtpBytesReceived(builder, rtpBytesReceived) { builder.addFieldInt64(7, rtpBytesReceived, BigInt('0')); } static addRtpRecvBitrate(builder, rtpRecvBitrate) { builder.addFieldInt32(8, rtpRecvBitrate, 0); } static addRtpBytesSent(builder, rtpBytesSent) { builder.addFieldInt64(9, rtpBytesSent, BigInt('0')); } static addRtpSendBitrate(builder, rtpSendBitrate) { builder.addFieldInt32(10, rtpSendBitrate, 0); } static addRtxBytesReceived(builder, rtxBytesReceived) { builder.addFieldInt64(11, rtxBytesReceived, BigInt('0')); } static addRtxRecvBitrate(builder, rtxRecvBitrate) { builder.addFieldInt32(12, rtxRecvBitrate, 0); } static addRtxBytesSent(builder, rtxBytesSent) { builder.addFieldInt64(13, rtxBytesSent, BigInt('0')); } static addRtxSendBitrate(builder, rtxSendBitrate) { builder.addFieldInt32(14, rtxSendBitrate, 0); } static addProbationBytesSent(builder, probationBytesSent) { builder.addFieldInt64(15, probationBytesSent, BigInt('0')); } static addProbationSendBitrate(builder, probationSendBitrate) { builder.addFieldInt32(16, probationSendBitrate, 0); } static addAvailableOutgoingBitrate(builder, availableOutgoingBitrate) { builder.addFieldInt32(17, availableOutgoingBitrate, null); } static addAvailableIncomingBitrate(builder, availableIncomingBitrate) { builder.addFieldInt32(18, availableIncomingBitrate, null); } static addMaxIncomingBitrate(builder, maxIncomingBitrate) { builder.addFieldInt32(19, maxIncomingBitrate, null); } static addMaxOutgoingBitrate(builder, maxOutgoingBitrate) { builder.addFieldInt32(20, maxOutgoingBitrate, null); } static addMinOutgoingBitrate(builder, minOutgoingBitrate) { builder.addFieldInt32(21, minOutgoingBitrate, null); } static addRtpPacketLossReceived(builder, rtpPacketLossReceived) { builder.addFieldFloat64(22, rtpPacketLossReceived, null); } static addRtpPacketLossSent(builder, rtpPacketLossSent) { builder.addFieldFloat64(23, rtpPacketLossSent, null); } static endStats(builder) { const offset = builder.endObject(); builder.requiredField(offset, 4); // transport_id return offset; } static createStats(builder, transportIdOffset, timestamp, sctpState, bytesReceived, recvBitrate, bytesSent, sendBitrate, rtpBytesReceived, rtpRecvBitrate, rtpBytesSent, rtpSendBitrate, rtxBytesReceived, rtxRecvBitrate, rtxBytesSent, rtxSendBitrate, probationBytesSent, probationSendBitrate, availableOutgoingBitrate, availableIncomingBitrate, maxIncomingBitrate, maxOutgoingBitrate, minOutgoingBitrate, rtpPacketLossReceived, rtpPacketLossSent) { Stats.startStats(builder); Stats.addTransportId(builder, transportIdOffset); Stats.addTimestamp(builder, timestamp); if (sctpState !== null) Stats.addSctpState(builder, sctpState); Stats.addBytesReceived(builder, bytesReceived); Stats.addRecvBitrate(builder, recvBitrate); Stats.addBytesSent(builder, bytesSent); Stats.addSendBitrate(builder, sendBitrate); Stats.addRtpBytesReceived(builder, rtpBytesReceived); Stats.addRtpRecvBitrate(builder, rtpRecvBitrate); Stats.addRtpBytesSent(builder, rtpBytesSent); Stats.addRtpSendBitrate(builder, rtpSendBitrate); Stats.addRtxBytesReceived(builder, rtxBytesReceived); Stats.addRtxRecvBitrate(builder, rtxRecvBitrate); Stats.addRtxBytesSent(builder, rtxBytesSent); Stats.addRtxSendBitrate(builder, rtxSendBitrate); Stats.addProbationBytesSent(builder, probationBytesSent); Stats.addProbationSendBitrate(builder, probationSendBitrate); if (availableOutgoingBitrate !== null) Stats.addAvailableOutgoingBitrate(builder, availableOutgoingBitrate); if (availableIncomingBitrate !== null) Stats.addAvailableIncomingBitrate(builder, availableIncomingBitrate); if (maxIncomingBitrate !== null) Stats.addMaxIncomingBitrate(builder, maxIncomingBitrate); if (maxOutgoingBitrate !== null) Stats.addMaxOutgoingBitrate(builder, maxOutgoingBitrate); if (minOutgoingBitrate !== null) Stats.addMinOutgoingBitrate(builder, minOutgoingBitrate); if (rtpPacketLossReceived !== null) Stats.addRtpPacketLossReceived(builder, rtpPacketLossReceived); if (rtpPacketLossSent !== null) Stats.addRtpPacketLossSent(builder, rtpPacketLossSent); return Stats.endStats(builder); } unpack() { return new StatsT(this.transportId(), this.timestamp(), this.sctpState(), this.bytesReceived(), this.recvBitrate(), this.bytesSent(), this.sendBitrate(), this.rtpBytesReceived(), this.rtpRecvBitrate(), this.rtpBytesSent(), this.rtpSendBitrate(), this.rtxBytesReceived(), this.rtxRecvBitrate(), this.rtxBytesSent(), this.rtxSendBitrate(), this.probationBytesSent(), this.probationSendBitrate(), this.availableOutgoingBitrate(), this.availableIncomingBitrate(), this.maxIncomingBitrate(), this.maxOutgoingBitrate(), this.minOutgoingBitrate(), this.rtpPacketLossReceived(), this.rtpPacketLossSent()); } unpackTo(_o) { _o.transportId = this.transportId(); _o.timestamp = this.timestamp(); _o.sctpState = this.sctpState(); _o.bytesReceived = this.bytesReceived(); _o.recvBitrate = this.recvBitrate(); _o.bytesSent = this.bytesSent(); _o.sendBitrate = this.sendBitrate(); _o.rtpBytesReceived = this.rtpBytesReceived(); _o.rtpRecvBitrate = this.rtpRecvBitrate(); _o.rtpBytesSent = this.rtpBytesSent(); _o.rtpSendBitrate = this.rtpSendBitrate(); _o.rtxBytesReceived = this.rtxBytesReceived(); _o.rtxRecvBitrate = this.rtxRecvBitrate(); _o.rtxBytesSent = this.rtxBytesSent(); _o.rtxSendBitrate = this.rtxSendBitrate(); _o.probationBytesSent = this.probationBytesSent(); _o.probationSendBitrate = this.probationSendBitrate(); _o.availableOutgoingBitrate = this.availableOutgoingBitrate(); _o.availableIncomingBitrate = this.availableIncomingBitrate(); _o.maxIncomingBitrate = this.maxIncomingBitrate(); _o.maxOutgoingBitrate = this.maxOutgoingBitrate(); _o.minOutgoingBitrate = this.minOutgoingBitrate(); _o.rtpPacketLossReceived = this.rtpPacketLossReceived(); _o.rtpPacketLossSent = this.rtpPacketLossSent(); } } exports.Stats = Stats; class StatsT { transportId; timestamp; sctpState; bytesReceived; recvBitrate; bytesSent; sendBitrate; rtpBytesReceived; rtpRecvBitrate; rtpBytesSent; rtpSendBitrate; rtxBytesReceived; rtxRecvBitrate; rtxBytesSent; rtxSendBitrate; probationBytesSent; probationSendBitrate; availableOutgoingBitrate; availableIncomingBitrate; maxIncomingBitrate; maxOutgoingBitrate; minOutgoingBitrate; rtpPacketLossReceived; rtpPacketLossSent; constructor(transportId = null, timestamp = BigInt('0'), sctpState = null, bytesReceived = BigInt('0'), recvBitrate = 0, bytesSent = BigInt('0'), sendBitrate = 0, rtpBytesReceived = BigInt('0'), rtpRecvBitrate = 0, rtpBytesSent = BigInt('0'), rtpSendBitrate = 0, rtxBytesReceived = BigInt('0'), rtxRecvBitrate = 0, rtxBytesSent = BigInt('0'), rtxSendBitrate = 0, probationBytesSent = BigInt('0'), probationSendBitrate = 0, availableOutgoingBitrate = null, availableIncomingBitrate = null, maxIncomingBitrate = null, maxOutgoingBitrate = null, minOutgoingBitrate = null, rtpPacketLossReceived = null, rtpPacketLossSent = null) { this.transportId = transportId; this.timestamp = timestamp; this.sctpState = sctpState; this.bytesReceived = bytesReceived; this.recvBitrate = recvBitrate; this.bytesSent = bytesSent; this.sendBitrate = sendBitrate; this.rtpBytesReceived = rtpBytesReceived; this.rtpRecvBitrate = rtpRecvBitrate; this.rtpBytesSent = rtpBytesSent; this.rtpSendBitrate = rtpSendBitrate; this.rtxBytesReceived = rtxBytesReceived; this.rtxRecvBitrate = rtxRecvBitrate; this.rtxBytesSent = rtxBytesSent; this.rtxSendBitrate = rtxSendBitrate; this.probationBytesSent = probationBytesSent; this.probationSendBitrate = probationSendBitrate; this.availableOutgoingBitrate = availableOutgoingBitrate; this.availableIncomingBitrate = availableIncomingBitrate; this.maxIncomingBitrate = maxIncomingBitrate; this.maxOutgoingBitrate = maxOutgoingBitrate; this.minOutgoingBitrate = minOutgoingBitrate; this.rtpPacketLossReceived = rtpPacketLossReceived; this.rtpPacketLossSent = rtpPacketLossSent; } pack(builder) { const transportId = (this.transportId !== null ? builder.createString(this.transportId) : 0); return Stats.createStats(builder, transportId, this.timestamp, this.sctpState, this.bytesReceived, this.recvBitrate, this.bytesSent, this.sendBitrate, this.rtpBytesReceived, this.rtpRecvBitrate, this.rtpBytesSent, this.rtpSendBitrate, this.rtxBytesReceived, this.rtxRecvBitrate, this.rtxBytesSent, this.rtxSendBitrate, this.probationBytesSent, this.probationSendBitrate, this.availableOutgoingBitrate, this.availableIncomingBitrate, this.maxIncomingBitrate, this.maxOutgoingBitrate, this.minOutgoingBitrate, this.rtpPacketLossReceived, this.rtpPacketLossSent); } } exports.StatsT = StatsT;