"use strict";
// automatically generated by the FlatBuffers compiler, do not modify
Object.defineProperty(exports, "__esModule", { value: true });
exports.SrTraceInfoT = exports.SrTraceInfo = 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 SrTraceInfo {
    bb = null;
    bb_pos = 0;
    __init(i, bb) {
        this.bb_pos = i;
        this.bb = bb;
        return this;
    }
    static getRootAsSrTraceInfo(bb, obj) {
        return (obj || new SrTraceInfo()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    static getSizePrefixedRootAsSrTraceInfo(bb, obj) {
        bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
        return (obj || new SrTraceInfo()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    ssrc() {
        const offset = this.bb.__offset(this.bb_pos, 4);
        return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
    }
    ntpSec() {
        const offset = this.bb.__offset(this.bb_pos, 6);
        return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
    }
    ntpFrac() {
        const offset = this.bb.__offset(this.bb_pos, 8);
        return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
    }
    rtpTs() {
        const offset = this.bb.__offset(this.bb_pos, 10);
        return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
    }
    packetCount() {
        const offset = this.bb.__offset(this.bb_pos, 12);
        return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
    }
    octetCount() {
        const offset = this.bb.__offset(this.bb_pos, 14);
        return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
    }
    static startSrTraceInfo(builder) {
        builder.startObject(6);
    }
    static addSsrc(builder, ssrc) {
        builder.addFieldInt32(0, ssrc, 0);
    }
    static addNtpSec(builder, ntpSec) {
        builder.addFieldInt32(1, ntpSec, 0);
    }
    static addNtpFrac(builder, ntpFrac) {
        builder.addFieldInt32(2, ntpFrac, 0);
    }
    static addRtpTs(builder, rtpTs) {
        builder.addFieldInt32(3, rtpTs, 0);
    }
    static addPacketCount(builder, packetCount) {
        builder.addFieldInt32(4, packetCount, 0);
    }
    static addOctetCount(builder, octetCount) {
        builder.addFieldInt32(5, octetCount, 0);
    }
    static endSrTraceInfo(builder) {
        const offset = builder.endObject();
        return offset;
    }
    static createSrTraceInfo(builder, ssrc, ntpSec, ntpFrac, rtpTs, packetCount, octetCount) {
        SrTraceInfo.startSrTraceInfo(builder);
        SrTraceInfo.addSsrc(builder, ssrc);
        SrTraceInfo.addNtpSec(builder, ntpSec);
        SrTraceInfo.addNtpFrac(builder, ntpFrac);
        SrTraceInfo.addRtpTs(builder, rtpTs);
        SrTraceInfo.addPacketCount(builder, packetCount);
        SrTraceInfo.addOctetCount(builder, octetCount);
        return SrTraceInfo.endSrTraceInfo(builder);
    }
    unpack() {
        return new SrTraceInfoT(this.ssrc(), this.ntpSec(), this.ntpFrac(), this.rtpTs(), this.packetCount(), this.octetCount());
    }
    unpackTo(_o) {
        _o.ssrc = this.ssrc();
        _o.ntpSec = this.ntpSec();
        _o.ntpFrac = this.ntpFrac();
        _o.rtpTs = this.rtpTs();
        _o.packetCount = this.packetCount();
        _o.octetCount = this.octetCount();
    }
}
exports.SrTraceInfo = SrTraceInfo;
class SrTraceInfoT {
    ssrc;
    ntpSec;
    ntpFrac;
    rtpTs;
    packetCount;
    octetCount;
    constructor(ssrc = 0, ntpSec = 0, ntpFrac = 0, rtpTs = 0, packetCount = 0, octetCount = 0) {
        this.ssrc = ssrc;
        this.ntpSec = ntpSec;
        this.ntpFrac = ntpFrac;
        this.rtpTs = rtpTs;
        this.packetCount = packetCount;
        this.octetCount = octetCount;
    }
    pack(builder) {
        return SrTraceInfo.createSrTraceInfo(builder, this.ssrc, this.ntpSec, this.ntpFrac, this.rtpTs, this.packetCount, this.octetCount);
    }
}
exports.SrTraceInfoT = SrTraceInfoT;
