UNPKG

mediasoup

Version:

Cutting Edge WebRTC Video Conferencing

73 lines (72 loc) 2.72 kB
"use strict"; // automatically generated by the FlatBuffers compiler, do not modify Object.defineProperty(exports, "__esModule", { value: true }); exports.RtcpFeedbackT = exports.RtcpFeedback = 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 RtcpFeedback { bb = null; bb_pos = 0; __init(i, bb) { this.bb_pos = i; this.bb = bb; return this; } static getRootAsRtcpFeedback(bb, obj) { return (obj || new RtcpFeedback()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } static getSizePrefixedRootAsRtcpFeedback(bb, obj) { bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); return (obj || new RtcpFeedback()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } type(optionalEncoding) { const offset = this.bb.__offset(this.bb_pos, 4); return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null; } parameter(optionalEncoding) { const offset = this.bb.__offset(this.bb_pos, 6); return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null; } static startRtcpFeedback(builder) { builder.startObject(2); } static addType(builder, typeOffset) { builder.addFieldOffset(0, typeOffset, 0); } static addParameter(builder, parameterOffset) { builder.addFieldOffset(1, parameterOffset, 0); } static endRtcpFeedback(builder) { const offset = builder.endObject(); builder.requiredField(offset, 4); // type return offset; } static createRtcpFeedback(builder, typeOffset, parameterOffset) { RtcpFeedback.startRtcpFeedback(builder); RtcpFeedback.addType(builder, typeOffset); RtcpFeedback.addParameter(builder, parameterOffset); return RtcpFeedback.endRtcpFeedback(builder); } unpack() { return new RtcpFeedbackT(this.type(), this.parameter()); } unpackTo(_o) { _o.type = this.type(); _o.parameter = this.parameter(); } } exports.RtcpFeedback = RtcpFeedback; class RtcpFeedbackT { type; parameter; constructor(type = null, parameter = null) { this.type = type; this.parameter = parameter; } pack(builder) { const type = (this.type !== null ? builder.createString(this.type) : 0); const parameter = (this.parameter !== null ? builder.createString(this.parameter) : 0); return RtcpFeedback.createRtcpFeedback(builder, type, parameter); } } exports.RtcpFeedbackT = RtcpFeedbackT;