"use strict";
// automatically generated by the FlatBuffers compiler, do not modify
Object.defineProperty(exports, "__esModule", { value: true });
exports.RtcpParametersT = exports.RtcpParameters = 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 RtcpParameters {
    bb = null;
    bb_pos = 0;
    __init(i, bb) {
        this.bb_pos = i;
        this.bb = bb;
        return this;
    }
    static getRootAsRtcpParameters(bb, obj) {
        return (obj || new RtcpParameters()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    static getSizePrefixedRootAsRtcpParameters(bb, obj) {
        bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
        return (obj || new RtcpParameters()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    cname(optionalEncoding) {
        const offset = this.bb.__offset(this.bb_pos, 4);
        return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
    }
    reducedSize() {
        const offset = this.bb.__offset(this.bb_pos, 6);
        return offset ? !!this.bb.readInt8(this.bb_pos + offset) : true;
    }
    static startRtcpParameters(builder) {
        builder.startObject(2);
    }
    static addCname(builder, cnameOffset) {
        builder.addFieldOffset(0, cnameOffset, 0);
    }
    static addReducedSize(builder, reducedSize) {
        builder.addFieldInt8(1, +reducedSize, +true);
    }
    static endRtcpParameters(builder) {
        const offset = builder.endObject();
        return offset;
    }
    static createRtcpParameters(builder, cnameOffset, reducedSize) {
        RtcpParameters.startRtcpParameters(builder);
        RtcpParameters.addCname(builder, cnameOffset);
        RtcpParameters.addReducedSize(builder, reducedSize);
        return RtcpParameters.endRtcpParameters(builder);
    }
    unpack() {
        return new RtcpParametersT(this.cname(), this.reducedSize());
    }
    unpackTo(_o) {
        _o.cname = this.cname();
        _o.reducedSize = this.reducedSize();
    }
}
exports.RtcpParameters = RtcpParameters;
class RtcpParametersT {
    cname;
    reducedSize;
    constructor(cname = null, reducedSize = true) {
        this.cname = cname;
        this.reducedSize = reducedSize;
    }
    pack(builder) {
        const cname = (this.cname !== null ? builder.createString(this.cname) : 0);
        return RtcpParameters.createRtcpParameters(builder, cname, this.reducedSize);
    }
}
exports.RtcpParametersT = RtcpParametersT;
