UNPKG

@observertc/observer-js

Version:

Server Side NodeJS Library for processing ObserveRTC Samples

61 lines (60 loc) 1.77 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ObservedRemoteOutboundRtp = void 0; class ObservedRemoteOutboundRtp { timestamp; id; ssrc; kind; _peerConnection; _visited = false; appData; transportId; codecId; packetsSent; bytesSent; localId; remoteTimestamp; reportsSent; roundTripTime; totalRoundTripTime; roundTripTimeMeasurements; attachments; constructor(timestamp, id, ssrc, kind, _peerConnection) { this.timestamp = timestamp; this.id = id; this.ssrc = ssrc; this.kind = kind; this._peerConnection = _peerConnection; } get visited() { const visited = this._visited; this._visited = false; return visited; } getPeerConnection() { return this._peerConnection; } getInboundRtp() { return this._peerConnection.observedInboundRtps.get(this.ssrc); } getCodec() { return this._peerConnection.observedCodecs.get(this.codecId ?? ''); } update(stats) { this._visited = true; this.timestamp = stats.timestamp; this.transportId = stats.transportId; this.codecId = stats.codecId; this.packetsSent = stats.packetsSent; this.bytesSent = stats.bytesSent; this.localId = stats.localId; this.remoteTimestamp = stats.remoteTimestamp; this.reportsSent = stats.reportsSent; this.roundTripTime = stats.roundTripTime; this.totalRoundTripTime = stats.totalRoundTripTime; this.roundTripTimeMeasurements = stats.roundTripTimeMeasurements; this.attachments = stats.attachments; } } exports.ObservedRemoteOutboundRtp = ObservedRemoteOutboundRtp;