@observertc/observer-js 0.42.9 → 1.0.0-5f150eb.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (303) hide show
  1. package/.prettierrc +6 -6
  2. package/README.md +493 -63
  3. package/lib/ObservedCall.d.ts +48 -43
  4. package/lib/ObservedCall.d.ts.map +1 -1
  5. package/lib/ObservedCall.js +164 -107
  6. package/lib/ObservedCallEventMonitor.d.ts +107 -0
  7. package/lib/ObservedCallEventMonitor.d.ts.map +1 -0
  8. package/lib/ObservedCallEventMonitor.js +321 -0
  9. package/lib/ObservedCallSummary.d.ts +18 -0
  10. package/lib/ObservedCallSummary.d.ts.map +1 -0
  11. package/lib/ObservedCertificate.d.ts +19 -0
  12. package/lib/ObservedCertificate.d.ts.map +1 -0
  13. package/lib/ObservedCertificate.js +38 -0
  14. package/lib/ObservedClient.d.ts +78 -145
  15. package/lib/ObservedClient.d.ts.map +1 -1
  16. package/lib/ObservedClient.js +661 -746
  17. package/lib/ObservedClientEventMonitor.d.ts +91 -0
  18. package/lib/ObservedClientEventMonitor.d.ts.map +1 -0
  19. package/lib/ObservedClientEventMonitor.js +254 -0
  20. package/lib/ObservedClientSummary.d.ts +23 -0
  21. package/lib/ObservedClientSummary.d.ts.map +1 -0
  22. package/lib/ObservedClientSummary.js +2 -0
  23. package/lib/ObservedCodec.d.ts +22 -0
  24. package/lib/ObservedCodec.d.ts.map +1 -0
  25. package/lib/ObservedCodec.js +45 -0
  26. package/lib/ObservedDataChannel.d.ts +25 -69
  27. package/lib/ObservedDataChannel.d.ts.map +1 -1
  28. package/lib/ObservedDataChannel.js +69 -109
  29. package/lib/ObservedIceCandidate.d.ts +29 -0
  30. package/lib/ObservedIceCandidate.d.ts.map +1 -0
  31. package/lib/ObservedIceCandidate.js +59 -0
  32. package/lib/ObservedIceCandidatePair.d.ts +45 -0
  33. package/lib/ObservedIceCandidatePair.d.ts.map +1 -0
  34. package/lib/ObservedIceCandidatePair.js +127 -0
  35. package/lib/ObservedIceTransport.d.ts +36 -0
  36. package/lib/ObservedIceTransport.d.ts.map +1 -0
  37. package/lib/ObservedIceTransport.js +93 -0
  38. package/lib/ObservedInboundRtp.d.ts +92 -0
  39. package/lib/ObservedInboundRtp.d.ts.map +1 -0
  40. package/lib/ObservedInboundRtp.js +193 -0
  41. package/lib/ObservedInboundTrack.d.ts +34 -0
  42. package/lib/ObservedInboundTrack.d.ts.map +1 -0
  43. package/lib/ObservedInboundTrack.js +92 -0
  44. package/lib/ObservedMediaPlayout.d.ts +22 -0
  45. package/lib/ObservedMediaPlayout.d.ts.map +1 -0
  46. package/lib/ObservedMediaPlayout.js +42 -0
  47. package/lib/ObservedMediaSource.d.ts +28 -0
  48. package/lib/ObservedMediaSource.d.ts.map +1 -0
  49. package/lib/ObservedMediaSource.js +55 -0
  50. package/lib/ObservedOutboundRtp.d.ts +62 -0
  51. package/lib/ObservedOutboundRtp.d.ts.map +1 -0
  52. package/lib/ObservedOutboundRtp.js +144 -0
  53. package/lib/ObservedOutboundTrack.d.ts +34 -0
  54. package/lib/ObservedOutboundTrack.d.ts.map +1 -0
  55. package/lib/ObservedOutboundTrack.js +65 -0
  56. package/lib/ObservedPeerConnection.d.ts +154 -80
  57. package/lib/ObservedPeerConnection.d.ts.map +1 -1
  58. package/lib/ObservedPeerConnection.js +724 -357
  59. package/lib/ObservedPeerConnectionTransport.d.ts +17 -0
  60. package/lib/ObservedPeerConnectionTransport.d.ts.map +1 -0
  61. package/lib/ObservedPeerConnectionTransport.js +34 -0
  62. package/lib/ObservedRemoteInboundRtp.d.ts +30 -0
  63. package/lib/ObservedRemoteInboundRtp.d.ts.map +1 -0
  64. package/lib/ObservedRemoteInboundRtp.js +60 -0
  65. package/lib/ObservedRemoteOutboundRtp.d.ts +30 -0
  66. package/lib/ObservedRemoteOutboundRtp.d.ts.map +1 -0
  67. package/lib/ObservedRemoteOutboundRtp.js +60 -0
  68. package/lib/ObservedTURN.d.ts +31 -0
  69. package/lib/ObservedTURN.d.ts.map +1 -0
  70. package/lib/ObservedTURN.js +58 -0
  71. package/lib/ObservedTurnServer.d.ts +25 -0
  72. package/lib/ObservedTurnServer.d.ts.map +1 -0
  73. package/lib/ObservedTurnServer.js +59 -0
  74. package/lib/Observer.d.ts +46 -54
  75. package/lib/Observer.d.ts.map +1 -1
  76. package/lib/Observer.js +131 -226
  77. package/lib/ObserverEventMonitor.d.ts +141 -0
  78. package/lib/ObserverEventMonitor.d.ts.map +1 -0
  79. package/lib/ObserverEventMonitor.js +440 -0
  80. package/lib/ObserverSummary.d.ts +13 -0
  81. package/lib/ObserverSummary.d.ts.map +1 -0
  82. package/lib/ObserverSummary.js +2 -0
  83. package/lib/Reports.d.ts +85 -0
  84. package/lib/Reports.d.ts.map +1 -0
  85. package/lib/Reports.js +2 -0
  86. package/lib/common/Middleware.d.ts +10 -1
  87. package/lib/common/Middleware.d.ts.map +1 -1
  88. package/lib/common/Middleware.js +55 -36
  89. package/lib/common/logger.d.ts +8 -4
  90. package/lib/common/logger.d.ts.map +1 -1
  91. package/lib/common/logger.js +44 -68
  92. package/lib/common/types.d.ts +0 -21
  93. package/lib/common/types.d.ts.map +1 -1
  94. package/lib/common/types.js +1 -0
  95. package/lib/common/utils.d.ts +3 -1
  96. package/lib/common/utils.d.ts.map +1 -1
  97. package/lib/common/utils.js +23 -3
  98. package/lib/detectors/Detector.d.ts +5 -0
  99. package/lib/detectors/Detector.d.ts.map +1 -0
  100. package/lib/detectors/Detector.js +3 -0
  101. package/lib/detectors/Detectors.d.ts +11 -0
  102. package/lib/detectors/Detectors.d.ts.map +1 -0
  103. package/lib/detectors/Detectors.js +34 -0
  104. package/lib/index.d.ts +27 -25
  105. package/lib/index.d.ts.map +1 -1
  106. package/lib/index.js +45 -41
  107. package/lib/mediasoup/ObservedMediaRouter.d.ts +10 -0
  108. package/lib/mediasoup/ObservedMediaRouter.d.ts.map +1 -0
  109. package/lib/mediasoup/ObservedMediaRouter.js +6 -0
  110. package/lib/monitors/TurnUsageMonitor.d.ts +0 -52
  111. package/lib/monitors/TurnUsageMonitor.d.ts.map +1 -1
  112. package/lib/monitors/TurnUsageMonitor.js +145 -120
  113. package/lib/schema/ClientEventTypes.d.ts +228 -0
  114. package/lib/schema/ClientEventTypes.d.ts.map +1 -0
  115. package/lib/schema/ClientEventTypes.js +41 -0
  116. package/lib/schema/ClientMetaTypes.d.ts +34 -0
  117. package/lib/schema/ClientMetaTypes.d.ts.map +1 -0
  118. package/lib/schema/ClientMetaTypes.js +16 -0
  119. package/lib/schema/ClientSample.d.ts +1333 -0
  120. package/lib/schema/ClientSample.d.ts.map +1 -0
  121. package/lib/schema/ClientSample.js +4 -0
  122. package/lib/scores/CalculatedScore.d.ts +6 -0
  123. package/lib/scores/CalculatedScore.d.ts.map +1 -0
  124. package/lib/scores/CalculatedScore.js +2 -0
  125. package/lib/scores/DefaultCallScoreCalculator.d.ts +7 -0
  126. package/lib/scores/DefaultCallScoreCalculator.d.ts.map +1 -0
  127. package/lib/scores/DefaultCallScoreCalculator.js +21 -0
  128. package/lib/scores/ScoreCalculator.d.ts +4 -0
  129. package/lib/scores/ScoreCalculator.d.ts.map +1 -0
  130. package/lib/scores/ScoreCalculator.js +2 -0
  131. package/lib/updaters/CallUpdater.d.ts +5 -0
  132. package/lib/updaters/CallUpdater.d.ts.map +1 -0
  133. package/lib/updaters/CallUpdater.js +2 -0
  134. package/lib/updaters/ObserverUpdater.d.ts +5 -0
  135. package/lib/updaters/ObserverUpdater.d.ts.map +1 -0
  136. package/lib/updaters/ObserverUpdater.js +2 -0
  137. package/lib/updaters/OnAllCallObserverUpdater.d.ts +15 -0
  138. package/lib/updaters/OnAllCallObserverUpdater.d.ts.map +1 -0
  139. package/lib/updaters/OnAllCallObserverUpdater.js +50 -0
  140. package/lib/updaters/OnAllClientCallUpdater.d.ts +15 -0
  141. package/lib/updaters/OnAllClientCallUpdater.d.ts.map +1 -0
  142. package/lib/updaters/OnAllClientCallUpdater.js +53 -0
  143. package/lib/updaters/OnAnyCallObserverUpdater.d.ts +12 -0
  144. package/lib/updaters/OnAnyCallObserverUpdater.d.ts.map +1 -0
  145. package/lib/updaters/OnAnyCallObserverUpdater.js +37 -0
  146. package/lib/updaters/OnAnyClientCallUpdater.d.ts +12 -0
  147. package/lib/updaters/OnAnyClientCallUpdater.d.ts.map +1 -0
  148. package/lib/updaters/OnAnyClientCallUpdater.js +36 -0
  149. package/lib/updaters/OnIntervalUpdater.d.ts +10 -0
  150. package/lib/updaters/OnIntervalUpdater.d.ts.map +1 -0
  151. package/lib/updaters/OnIntervalUpdater.js +17 -0
  152. package/lib/updaters/Updater.d.ts +6 -0
  153. package/lib/updaters/Updater.d.ts.map +1 -0
  154. package/lib/updaters/Updater.js +2 -0
  155. package/lib/utils/MediasoupRemoteTrackResolver.d.ts +25 -0
  156. package/lib/utils/MediasoupRemoteTrackResolver.d.ts.map +1 -0
  157. package/lib/utils/MediasoupRemoteTrackResolver.js +110 -0
  158. package/lib/utils/RemoteTrackResolver.d.ts +7 -0
  159. package/lib/utils/RemoteTrackResolver.d.ts.map +1 -0
  160. package/lib/utils/RemoteTrackResolver.js +2 -0
  161. package/package.json +4 -4
  162. package/src/ObservedCall.ts +243 -161
  163. package/src/ObservedCallEventMonitor.ts +402 -0
  164. package/src/ObservedCallSummary.ts +22 -0
  165. package/src/ObservedCertificate.ts +43 -0
  166. package/src/ObservedClient.ts +715 -1003
  167. package/src/ObservedClientEventMonitor.ts +309 -0
  168. package/src/ObservedClientSummary.ts +24 -0
  169. package/src/ObservedCodec.ts +49 -0
  170. package/src/ObservedDataChannel.ts +71 -181
  171. package/src/ObservedIceCandidate.ts +64 -0
  172. package/src/ObservedIceCandidatePair.ts +134 -0
  173. package/src/ObservedIceTransport.ts +99 -0
  174. package/src/ObservedInboundRtp.ts +205 -0
  175. package/src/ObservedInboundTrack.ts +105 -0
  176. package/src/ObservedMediaPlayout.ts +49 -0
  177. package/src/ObservedMediaSource.ts +60 -0
  178. package/src/ObservedOutboundRtp.ts +156 -0
  179. package/src/ObservedOutboundTrack.ts +82 -0
  180. package/src/ObservedPeerConnection.ts +933 -402
  181. package/src/ObservedPeerConnectionTransport.ts +38 -0
  182. package/src/ObservedRemoteInboundRtp.ts +64 -0
  183. package/src/ObservedRemoteOutboundRtp.ts +65 -0
  184. package/src/ObservedTURN.ts +86 -0
  185. package/src/ObservedTurnServer.ts +72 -0
  186. package/src/Observer.ts +183 -298
  187. package/src/ObserverEventMonitor.ts +561 -0
  188. package/src/ObserverSummary.ts +15 -0
  189. package/src/Reports.ts +87 -0
  190. package/src/common/Middleware.ts +70 -42
  191. package/src/common/logger.ts +60 -69
  192. package/src/common/types.ts +0 -42
  193. package/src/common/utils.ts +24 -2
  194. package/src/detectors/Detector.ts +6 -0
  195. package/src/detectors/Detectors.ts +38 -0
  196. package/src/index.ts +30 -91
  197. package/src/mediasoup/ObservedMediaRouter.ts +10 -0
  198. package/src/monitors/TurnUsageMonitor.ts +164 -164
  199. package/src/schema/ClientEventTypes.ts +280 -0
  200. package/src/schema/ClientMetaTypes.ts +41 -0
  201. package/src/schema/ClientSample.ts +1682 -0
  202. package/src/scores/CalculatedScore.ts +6 -0
  203. package/src/scores/DefaultCallScoreCalculator.ts +23 -0
  204. package/src/scores/ScoreCalculator.ts +3 -0
  205. package/src/updaters/CallUpdater.ts +5 -0
  206. package/src/updaters/ObserverUpdater.ts +5 -0
  207. package/src/updaters/OnAllCallObserverUpdater.ts +59 -0
  208. package/src/updaters/OnAllClientCallUpdater.ts +61 -0
  209. package/src/updaters/OnAnyCallObserverUpdater.ts +41 -0
  210. package/src/updaters/OnAnyClientCallUpdater.ts +39 -0
  211. package/src/updaters/OnIntervalUpdater.ts +19 -0
  212. package/src/updaters/Updater.ts +5 -0
  213. package/src/utils/MediasoupRemoteTrackResolver.ts +155 -0
  214. package/src/utils/RemoteTrackResolver.ts +12 -0
  215. package/tsconfig.json +3 -3
  216. package/lib/ObservedICE.d.ts +0 -64
  217. package/lib/ObservedICE.d.ts.map +0 -1
  218. package/lib/ObservedICE.js +0 -141
  219. package/lib/ObservedInboundAudioTrack.d.ts +0 -96
  220. package/lib/ObservedInboundAudioTrack.d.ts.map +0 -1
  221. package/lib/ObservedInboundAudioTrack.js +0 -217
  222. package/lib/ObservedInboundVideoTrack.d.ts +0 -101
  223. package/lib/ObservedInboundVideoTrack.d.ts.map +0 -1
  224. package/lib/ObservedInboundVideoTrack.js +0 -232
  225. package/lib/ObservedOutboundAudioTrack.d.ts +0 -87
  226. package/lib/ObservedOutboundAudioTrack.d.ts.map +0 -1
  227. package/lib/ObservedOutboundAudioTrack.js +0 -186
  228. package/lib/ObservedOutboundVideoTrack.d.ts +0 -91
  229. package/lib/ObservedOutboundVideoTrack.d.ts.map +0 -1
  230. package/lib/ObservedOutboundVideoTrack.js +0 -193
  231. package/lib/ObservedSfu.d.ts +0 -59
  232. package/lib/ObservedSfu.d.ts.map +0 -1
  233. package/lib/ObservedSfu.js +0 -157
  234. package/lib/ObservedSfuInboundRtpPad.d.ts +0 -42
  235. package/lib/ObservedSfuInboundRtpPad.d.ts.map +0 -1
  236. package/lib/ObservedSfuInboundRtpPad.js +0 -71
  237. package/lib/ObservedSfuOutboundRtpPad.d.ts +0 -42
  238. package/lib/ObservedSfuOutboundRtpPad.d.ts.map +0 -1
  239. package/lib/ObservedSfuOutboundRtpPad.js +0 -72
  240. package/lib/ObservedSfuSctpChannel.d.ts +0 -42
  241. package/lib/ObservedSfuSctpChannel.d.ts.map +0 -1
  242. package/lib/ObservedSfuSctpChannel.js +0 -57
  243. package/lib/ObservedSfuTransport.d.ts +0 -58
  244. package/lib/ObservedSfuTransport.d.ts.map +0 -1
  245. package/lib/ObservedSfuTransport.js +0 -120
  246. package/lib/RemoteTrackAssigner.d.ts +0 -14
  247. package/lib/RemoteTrackAssigner.d.ts.map +0 -1
  248. package/lib/RemoteTrackAssigner.js +0 -52
  249. package/lib/ReportsCollector.d.ts +0 -109
  250. package/lib/ReportsCollector.d.ts.map +0 -1
  251. package/lib/ReportsCollector.js +0 -207
  252. package/lib/common/CalculatedScore.d.ts +0 -80
  253. package/lib/common/CalculatedScore.d.ts.map +0 -1
  254. package/lib/common/CalculatedScore.js +0 -162
  255. package/lib/common/CallEventType.d.ts +0 -63
  256. package/lib/common/CallEventType.d.ts.map +0 -1
  257. package/lib/common/CallEventType.js +0 -39
  258. package/lib/common/CallMetaReports.d.ts +0 -42
  259. package/lib/common/CallMetaReports.d.ts.map +0 -1
  260. package/lib/common/CallMetaReports.js +0 -36
  261. package/lib/common/QualityScoreUtils.d.ts +0 -1
  262. package/lib/common/QualityScoreUtils.d.ts.map +0 -1
  263. package/lib/common/QualityScoreUtils.js +0 -1
  264. package/lib/common/TypedEventEmitter.d.ts +0 -22
  265. package/lib/common/TypedEventEmitter.d.ts.map +0 -1
  266. package/lib/common/TypedEventEmitter.js +0 -11
  267. package/lib/common/callEventReports.d.ts +0 -10
  268. package/lib/common/callEventReports.d.ts.map +0 -1
  269. package/lib/common/callEventReports.js +0 -112
  270. package/lib/monitors/CallSummary.d.ts +0 -37
  271. package/lib/monitors/CallSummary.d.ts.map +0 -1
  272. package/lib/monitors/CallSummaryMonitor.d.ts +0 -32
  273. package/lib/monitors/CallSummaryMonitor.d.ts.map +0 -1
  274. package/lib/monitors/CallSummaryMonitor.js +0 -152
  275. package/lib/monitors/ClientIssueMonitor.d.ts +0 -32
  276. package/lib/monitors/ClientIssueMonitor.d.ts.map +0 -1
  277. package/lib/monitors/ClientIssueMonitor.js +0 -49
  278. package/lib/monitors/SfuServerMonitor.d.ts +0 -79
  279. package/lib/monitors/SfuServerMonitor.d.ts.map +0 -1
  280. package/lib/monitors/SfuServerMonitor.js +0 -198
  281. package/src/ObservedICE.ts +0 -237
  282. package/src/ObservedInboundAudioTrack.ts +0 -344
  283. package/src/ObservedInboundVideoTrack.ts +0 -361
  284. package/src/ObservedOutboundAudioTrack.ts +0 -307
  285. package/src/ObservedOutboundVideoTrack.ts +0 -319
  286. package/src/ObservedSfu.ts +0 -231
  287. package/src/ObservedSfuInboundRtpPad.ts +0 -106
  288. package/src/ObservedSfuOutboundRtpPad.ts +0 -107
  289. package/src/ObservedSfuSctpChannel.ts +0 -103
  290. package/src/ObservedSfuTransport.ts +0 -185
  291. package/src/RemoteTrackAssigner.ts +0 -68
  292. package/src/ReportsCollector.ts +0 -336
  293. package/src/common/CalculatedScore.ts +0 -188
  294. package/src/common/CallEventType.ts +0 -69
  295. package/src/common/CallMetaReports.ts +0 -82
  296. package/src/common/QualityScoreUtils.ts +0 -0
  297. package/src/common/TypedEventEmitter.ts +0 -32
  298. package/src/common/callEventReports.ts +0 -178
  299. package/src/monitors/CallSummary.ts +0 -38
  300. package/src/monitors/CallSummaryMonitor.ts +0 -192
  301. package/src/monitors/ClientIssueMonitor.ts +0 -88
  302. package/src/monitors/SfuServerMonitor.ts +0 -285
  303. /package/lib/{monitors/CallSummary.js → ObservedCallSummary.js} +0 -0
