UNPKG

mediasoup

Version:

Cutting Edge WebRTC Video Conferencing

95 lines (94 loc) 3.61 kB
"use strict"; // automatically generated by the FlatBuffers compiler, do not modify Object.defineProperty(exports, "__esModule", { value: true }); exports.SendStatsT = exports.SendStats = void 0; /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ const flatbuffers = require("flatbuffers"); const stats_1 = require("../../fbs/rtp-stream/stats"); class SendStats { bb = null; bb_pos = 0; __init(i, bb) { this.bb_pos = i; this.bb = bb; return this; } static getRootAsSendStats(bb, obj) { return (obj || new SendStats()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } static getSizePrefixedRootAsSendStats(bb, obj) { bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); return (obj || new SendStats()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } base(obj) { const offset = this.bb.__offset(this.bb_pos, 4); return offset ? (obj || new stats_1.Stats()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null; } packetCount() { const offset = this.bb.__offset(this.bb_pos, 6); return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0'); } byteCount() { const offset = this.bb.__offset(this.bb_pos, 8); return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0'); } bitrate() { const offset = this.bb.__offset(this.bb_pos, 10); return offset ? this.bb.readUint32(this.bb_pos + offset) : 0; } static startSendStats(builder) { builder.startObject(4); } static addBase(builder, baseOffset) { builder.addFieldOffset(0, baseOffset, 0); } static addPacketCount(builder, packetCount) { builder.addFieldInt64(1, packetCount, BigInt('0')); } static addByteCount(builder, byteCount) { builder.addFieldInt64(2, byteCount, BigInt('0')); } static addBitrate(builder, bitrate) { builder.addFieldInt32(3, bitrate, 0); } static endSendStats(builder) { const offset = builder.endObject(); builder.requiredField(offset, 4); // base return offset; } static createSendStats(builder, baseOffset, packetCount, byteCount, bitrate) { SendStats.startSendStats(builder); SendStats.addBase(builder, baseOffset); SendStats.addPacketCount(builder, packetCount); SendStats.addByteCount(builder, byteCount); SendStats.addBitrate(builder, bitrate); return SendStats.endSendStats(builder); } unpack() { return new SendStatsT((this.base() !== null ? this.base().unpack() : null), this.packetCount(), this.byteCount(), this.bitrate()); } unpackTo(_o) { _o.base = (this.base() !== null ? this.base().unpack() : null); _o.packetCount = this.packetCount(); _o.byteCount = this.byteCount(); _o.bitrate = this.bitrate(); } } exports.SendStats = SendStats; class SendStatsT { base; packetCount; byteCount; bitrate; constructor(base = null, packetCount = BigInt('0'), byteCount = BigInt('0'), bitrate = 0) { this.base = base; this.packetCount = packetCount; this.byteCount = byteCount; this.bitrate = bitrate; } pack(builder) { const base = (this.base !== null ? this.base.pack(builder) : 0); return SendStats.createSendStats(builder, base, this.packetCount, this.byteCount, this.bitrate); } } exports.SendStatsT = SendStatsT;