UNPKG

mediasoup

Version:

Cutting Edge WebRTC Video Conferencing

61 lines (60 loc) 2.56 kB
"use strict"; // automatically generated by the FlatBuffers compiler, do not modify Object.defineProperty(exports, "__esModule", { value: true }); exports.LayersChangeNotificationT = exports.LayersChangeNotification = 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 consumer_layers_1 = require("../../fbs/consumer/consumer-layers"); class LayersChangeNotification { bb = null; bb_pos = 0; __init(i, bb) { this.bb_pos = i; this.bb = bb; return this; } static getRootAsLayersChangeNotification(bb, obj) { return (obj || new LayersChangeNotification()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } static getSizePrefixedRootAsLayersChangeNotification(bb, obj) { bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); return (obj || new LayersChangeNotification()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } layers(obj) { const offset = this.bb.__offset(this.bb_pos, 4); return offset ? (obj || new consumer_layers_1.ConsumerLayers()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null; } static startLayersChangeNotification(builder) { builder.startObject(1); } static addLayers(builder, layersOffset) { builder.addFieldOffset(0, layersOffset, 0); } static endLayersChangeNotification(builder) { const offset = builder.endObject(); return offset; } static createLayersChangeNotification(builder, layersOffset) { LayersChangeNotification.startLayersChangeNotification(builder); LayersChangeNotification.addLayers(builder, layersOffset); return LayersChangeNotification.endLayersChangeNotification(builder); } unpack() { return new LayersChangeNotificationT((this.layers() !== null ? this.layers().unpack() : null)); } unpackTo(_o) { _o.layers = (this.layers() !== null ? this.layers().unpack() : null); } } exports.LayersChangeNotification = LayersChangeNotification; class LayersChangeNotificationT { layers; constructor(layers = null) { this.layers = layers; } pack(builder) { const layers = (this.layers !== null ? this.layers.pack(builder) : 0); return LayersChangeNotification.createLayersChangeNotification(builder, layers); } } exports.LayersChangeNotificationT = LayersChangeNotificationT;