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.ObservedRemoteInboundRtp = void 0; class ObservedRemoteInboundRtp { timestamp; id; ssrc; kind; _peerConnection; _visited = false; appData; transportId; codecId; packetsReceived; packetsLost; jitter; localId; roundTripTime; totalRoundTripTime; fractionLost; 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; } getOutboundRtp() { return this._peerConnection.observedOutboundRtps.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.packetsReceived = stats.packetsReceived; this.packetsLost = stats.packetsLost; this.jitter = stats.jitter; this.localId = stats.localId; this.roundTripTime = stats.roundTripTime; this.totalRoundTripTime = stats.totalRoundTripTime; this.fractionLost = stats.fractionLost; this.roundTripTimeMeasurements = stats.roundTripTimeMeasurements; this.attachments = stats.attachments; } } exports.ObservedRemoteInboundRtp = ObservedRemoteInboundRtp;