@@ -1,120 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ObservedSfuTransport = void 0;
4
- const events_1 = require("events");
5
- const ObservedSfuInboundRtpPad_1 = require("./ObservedSfuInboundRtpPad");
6
- const ObservedSfuOutboundRtpPad_1 = require("./ObservedSfuOutboundRtpPad");
7
- const ObservedSfuSctpChannel_1 = require("./ObservedSfuSctpChannel");
8
- class ObservedSfuTransport extends events_1.EventEmitter {
9
- constructor(_model, sfu) {
10
- super();
11
- this._model = _model;
12
- this.sfu = sfu;
13
- this.created = Date.now();
14
- this._updated = Date.now();
15
- this._closed = false;
16
- this._inboundRtpPads = new Map();
17
- this._outboundRtpPads = new Map();
18
- this._sctpChannels = new Map();
19
- this.setMaxListeners(Infinity);
20
- }
21
- get inboundRtpPads() {
22
- return this._inboundRtpPads;
23
- }
24
- get outboundRtpPads() {
25
- return this._outboundRtpPads;
26
- }
27
- get sctpChannels() {
28
- return this._sctpChannels;
29
- }
30
- get serviceId() {
31
- return this.sfu.serviceId;
32
- }
33
- get mediaUnitId() {
34
- return this.sfu.mediaUnitId;
35
- }
36
- get sfuId() {
37
- return this.sfu.sfuId;
38
- }
39
- get sfuTransportId() {
40
- return this._model.sfuTransportId;
41
- }
42
- get reports() {
43
- return this.sfu.reports;
44
- }
45
- get updated() {
46
- return this._updated;
47
- }
48
- get marker() {
49
- return this._marker;
50
- }
51
- set marker(value) {
52
- this._marker = value;
53
- this._inboundRtpPads.forEach((pad) => (pad.marker = value));
54
- this._outboundRtpPads.forEach((pad) => (pad.marker = value));
55
- this._sctpChannels.forEach((channel) => (channel.marker = value));
56
- }
57
- get closed() {
58
- return this._closed;
59
- }
60
- close() {
61
- if (this._closed)
62
- return;
63
- this._closed = true;
64
- [...this._inboundRtpPads.values()].forEach((pad) => pad.close());
65
- [...this._outboundRtpPads.values()].forEach((pad) => pad.close());
66
- [...this._sctpChannels.values()].forEach((channel) => channel.close());
67
- this.emit('close');
68
- }
69
- update(sample, timestamp) {
70
- const now = Date.now();
71
- const elapsedTimeInMs = now - this._updated;
72
- const report = Object.assign(Object.assign({ serviceId: this.serviceId, mediaUnitId: this.mediaUnitId, sfuId: this.sfuId, callId: undefined, roomId: undefined }, sample), { timestamp, marker: this.marker });
73
- this.reports.addSfuTransportReport(report);
74
- this.stats = sample;
75
- this._updated = now;
76
- this.emit('update', {
77
- elapsedTimeInMs,
78
- });
79
- }
80
- createSfuOutboundRtpPad(model) {
81
- if (this._closed)
82
- throw new Error('Cannot create SfuOutboundRtpPad on closed SfuTransport');
83
- if (this._inboundRtpPads.has(model.sfuOutboundRtpPadId))
84
- throw new Error(`SfuOutboundRtpPad with id ${model.sfuOutboundRtpPadId} already exists`);
85
- const result = new ObservedSfuOutboundRtpPad_1.ObservedSfuOutboundRtpPad(model, this);
86
- result.once('close', () => {
87
- this._outboundRtpPads.delete(model.sfuOutboundRtpPadId);
88
- });
89
- this._outboundRtpPads.set(model.sfuOutboundRtpPadId, result);
90
- this.emit('newsfuoutboundrtppad', result);
91
- return result;
92
- }
93
- createSfuInboundRtpPad(model) {
94
- if (this._closed)
95
- throw new Error('Cannot create SfuInboundRtpPad on closed SfuTransport');
96
- if (this._inboundRtpPads.has(model.sfuInboundRtpPadId))
97
- throw new Error(`SfuInboundRtpPad with id ${model.sfuInboundRtpPadId} already exists`);
98
- const result = new ObservedSfuInboundRtpPad_1.ObservedSfuInboundRtpPad(model, this);
99
- result.once('close', () => {
100
- this._inboundRtpPads.delete(model.sfuInboundRtpPadId);
101
- });
102
- this._inboundRtpPads.set(model.sfuInboundRtpPadId, result);
103
- this.emit('newsfuinboundrtppad', result);
104
- return result;
105
- }
106
- createSfuSctpChannel(model) {
107
- if (this._closed)
108
- throw new Error('Cannot create SfuSctpChannel on closed SfuTransport');
109
- if (this._sctpChannels.has(model.sfuSctpChannelId))
110
- throw new Error(`SfuSctpChannel with id ${model.sfuSctpChannelId} already exists`);
111
- const result = new ObservedSfuSctpChannel_1.ObservedSfuSctpChannel(model, this);
112
- result.once('close', () => {
113
- this._sctpChannels.delete(model.sfuSctpChannelId);
114
- });
115
- this._sctpChannels.set(model.sfuSctpChannelId, result);
116
- this.emit('newsfusctpchannel', result);
117
- return result;
118
- }
119
- }
120
- exports.ObservedSfuTransport = ObservedSfuTransport;
@@ -1,14 +0,0 @@
1
- import { ObservedInboundAudioTrack } from './ObservedInboundAudioTrack';
2
- import { ObservedInboundVideoTrack } from './ObservedInboundVideoTrack';
3
- import { ObservedOutboundAudioTrack } from './ObservedOutboundAudioTrack';
4
- import { ObservedOutboundVideoTrack } from './ObservedOutboundVideoTrack';
5
- export declare class RemoteTrackAssigner {
6
- readonly sfuStreamIdToOutboundVideoTracks: Map<string, ObservedOutboundVideoTrack>;
7
- readonly sfuStreamIdToOutboundAudioTracks: Map<string, ObservedOutboundAudioTrack>;
8
- readonly pendingInboundVideoTracks: Map<string, ObservedInboundVideoTrack[]>;
9
- readonly pendingInboundAudioTracks: Map<string, ObservedInboundAudioTrack[]>;
10
- addOutboundAudioTrack(track: ObservedOutboundAudioTrack): void;
11
- addOutboundVideoTrack(track: ObservedOutboundVideoTrack): void;
12
- addInboundAudioTrack(track: ObservedInboundAudioTrack): void;
13
- }
14
- //# sourceMappingURL=RemoteTrackAssigner.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RemoteTrackAssigner.d.ts","sourceRoot":"","sources":["../src/RemoteTrackAssigner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE1E,qBAAa,mBAAmB;IAC/B,SAAgB,gCAAgC,0CAAiD;IACjG,SAAgB,gCAAgC,0CAAiD;IACjG,SAAgB,yBAAyB,2CAAkD;IAC3F,SAAgB,yBAAyB,2CAAkD;IAEpF,qBAAqB,CAAC,KAAK,EAAE,0BAA0B;IAcvD,qBAAqB,CAAC,KAAK,EAAE,0BAA0B;IAcvD,oBAAoB,CAAC,KAAK,EAAE,yBAAyB;CA4B5D"}
@@ -1,52 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RemoteTrackAssigner = void 0;
4
- class RemoteTrackAssigner {
5
- constructor() {
6
- this.sfuStreamIdToOutboundVideoTracks = new Map();
7
- this.sfuStreamIdToOutboundAudioTracks = new Map();
8
- this.pendingInboundVideoTracks = new Map();
9
- this.pendingInboundAudioTracks = new Map();
10
- }
11
- addOutboundAudioTrack(track) {
12
- const untilSfuStreamIdListener = () => {
13
- if (!track.sfuStreamId)
14
- return;
15
- this.sfuStreamIdToOutboundAudioTracks.set(track.sfuStreamId, track);
16
- track.off('update', untilSfuStreamIdListener);
17
- // we need to assign to the pending inbound tracks
18
- };
19
- track.on('update', untilSfuStreamIdListener);
20
- untilSfuStreamIdListener();
21
- }
22
- addOutboundVideoTrack(track) {
23
- const untilSfuStreamIdListener = () => {
24
- if (!track.sfuStreamId)
25
- return;
26
- this.sfuStreamIdToOutboundVideoTracks.set(track.sfuStreamId, track);
27
- track.off('update', untilSfuStreamIdListener);
28
- // we need to assign to the pending inbound tracks
29
- };
30
- track.on('update', untilSfuStreamIdListener);
31
- untilSfuStreamIdListener();
32
- }
33
- addInboundAudioTrack(track) {
34
- const untilSfuStreamIdListener = () => {
35
- if (!track.sfuStreamId)
36
- return;
37
- const outboundTrack = this.sfuStreamIdToOutboundAudioTracks.get(track.sfuStreamId);
38
- if (!outboundTrack) {
39
- this.pendingInboundAudioTracks.set(track.sfuStreamId, (this.pendingInboundAudioTracks.get(track.sfuStreamId) || []).concat(track));
40
- return;
41
- }
42
- if (outboundTrack) {
43
- track.remoteOutboundTrack = outboundTrack;
44
- }
45
- else {
46
- this.pendingInboundAudioTracks.set(track.sfuStreamId, (this.pendingInboundAudioTracks.get(track.sfuStreamId) || []).concat(track));
47
- }
48
- };
49
- track.on('update', untilSfuStreamIdListener);
50
- }
51
- }
52
- exports.RemoteTrackAssigner = RemoteTrackAssigner;
@@ -1,109 +0,0 @@
1
- import { CallEventReport, CallMetaReport, ClientDataChannelReport, ClientExtensionReport, IceCandidatePairReport, InboundAudioTrackReport, InboundVideoTrackReport, ObserverEventReport, OutboundAudioTrackReport, OutboundVideoTrackReport, PeerConnectionTransportReport, SfuEventReport, SfuExtensionReport, SfuInboundRtpPadReport, SfuMetaReport, SfuOutboundRtpPadReport, SfuSctpStreamReport, SFUTransportReport } from '@observertc/report-schemas-js';
2
- import { ObserverSinkContext } from './common/types';
3
- export type SinkEventsMap = {
4
- 'call-event': {
5
- reports: CallEventReport[];
6
- };
7
- 'call-meta': {
8
- reports: CallMetaReport[];
9
- };
10
- 'client-data-channel': {
11
- reports: ClientDataChannelReport[];
12
- };
13
- 'client-extension': {
14
- reports: ClientExtensionReport[];
15
- };
16
- 'ice-candidate-pair': {
17
- reports: IceCandidatePairReport[];
18
- };
19
- 'peer-connection-transport': {
20
- reports: PeerConnectionTransportReport[];
21
- };
22
- 'inbound-audio-track': {
23
- reports: InboundAudioTrackReport[];
24
- };
25
- 'inbound-video-track': {
26
- reports: InboundVideoTrackReport[];
27
- };
28
- 'observer-event': {
29
- reports: ObserverEventReport[];
30
- };
31
- 'outbound-audio-track': {
32
- reports: OutboundAudioTrackReport[];
33
- };
34
- 'outbound-video-track': {
35
- reports: OutboundVideoTrackReport[];
36
- };
37
- 'sfu-event': {
38
- reports: SfuEventReport[];
39
- };
40
- 'sfu-extension': {
41
- reports: SfuExtensionReport[];
42
- };
43
- 'sfu-inbound-rtp-pad': {
44
- reports: SfuInboundRtpPadReport[];
45
- };
46
- 'sfu-outbound-rtp-pad': {
47
- reports: SfuOutboundRtpPadReport[];
48
- };
49
- 'sfu-sctp-stream': {
50
- reports: SfuSctpStreamReport[];
51
- };
52
- 'sfu-transport': {
53
- reports: SFUTransportReport[];
54
- };
55
- 'sfu-meta': {
56
- reports: SfuMetaReport[];
57
- };
58
- 'reports': ObserverSinkContext;
59
- 'newreport': number;
60
- };
61
- export type ObserverSinkProcess = (observerSinkContext: ObserverSinkContext) => Promise<void>;
62
- export declare class ReportsCollector {
63
- private _collectedReports;
64
- private _emitter;
65
- private _callEventReports;
66
- private _callMetaReports;
67
- private _clientDataChannelReports;
68
- private _clientExtensionReports;
69
- private _iceCandidatePairReports;
70
- private _inboundAudioTrackReports;
71
- private _inboundVideoTrackReports;
72
- private _peerConnectionTransportReports;
73
- private _observerEventReports;
74
- private _outboundAudioTrackReports;
75
- private _outboundVideoTrackReports;
76
- private _sfuEventReports;
77
- private _sfuExtensionReports;
78
- private _sfuInboundRtpPadReports;
79
- private _sfuOutboundRtpPadReports;
80
- private _sfuSctpStreamReports;
81
- private _sfuTransportReports;
82
- private _sfuMetaReports;
83
- constructor();
84
- on<K extends keyof SinkEventsMap>(event: K, listener: (reports: SinkEventsMap[K]) => void): this;
85
- off<K extends keyof SinkEventsMap>(event: K, listener: (reports: SinkEventsMap[K]) => void): this;
86
- once<K extends keyof SinkEventsMap>(event: K, listener: (reports: SinkEventsMap[K]) => void): this;
87
- addCallEventReport(report: CallEventReport): void;
88
- addCallMetaReport(report: CallMetaReport): void;
89
- addClientDataChannelReport(report: ClientDataChannelReport): void;
90
- addClientExtensionReport(report: ClientExtensionReport): void;
91
- addIceCandidatePairReport(report: IceCandidatePairReport): void;
92
- addInboundAudioTrackReport(report: InboundAudioTrackReport): void;
93
- addInboundVideoTrackReport(report: InboundVideoTrackReport): void;
94
- addPeerConnectionTransportReports(report: PeerConnectionTransportReport): void;
95
- addObserverEventReport(report: ObserverEventReport): void;
96
- addOutboundAudioTrackReport(report: OutboundAudioTrackReport): void;
97
- addOutboundVideoTrackReport(report: OutboundVideoTrackReport): void;
98
- addSfuEventReport(report: SfuEventReport): void;
99
- addSfuExtensionReport(report: SfuExtensionReport): void;
100
- addSfuInboundRtpPadReport(report: SfuInboundRtpPadReport): void;
101
- addSfuOutboundRtpPadReport(report: SfuOutboundRtpPadReport): void;
102
- addSfuSctpStreamReport(report: SfuSctpStreamReport): void;
103
- addSfuTransportReport(report: SFUTransportReport): void;
104
- addSfuMetaReport(report: SfuMetaReport): void;
105
- emit(): number;
106
- private _emit;
107
- private _createObserverSinkContext;
108
- }
109
- //# sourceMappingURL=ReportsCollector.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReportsCollector.d.ts","sourceRoot":"","sources":["../src/ReportsCollector.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,EACxB,6BAA6B,EAC7B,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,aAAa,EACb,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,MAAM,+BAA+B,C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a,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,IAAI;IAMjG,IAAI,CAAC,CAAC,SAAS,MAAM,aAAa,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,IAAI;IAMlG,kBAAkB,CAAC,MAAM,EAAE,eAAe;IAK1C,iBAAiB,CAAC,MAAM,EAAE,cAAc;IAKxC,0BAA0B,CAAC,MAAM,EAAE,uBAAuB;IAK1D,wBAAwB,CAAC,MAAM,EAAE,qBAAqB;IAKtD,yBAAyB,CAAC,MAAM,EAAE,sBAAsB;IAKxD,0BAA0B,CAAC,MAAM,EAAE,uBAAuB;IAK1D,0BAA0B,CAAC,MAAM,EAAE,uBAAuB;IAK1D,iCAAiC,CAAC,MAAM,EAAE,6BAA6B;IAKvE,sBAAsB,CAAC,MAAM,EAAE,mBAAmB;IAKlD,2BAA2B,CAAC,MAAM,EAAE,wBAAwB;IAK5D,2BAA2B,CAAC,MAAM,EAAE,wBAAwB;IAK5D,iBAAiB,CAAC,MAAM,EAAE,cAAc;IAKxC,qBAAqB,CAAC,MAAM,EAAE,kBAAkB;IAKhD,yBAAyB,CAAC,MAAM,EAAE,sBAAsB;IAKxD,0BAA0B,CAAC,MAAM,EAAE,uBAAuB;IAK1D,sBAAsB,CAAC,MAAM,EAAE,mBAAmB;IAKlD,qBAAqB,CAAC,MAAM,EAAE,kBAAkB;IAKhD,gBAAgB,CAAC,MAAM,EAAE,aAAa;IAKtC,IAAI,IAAI,MAAM;IAwErB,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,0BAA0B;CAyClC"}
@@ -1,207 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ReportsCollector = void 0;
4
- const events_1 = require("events");
5
- class ReportsCollector {
6
- constructor() {
7
- this._collectedReports = 0;
8
- this._emitter = new events_1.EventEmitter();
9
- this._callEventReports = [];
10
- this._callMetaReports = [];
11
- this._clientDataChannelReports = [];
12
- this._clientExtensionReports = [];
13
- this._iceCandidatePairReports = [];
14
- this._inboundAudioTrackReports = [];
15
- this._inboundVideoTrackReports = [];
16
- this._peerConnectionTransportReports = [];
17
- this._observerEventReports = [];
18
- this._outboundAudioTrackReports = [];
19
- this._outboundVideoTrackReports = [];
20
- this._sfuEventReports = [];
21
- this._sfuExtensionReports = [];
22
- this._sfuInboundRtpPadReports = [];
23
- this._sfuOutboundRtpPadReports = [];
24
- this._sfuSctpStreamReports = [];
25
- this._sfuTransportReports = [];
26
- this._sfuMetaReports = [];
27
- // empty
28
- }
29
- on(event, listener) {
30
- this._emitter.addListener(event, listener);
31
- return this;
32
- }
33
- off(event, listener) {
34
- this._emitter.removeListener(event, listener);
35
- return this;
36
- }
37
- once(event, listener) {
38
- this._emitter.once(event, listener);
39
- return this;
40
- }
41
- addCallEventReport(report) {
42
- this._callEventReports.push(report);
43
- this._emit('newreport', ++this._collectedReports);
44
- }
45
- addCallMetaReport(report) {
46
- this._callMetaReports.push(report);
47
- this._emit('newreport', ++this._collectedReports);
48
- }
49
- addClientDataChannelReport(report) {
50
- this._clientDataChannelReports.push(report);
51
- this._emit('newreport', ++this._collectedReports);
52
- }
53
- addClientExtensionReport(report) {
54
- this._clientExtensionReports.push(report);
55
- this._emit('newreport', ++this._collectedReports);
56
- }
57
- addIceCandidatePairReport(report) {
58
- this._iceCandidatePairReports.push(report);
59
- this._emit('newreport', ++this._collectedReports);
60
- }
61
- addInboundAudioTrackReport(report) {
62
- this._inboundAudioTrackReports.push(report);
63
- this._emit('newreport', ++this._collectedReports);
64
- }
65
- addInboundVideoTrackReport(report) {
66
- this._inboundVideoTrackReports.push(report);
67
- this._emit('newreport', ++this._collectedReports);
68
- }
69
- addPeerConnectionTransportReports(report) {
70
- this._peerConnectionTransportReports.push(report);
71
- this._emit('newreport', ++this._collectedReports);
72
- }
73
- addObserverEventReport(report) {
74
- this._observerEventReports.push(report);
75
- this._emit('newreport', ++this._collectedReports);
76
- }
77
- addOutboundAudioTrackReport(report) {
78
- this._outboundAudioTrackReports.push(report);
79
- this._emit('newreport', ++this._collectedReports);
80
- }
81
- addOutboundVideoTrackReport(report) {
82
- this._outboundVideoTrackReports.push(report);
83
- this._emit('newreport', ++this._collectedReports);
84
- }
85
- addSfuEventReport(report) {
86
- this._sfuEventReports.push(report);
87
- this._emit('newreport', ++this._collectedReports);
88
- }
89
- addSfuExtensionReport(report) {
90
- this._sfuExtensionReports.push(report);
91
- this._emit('newreport', ++this._collectedReports);
92
- }
93
- addSfuInboundRtpPadReport(report) {
94
- this._sfuInboundRtpPadReports.push(report);
95
- this._emit('newreport', ++this._collectedReports);
96
- }
97
- addSfuOutboundRtpPadReport(report) {
98
- this._sfuOutboundRtpPadReports.push(report);
99
- this._emit('newreport', ++this._collectedReports);
100
- }
101
- addSfuSctpStreamReport(report) {
102
- this._sfuSctpStreamReports.push(report);
103
- this._emit('newreport', ++this._collectedReports);
104
- }
105
- addSfuTransportReport(report) {
106
- this._sfuTransportReports.push(report);
107
- this._emit('newreport', ++this._collectedReports);
108
- }
109
- addSfuMetaReport(report) {
110
- this._sfuMetaReports.push(report);
111
- this._emit('newreport', ++this._collectedReports);
112
- }
113
- emit() {
114
- let result = 0;
115
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
116
- const checkAndEmit = (eventName, reports) => {
117
- if (0 < reports.length) {
118
- this._emit(eventName, { reports });
119
- result += reports.length;
120
- }
121
- };
122
- const context = this._createObserverSinkContext();
123
- checkAndEmit('call-event', this._callEventReports);
124
- this._callEventReports = [];
125
- checkAndEmit('call-meta', this._callMetaReports);
126
- this._callMetaReports = [];
127
- checkAndEmit('client-data-channel', this._clientDataChannelReports);
128
- this._clientDataChannelReports = [];
129
- checkAndEmit('client-extension', this._clientExtensionReports);
130
- this._clientExtensionReports = [];
131
- checkAndEmit('ice-candidate-pair', this._iceCandidatePairReports);
132
- this._iceCandidatePairReports = [];
133
- checkAndEmit('inbound-audio-track', this._inboundAudioTrackReports);
134
- this._inboundAudioTrackReports = [];
135
- checkAndEmit('inbound-video-track', this._inboundVideoTrackReports);
136
- this._inboundVideoTrackReports = [];
137
- checkAndEmit('peer-connection-transport', this._peerConnectionTransportReports);
138
- this._peerConnectionTransportReports = [];
139
- checkAndEmit('observer-event', this._observerEventReports);
140
- this._observerEventReports = [];
141
- checkAndEmit('outbound-audio-track', this._outboundAudioTrackReports);
142
- this._outboundAudioTrackReports = [];
143
- checkAndEmit('outbound-video-track', this._outboundVideoTrackReports);
144
- this._outboundVideoTrackReports = [];
145
- checkAndEmit('sfu-event', this._sfuEventReports);
146
- this._sfuEventReports = [];
147
- checkAndEmit('sfu-extension', this._sfuExtensionReports);
148
- this._sfuExtensionReports = [];
149
- checkAndEmit('sfu-inbound-rtp-pad', this._sfuInboundRtpPadReports);
150
- this._sfuInboundRtpPadReports = [];
151
- checkAndEmit('sfu-outbound-rtp-pad', this._sfuOutboundRtpPadReports);
152
- this._sfuOutboundRtpPadReports = [];
153
- checkAndEmit('sfu-sctp-stream', this._sfuSctpStreamReports);
154
- this._sfuSctpStreamReports = [];
155
- checkAndEmit('sfu-transport', this._sfuTransportReports);
156
- this._sfuTransportReports = [];
157
- checkAndEmit('sfu-meta', this._sfuMetaReports);
158
- this._sfuMetaReports = [];
159
- this._emit('reports', context);
160
- this._collectedReports = 0;
161
- return result;
162
- }
163
- _emit(event, reports) {
164
- return this._emitter.emit(event, reports);
165
- }
166
- _createObserverSinkContext() {
167
- const callEventReports = [...this._callEventReports];
168
- const callMetaReports = [...this._callMetaReports];
169
- const clientDataChannelReports = [...this._clientDataChannelReports];
170
- const clientExtensionReports = [...this._clientExtensionReports];
171
- const iceCandidatePairReports = [...this._iceCandidatePairReports];
172
- const inboundAudioTrackReports = [...this._inboundAudioTrackReports];
173
- const inboundVideoTrackReports = [...this._inboundVideoTrackReports];
174
- const peerConnectionTransportReports = [...this._peerConnectionTransportReports];
175
- const observerEventReports = [...this._observerEventReports];
176
- const outboundAudioTrackReports = [...this._outboundAudioTrackReports];
177
- const outboundVideoTrackReports = [...this._outboundVideoTrackReports];
178
- const sfuEventReports = [...this._sfuEventReports];
179
- const sfuExtensionReports = [...this._sfuExtensionReports];
180
- const sfuInboundRtpPadReports = [...this._sfuInboundRtpPadReports];
181
- const sfuOutboundRtpPadReports = [...this._sfuOutboundRtpPadReports];
182
- const sfuSctpStreamReports = [...this._sfuSctpStreamReports];
183
- const sfuTransportReports = [...this._sfuTransportReports];
184
- const sfuMetaReports = [...this._sfuMetaReports];
185
- return {
186
- callEventReports,
187
- callMetaReports,
188
- clientDataChannelReports,
189
- clientExtensionReports,
190
- iceCandidatePairReports,
191
- inboundAudioTrackReports,
192
- inboundVideoTrackReports,
193
- peerConnectionTransportReports,
194
- observerEventReports,
195
- outboundAudioTrackReports,
196
- outboundVideoTrackReports,
197
- sfuEventReports,
198
- sfuExtensionReports,
199
- sfuInboundRtpPadReports,
200
- sfuOutboundRtpPadReports,
201
- sfuSctpStreamReports,
202
- sfuTransportReports,
203
- sfuMetaReports,
204
- };
205
- }
206
- }
207
- exports.ReportsCollector = ReportsCollector;
@@ -1,80 +0,0 @@
1
- import { ClientIssue } from '../monitors/CallSummary';
2
- import { ObservedInboundVideoTrack } from '../ObservedInboundVideoTrack';
3
- import { ObservedInboundAudioTrack } from '../ObservedInboundAudioTrack';
4
- import { ObservedOutboundVideoTrack } from '../ObservedOutboundVideoTrack';
5
- import { ObservedOutboundAudioTrack } from '../ObservedOutboundAudioTrack';
6
- export type CalculationRemark = {
7
- severity: 'none' | 'minor' | 'major' | 'critical';
8
- text: string;
9
- };
10
- export type CalculatedScore = {
11
- score: number;
12
- timestamp: number;
13
- remarks: CalculationRemark[];
14
- debugText?: string;
15
- };
16
- export declare const BPP_RANGES: {
17
- lowmotion: {
18
- h264: {
19
- low: number;
20
- high: number;
21
- };
22
- h265: {
23
- low: number;
24
- high: number;
25
- };
26
- vp8: {
27
- low: number;
28
- high: number;
29
- };
30
- vp9: {
31
- low: number;
32
- high: number;
33
- };
34
- };
35
- standard: {
36
- h264: {
37
- low: number;
38
- high: number;
39
- };
40
- h265: {
41
- low: number;
42
- high: number;
43
- };
44
- vp8: {
45
- low: number;
46
- high: number;
47
- };
48
- vp9: {
49
- low: number;
50
- high: number;
51
- };
52
- };
53
- highmotion: {
54
- h264: {
55
- low: number;
56
- high: number;
57
- };
58
- h265: {
59
- low: number;
60
- high: number;
61
- };
62
- vp8: {
63
- low: number;
64
- high: number;
65
- };
66
- vp9: {
67
- low: number;
68
- high: number;
69
- };
70
- };
71
- };
72
- export declare function calculateBaseVideoScore(track: ObservedInboundVideoTrack | ObservedOutboundVideoTrack, newIssues: ClientIssue[]): CalculatedScore | undefined;
73
- export declare function calculateBaseAudioScore(track: ObservedInboundAudioTrack | ObservedOutboundAudioTrack, newIssues: ClientIssue[]): CalculatedScore | undefined;
74
- export declare function calculateLatencyMOS({ avgJitter, rttInMs, packetsLoss }: {
75
- avgJitter: number;
76
- rttInMs: number;
77
- packetsLoss: number;
78
- }): number;
79
- export declare function getRttScore(x: number): number;
80
- //# sourceMappingURL=CalculatedScore.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CalculatedScore.d.ts","sourceRoot":"","sources":["../../src/common/CalculatedScore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAE3E,MAAM,MAAM,iBAAiB,GAAG;IAC/B,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,UAAU,CAAC;IAClD,IAAI,EAAE,MAAM,CAAC;CACb,CAAA;AAED,MAAM,MAAM,eAAe,GA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