@observertc/observer-js 0.9.27-beta → 0.30.0-beta

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 (298) hide show
  1. package/lib/ObservedCall.d.ts +54 -0
  2. package/lib/ObservedCall.d.ts.map +1 -0
  3. package/lib/ObservedCall.js +166 -0
  4. package/lib/ObservedClient.d.ts +73 -0
  5. package/lib/ObservedClient.d.ts.map +1 -0
  6. package/lib/ObservedClient.js +487 -0
  7. package/lib/ObservedInboundTrack.d.ts +65 -0
  8. package/lib/ObservedInboundTrack.d.ts.map +1 -0
  9. package/lib/ObservedInboundTrack.js +192 -0
  10. package/lib/ObservedOutboundTrack.d.ts +55 -0
  11. package/lib/ObservedOutboundTrack.d.ts.map +1 -0
  12. package/lib/ObservedOutboundTrack.js +166 -0
  13. package/lib/ObservedPeerConnection.d.ts +57 -0
  14. package/lib/ObservedPeerConnection.d.ts.map +1 -0
  15. package/lib/ObservedPeerConnection.js +217 -0
  16. package/lib/Observer.d.ts +26 -1465
  17. package/lib/Observer.d.ts.map +1 -1
  18. package/lib/Observer.js +53 -605
  19. package/lib/{sinks/ObserverSink.d.ts → ReportsCollector.d.ts} +7 -23
  20. package/lib/ReportsCollector.d.ts.map +1 -0
  21. package/lib/{sinks/ObserverSink.js → ReportsCollector.js} +27 -85
  22. package/lib/common/ReportsCollector.d.ts +21 -24
  23. package/lib/common/ReportsCollector.d.ts.map +1 -1
  24. package/lib/common/ReportsCollector.js +24 -0
  25. package/lib/common/SingleExecutor.d.ts +3 -0
  26. package/lib/common/SingleExecutor.d.ts.map +1 -0
  27. package/lib/common/SingleExecutor.js +31 -0
  28. package/lib/common/TypedEventEmitter.d.ts +22 -0
  29. package/lib/common/TypedEventEmitter.d.ts.map +1 -0
  30. package/lib/common/TypedEventEmitter.js +11 -0
  31. package/lib/common/callEventReports.d.ts.map +1 -0
  32. package/lib/common/logger.d.ts +3 -9
  33. package/lib/common/logger.d.ts.map +1 -1
  34. package/lib/common/logger.js +58 -141
  35. package/lib/common/types.d.ts +2 -14
  36. package/lib/common/types.d.ts.map +1 -1
  37. package/lib/common/utils.d.ts +1 -0
  38. package/lib/common/utils.d.ts.map +1 -1
  39. package/lib/common/utils.js +6 -1
  40. package/lib/index.d.ts +8 -19
  41. package/lib/index.d.ts.map +1 -1
  42. package/lib/index.js +7 -2
  43. package/package.json +1 -1
  44. package/src/ObservedCall.ts +201 -0
  45. package/src/ObservedClient.ts +681 -0
  46. package/src/ObservedInboundTrack.ts +238 -0
  47. package/src/ObservedOutboundTrack.ts +205 -0
  48. package/src/ObservedPeerConnection.ts +249 -0
  49. package/src/Observer.ts +86 -442
  50. package/src/{sinks/ObserverSink.ts → ReportsCollector.ts} +29 -94
  51. package/src/common/ReportsCollector.ts +48 -23
  52. package/src/common/SingleExecutor.ts +36 -0
  53. package/src/common/TypedEventEmitter.ts +32 -0
  54. package/src/common/logger.ts +58 -161
  55. package/src/common/types.ts +4 -24
  56. package/src/common/utils.ts +6 -0
  57. package/src/index.ts +12 -23
  58. package/lib/Evaluator.d.ts +0 -43
  59. package/lib/Evaluator.d.ts.map +0 -1
  60. package/lib/Evaluator.js +0 -171
  61. package/lib/common/Semaphore.d.ts +0 -31
  62. package/lib/common/Semaphore.d.ts.map +0 -1
  63. package/lib/common/Semaphore.js +0 -16
  64. package/lib/entries/CallEntry.d.ts +0 -619
  65. package/lib/entries/CallEntry.d.ts.map +0 -1
  66. package/lib/entries/CallEntry.js +0 -75
  67. package/lib/entries/ClientEntry.d.ts +0 -478
  68. package/lib/entries/ClientEntry.d.ts.map +0 -1
  69. package/lib/entries/ClientEntry.js +0 -114
  70. package/lib/entries/InboundTrackEntry.d.ts +0 -682
  71. package/lib/entries/InboundTrackEntry.d.ts.map +0 -1
  72. package/lib/entries/InboundTrackEntry.js +0 -76
  73. package/lib/entries/OutboundTrackEntry.d.ts +0 -682
  74. package/lib/entries/OutboundTrackEntry.d.ts.map +0 -1
  75. package/lib/entries/OutboundTrackEntry.js +0 -73
  76. package/lib/entries/PeerConnectionEntry.d.ts +0 -505
  77. package/lib/entries/PeerConnectionEntry.d.ts.map +0 -1
  78. package/lib/entries/PeerConnectionEntry.js +0 -144
  79. package/lib/entries/SfuEntry.d.ts +0 -150
  80. package/lib/entries/SfuEntry.d.ts.map +0 -1
  81. package/lib/entries/SfuEntry.js +0 -77
  82. package/lib/entries/SfuInboundRtpPadEntry.d.ts +0 -14
  83. package/lib/entries/SfuInboundRtpPadEntry.d.ts.map +0 -1
  84. package/lib/entries/SfuInboundRtpPadEntry.js +0 -49
  85. package/lib/entries/SfuOutboundRtpPadEntry.d.ts +0 -14
  86. package/lib/entries/SfuOutboundRtpPadEntry.d.ts.map +0 -1
  87. package/lib/entries/SfuOutboundRtpPadEntry.js +0 -47
  88. package/lib/entries/SfuSctpChannelEntry.d.ts +0 -12
  89. package/lib/entries/SfuSctpChannelEntry.d.ts.map +0 -1
  90. package/lib/entries/SfuSctpChannelEntry.js +0 -43
  91. package/lib/entries/SfuTransportEntry.d.ts +0 -82
  92. package/lib/entries/SfuTransportEntry.d.ts.map +0 -1
  93. package/lib/entries/SfuTransportEntry.js +0 -122
  94. package/lib/evaluators/SetClientsCoordinateEvaluator.d.ts +0 -9
  95. package/lib/evaluators/SetClientsCoordinateEvaluator.d.ts.map +0 -1
  96. package/lib/evaluators/SetClientsCoordinateEvaluator.js +0 -95
  97. package/lib/middlewares/CallOperationsContext.d.ts +0 -18
  98. package/lib/middlewares/CallOperationsContext.d.ts.map +0 -1
  99. package/lib/middlewares/CallOperationsContext.js +0 -27
  100. package/lib/middlewares/CallProcessor.d.ts +0 -6
  101. package/lib/middlewares/CallProcessor.d.ts.map +0 -1
  102. package/lib/middlewares/CallProcessor.js +0 -36
  103. package/lib/middlewares/CommitTransactionMiddleware.d.ts +0 -6
  104. package/lib/middlewares/CommitTransactionMiddleware.d.ts.map +0 -1
  105. package/lib/middlewares/CommitTransactionMiddleware.js +0 -179
  106. package/lib/middlewares/DeleteOutdatedCallEntries.d.ts +0 -6
  107. package/lib/middlewares/DeleteOutdatedCallEntries.d.ts.map +0 -1
  108. package/lib/middlewares/DeleteOutdatedCallEntries.js +0 -121
  109. package/lib/middlewares/DeleteOutdatedSfuEntries.d.ts +0 -6
  110. package/lib/middlewares/DeleteOutdatedSfuEntries.d.ts.map +0 -1
  111. package/lib/middlewares/DeleteOutdatedSfuEntries.js +0 -127
  112. package/lib/middlewares/Middleware.d.ts +0 -3
  113. package/lib/middlewares/Middleware.d.ts.map +0 -1
  114. package/lib/middlewares/Middleware.js +0 -21
  115. package/lib/middlewares/Processor.d.ts +0 -9
  116. package/lib/middlewares/Processor.d.ts.map +0 -1
  117. package/lib/middlewares/Processor.js +0 -54
  118. package/lib/middlewares/TransactionContext.d.ts +0 -35
  119. package/lib/middlewares/TransactionContext.d.ts.map +0 -1
  120. package/lib/middlewares/TransactionContext.js +0 -90
  121. package/lib/middlewares/TransactoinProcessor.d.ts +0 -6
  122. package/lib/middlewares/TransactoinProcessor.d.ts.map +0 -1
  123. package/lib/middlewares/TransactoinProcessor.js +0 -17
  124. package/lib/middlewares/VisitObservedCallsMiddleware.d.ts +0 -7
  125. package/lib/middlewares/VisitObservedCallsMiddleware.d.ts.map +0 -1
  126. package/lib/middlewares/VisitObservedCallsMiddleware.js +0 -96
  127. package/lib/middlewares/VisitObservedSfusMiddleware.d.ts +0 -6
  128. package/lib/middlewares/VisitObservedSfusMiddleware.d.ts.map +0 -1
  129. package/lib/middlewares/VisitObservedSfusMiddleware.js +0 -151
  130. package/lib/middlewares/visitors/visitClient.d.ts +0 -5
  131. package/lib/middlewares/visitors/visitClient.d.ts.map +0 -1
  132. package/lib/middlewares/visitors/visitClient.js +0 -174
  133. package/lib/middlewares/visitors/visitInboundAudioTrack.d.ts +0 -5
  134. package/lib/middlewares/visitors/visitInboundAudioTrack.d.ts.map +0 -1
  135. package/lib/middlewares/visitors/visitInboundAudioTrack.js +0 -93
  136. package/lib/middlewares/visitors/visitInboundVideoTrack.d.ts +0 -5
  137. package/lib/middlewares/visitors/visitInboundVideoTrack.d.ts.map +0 -1
  138. package/lib/middlewares/visitors/visitInboundVideoTrack.js +0 -94
  139. package/lib/middlewares/visitors/visitOutboundAudioTrack.d.ts +0 -5
  140. package/lib/middlewares/visitors/visitOutboundAudioTrack.d.ts.map +0 -1
  141. package/lib/middlewares/visitors/visitOutboundAudioTrack.js +0 -90
  142. package/lib/middlewares/visitors/visitOutboundVideoTarck.d.ts +0 -5
  143. package/lib/middlewares/visitors/visitOutboundVideoTarck.d.ts.map +0 -1
  144. package/lib/middlewares/visitors/visitOutboundVideoTarck.js +0 -90
  145. package/lib/middlewares/visitors/visitPeerConnection.d.ts +0 -5
  146. package/lib/middlewares/visitors/visitPeerConnection.d.ts.map +0 -1
  147. package/lib/middlewares/visitors/visitPeerConnection.js +0 -111
  148. package/lib/middlewares/visitors/visitSfu.d.ts +0 -5
  149. package/lib/middlewares/visitors/visitSfu.d.ts.map +0 -1
  150. package/lib/middlewares/visitors/visitSfu.js +0 -78
  151. package/lib/middlewares/visitors/visitSfuInboundRtpPad.d.ts +0 -5
  152. package/lib/middlewares/visitors/visitSfuInboundRtpPad.d.ts.map +0 -1
  153. package/lib/middlewares/visitors/visitSfuInboundRtpPad.js +0 -56
  154. package/lib/middlewares/visitors/visitSfuOutboundRtpPad.d.ts +0 -5
  155. package/lib/middlewares/visitors/visitSfuOutboundRtpPad.d.ts.map +0 -1
  156. package/lib/middlewares/visitors/visitSfuOutboundRtpPad.js +0 -56
  157. package/lib/middlewares/visitors/visitSfuSctpChannel.d.ts +0 -5
  158. package/lib/middlewares/visitors/visitSfuSctpChannel.d.ts.map +0 -1
  159. package/lib/middlewares/visitors/visitSfuSctpChannel.js +0 -55
  160. package/lib/middlewares/visitors/visitSfuTransport.d.ts +0 -5
  161. package/lib/middlewares/visitors/visitSfuTransport.d.ts.map +0 -1
  162. package/lib/middlewares/visitors/visitSfuTransport.js +0 -56
  163. package/lib/processes/closePeerConnectionProcess.d.ts +0 -10
  164. package/lib/processes/closePeerConnectionProcess.d.ts.map +0 -1
  165. package/lib/processes/closePeerConnectionProcess.js +0 -51
  166. package/lib/processes/detachClientProcess.d.ts +0 -14
  167. package/lib/processes/detachClientProcess.d.ts.map +0 -1
  168. package/lib/processes/detachClientProcess.js +0 -106
  169. package/lib/processes/findRemoteMatches.d.ts +0 -9
  170. package/lib/processes/findRemoteMatches.d.ts.map +0 -1
  171. package/lib/processes/findRemoteMatches.js +0 -96
  172. package/lib/processes/inboundTrackRemoved.d.ts +0 -9
  173. package/lib/processes/inboundTrackRemoved.d.ts.map +0 -1
  174. package/lib/processes/inboundTrackRemoved.js +0 -22
  175. package/lib/processes/joinClientProcess.d.ts +0 -11
  176. package/lib/processes/joinClientProcess.d.ts.map +0 -1
  177. package/lib/processes/joinClientProcess.js +0 -120
  178. package/lib/processes/outboundTrackRemoved.d.ts +0 -9
  179. package/lib/processes/outboundTrackRemoved.d.ts.map +0 -1
  180. package/lib/processes/outboundTrackRemoved.js +0 -22
  181. package/lib/samples/ObservedCall.d.ts +0 -17
  182. package/lib/samples/ObservedCall.d.ts.map +0 -1
  183. package/lib/samples/ObservedCall.js +0 -29
  184. package/lib/samples/ObservedCalls.d.ts +0 -19
  185. package/lib/samples/ObservedCalls.d.ts.map +0 -1
  186. package/lib/samples/ObservedCalls.js +0 -113
  187. package/lib/samples/ObservedClient.d.ts +0 -28
  188. package/lib/samples/ObservedClient.d.ts.map +0 -1
  189. package/lib/samples/ObservedClient.js +0 -110
  190. package/lib/samples/ObservedInboundAudioTrack.d.ts +0 -17
  191. package/lib/samples/ObservedInboundAudioTrack.d.ts.map +0 -1
  192. package/lib/samples/ObservedInboundAudioTrack.js +0 -17
  193. package/lib/samples/ObservedInboundVideoTrack.d.ts +0 -17
  194. package/lib/samples/ObservedInboundVideoTrack.d.ts.map +0 -1
  195. package/lib/samples/ObservedInboundVideoTrack.js +0 -17
  196. package/lib/samples/ObservedOutboundAudioTrack.d.ts +0 -16
  197. package/lib/samples/ObservedOutboundAudioTrack.d.ts.map +0 -1
  198. package/lib/samples/ObservedOutboundAudioTrack.js +0 -17
  199. package/lib/samples/ObservedOutboundVideoTrack.d.ts +0 -16
  200. package/lib/samples/ObservedOutboundVideoTrack.d.ts.map +0 -1
  201. package/lib/samples/ObservedOutboundVideoTrack.js +0 -17
  202. package/lib/samples/ObservedPeerConnection.d.ts +0 -47
  203. package/lib/samples/ObservedPeerConnection.d.ts.map +0 -1
  204. package/lib/samples/ObservedPeerConnection.js +0 -130
  205. package/lib/samples/ObservedSfu.d.ts +0 -27
  206. package/lib/samples/ObservedSfu.d.ts.map +0 -1
  207. package/lib/samples/ObservedSfu.js +0 -65
  208. package/lib/samples/ObservedSfuInboundRtpPad.d.ts +0 -15
  209. package/lib/samples/ObservedSfuInboundRtpPad.d.ts.map +0 -1
  210. package/lib/samples/ObservedSfuInboundRtpPad.js +0 -17
  211. package/lib/samples/ObservedSfuOutboundRtpPad.d.ts +0 -15
  212. package/lib/samples/ObservedSfuOutboundRtpPad.d.ts.map +0 -1
  213. package/lib/samples/ObservedSfuOutboundRtpPad.js +0 -17
  214. package/lib/samples/ObservedSfuSctpChannel.d.ts +0 -15
  215. package/lib/samples/ObservedSfuSctpChannel.d.ts.map +0 -1
  216. package/lib/samples/ObservedSfuSctpChannel.js +0 -17
  217. package/lib/samples/ObservedSfuTransport.d.ts +0 -30
  218. package/lib/samples/ObservedSfuTransport.d.ts.map +0 -1
  219. package/lib/samples/ObservedSfuTransport.js +0 -86
  220. package/lib/samples/ObservedSfus.d.ts +0 -16
  221. package/lib/samples/ObservedSfus.d.ts.map +0 -1
  222. package/lib/samples/ObservedSfus.js +0 -72
  223. package/lib/sinks/ObserverSink.d.ts.map +0 -1
  224. package/lib/sinks/callEventReports.d.ts.map +0 -1
  225. package/lib/sources/ObservedCallSource.d.ts +0 -18
  226. package/lib/sources/ObservedCallSource.d.ts.map +0 -1
  227. package/lib/sources/ObservedCallSource.js +0 -2
  228. package/lib/sources/ObservedClientSource.d.ts +0 -19
  229. package/lib/sources/ObservedClientSource.d.ts.map +0 -1
  230. package/lib/sources/ObservedClientSource.js +0 -2
  231. package/lib/sources/ObservedSfuSource.d.ts +0 -15
  232. package/lib/sources/ObservedSfuSource.d.ts.map +0 -1
  233. package/lib/sources/ObservedSfuSource.js +0 -2
  234. package/lib/sources/Sources.d.ts +0 -49
  235. package/lib/sources/Sources.d.ts.map +0 -1
  236. package/lib/sources/Sources.js +0 -213
  237. package/src/Evaluator.ts +0 -229
  238. package/src/common/Semaphore.ts +0 -45
  239. package/src/entries/CallEntry.ts +0 -62
  240. package/src/entries/ClientEntry.ts +0 -106
  241. package/src/entries/InboundTrackEntry.ts +0 -74
  242. package/src/entries/OutboundTrackEntry.ts +0 -72
  243. package/src/entries/PeerConnectionEntry.ts +0 -133
  244. package/src/entries/SfuEntry.ts +0 -62
  245. package/src/entries/SfuInboundRtpPadEntry.ts +0 -46
  246. package/src/entries/SfuOutboundRtpPadEntry.ts +0 -44
  247. package/src/entries/SfuSctpChannelEntry.ts +0 -39
  248. package/src/entries/SfuTransportEntry.ts +0 -109
  249. package/src/evaluators/SetClientsCoordinateEvaluator.ts +0 -78
  250. package/src/middlewares/CallOperationsContext.ts +0 -56
  251. package/src/middlewares/CallProcessor.ts +0 -38
  252. package/src/middlewares/CommitTransactionMiddleware.ts +0 -328
  253. package/src/middlewares/DeleteOutdatedCallEntries.ts +0 -159
  254. package/src/middlewares/DeleteOutdatedSfuEntries.ts +0 -168
  255. package/src/middlewares/Middleware.ts +0 -10
  256. package/src/middlewares/Processor.ts +0 -59
  257. package/src/middlewares/TransactionContext.ts +0 -176
  258. package/src/middlewares/TransactoinProcessor.ts +0 -28
  259. package/src/middlewares/VisitObservedCallsMiddleware.ts +0 -172
  260. package/src/middlewares/VisitObservedSfusMiddleware.ts +0 -203
  261. package/src/middlewares/visitors/visitClient.ts +0 -239
  262. package/src/middlewares/visitors/visitInboundAudioTrack.ts +0 -113
  263. package/src/middlewares/visitors/visitInboundVideoTrack.ts +0 -117
  264. package/src/middlewares/visitors/visitOutboundAudioTrack.ts +0 -100
  265. package/src/middlewares/visitors/visitOutboundVideoTarck.ts +0 -102
  266. package/src/middlewares/visitors/visitPeerConnection.ts +0 -151
  267. package/src/middlewares/visitors/visitSfu.ts +0 -70
  268. package/src/middlewares/visitors/visitSfuInboundRtpPad.ts +0 -52
  269. package/src/middlewares/visitors/visitSfuOutboundRtpPad.ts +0 -53
  270. package/src/middlewares/visitors/visitSfuSctpChannel.ts +0 -50
  271. package/src/middlewares/visitors/visitSfuTransport.ts +0 -50
  272. package/src/processes/closePeerConnectionProcess.ts +0 -54
  273. package/src/processes/detachClientProcess.ts +0 -136
  274. package/src/processes/findRemoteMatches.ts +0 -104
  275. package/src/processes/inboundTrackRemoved.ts +0 -22
  276. package/src/processes/joinClientProcess.ts +0 -138
  277. package/src/processes/outboundTrackRemoved.ts +0 -22
  278. package/src/samples/ObservedCall.ts +0 -49
  279. package/src/samples/ObservedCalls.ts +0 -143
  280. package/src/samples/ObservedClient.ts +0 -172
  281. package/src/samples/ObservedInboundAudioTrack.ts +0 -35
  282. package/src/samples/ObservedInboundVideoTrack.ts +0 -36
  283. package/src/samples/ObservedOutboundAudioTrack.ts +0 -35
  284. package/src/samples/ObservedOutboundVideoTrack.ts +0 -35
  285. package/src/samples/ObservedPeerConnection.ts +0 -227
  286. package/src/samples/ObservedSfu.ts +0 -115
  287. package/src/samples/ObservedSfuInboundRtpPad.ts +0 -35
  288. package/src/samples/ObservedSfuOutboundRtpPad.ts +0 -35
  289. package/src/samples/ObservedSfuSctpChannel.ts +0 -35
  290. package/src/samples/ObservedSfuTransport.ts +0 -142
  291. package/src/samples/ObservedSfus.ts +0 -95
  292. package/src/sources/ObservedCallSource.ts +0 -26
  293. package/src/sources/ObservedClientSource.ts +0 -28
  294. package/src/sources/ObservedSfuSource.ts +0 -19
  295. package/src/sources/Sources.ts +0 -301
  296. /package/lib/{sinks → common}/callEventReports.d.ts +0 -0
  297. /package/lib/{sinks → common}/callEventReports.js +0 -0
  298. /package/src/{sinks → common}/callEventReports.ts +0 -0
@@ -1,6 +0,0 @@
1
- import { Middleware } from './Middleware';
2
- import { TransactionContext } from './TransactionContext';
3
- import { ReportsCollector } from '../common/ReportsCollector';
4
- export declare const logger: import("../common/logger").WrappedLogger;
5
- export declare function createVisitObservedSfusMiddleware(reports: ReportsCollector, fetchSamples: boolean): Middleware<TransactionContext>;
6
- //# sourceMappingURL=VisitObservedSfusMiddleware.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"VisitObservedSfusMiddleware.d.ts","sourceRoot":"","sources":["../../src/middlewares/VisitObservedSfusMiddleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAQ9D,eAAO,MAAM,MAAM,0CAA+C,CAAC;AAEnE,wBAAgB,iCAAiC,CAChD,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,OAAO,GACnB,UAAU,CAAC,kBAAkB,CAAC,CA2LhC"}
@@ -1,151 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.createVisitObservedSfusMiddleware = exports.logger = void 0;
13
- const logger_1 = require("../common/logger");
14
- const visitSfu_1 = require("./visitors/visitSfu");
15
- const visitSfuTransport_1 = require("./visitors/visitSfuTransport");
16
- const visitSfuInboundRtpPad_1 = require("./visitors/visitSfuInboundRtpPad");
17
- const visitSfuOutboundRtpPad_1 = require("./visitors/visitSfuOutboundRtpPad");
18
- const visitSfuSctpChannel_1 = require("./visitors/visitSfuSctpChannel");
19
- exports.logger = (0, logger_1.createLogger)('VisitObservedCallsMiddleware');
20
- function createVisitObservedSfusMiddleware(reports, fetchSamples) {
21
- const process = (transaction) => {
22
- const { observedSfus, updatedSfus, deletedSfus, updatedSfuTransports, deletedSfuTransports, updatedSfuInboundRtpPads, deletedSfuInboundRtpPads, updatedSfuOutboundRtpPads, deletedSfuOutboundRtpPads, updatedSfuSctpChannels, deletedSfuSctpChannels } = transaction;
23
- const visitedSfuIds = new Set();
24
- const visitedSfuTransportIds = new Set();
25
- const visitedSfuInboundRtpPadIds = new Set();
26
- const visitedSfuOutboundRtpPadIds = new Set();
27
- const visitedSfuSctpChannels = new Set();
28
- for (const observedSfu of observedSfus.observedSfus()) {
29
- const { sfuId } = observedSfu;
30
- (0, visitSfu_1.visitSfu)(observedSfu, updatedSfus, reports, fetchSamples);
31
- visitedSfuIds.add(sfuId);
32
- const storedSfu = updatedSfus.get(sfuId);
33
- if (!storedSfu) {
34
- continue;
35
- }
36
- for (const observedSfuTransport of observedSfu.observedSfuTransports()) {
37
- const { transportId } = observedSfuTransport;
38
- (0, visitSfuTransport_1.visitSfuTransport)(observedSfuTransport, storedSfu, updatedSfuTransports, reports, fetchSamples);
39
- visitedSfuTransportIds.add(transportId);
40
- const storedSfuTransport = updatedSfuTransports.get(transportId);
41
- if (!storedSfuTransport) {
42
- continue;
43
- }
44
- for (const sfuInboundRtpPad of observedSfuTransport.inboundRtpPads()) {
45
- (0, visitSfuInboundRtpPad_1.visitSfuInboundRtpPad)(sfuInboundRtpPad, storedSfuTransport, updatedSfuInboundRtpPads, reports, fetchSamples);
46
- visitedSfuInboundRtpPadIds.add(sfuInboundRtpPad.padId);
47
- }
48
- for (const sfuOutboundRtpPad of observedSfuTransport.outboundRtpPads()) {
49
- (0, visitSfuOutboundRtpPad_1.visitSfuOutboundRtpPad)(sfuOutboundRtpPad, storedSfuTransport, updatedSfuOutboundRtpPads, reports, fetchSamples);
50
- visitedSfuInboundRtpPadIds.add(sfuOutboundRtpPad.padId);
51
- }
52
- for (const sfuSctpChannel of observedSfuTransport.sfuSctpChannels()) {
53
- (0, visitSfuSctpChannel_1.visitSfuSctpChannel)(sfuSctpChannel, storedSfuTransport, updatedSfuSctpChannels, reports, fetchSamples);
54
- visitedSfuSctpChannels.add(sfuSctpChannel.channelId);
55
- }
56
- }
57
- }
58
- for (const [sfuId, sfu] of Array.from(updatedSfus.entries())) {
59
- if (visitedSfuIds.has(sfuId)) {
60
- continue;
61
- }
62
- deletedSfus.add(sfuId);
63
- if (sfu.serviceId && sfu.mediaUnitId) {
64
- reports.addSfuEventReport({
65
- serviceId: sfu.serviceId,
66
- mediaUnitId: sfu.mediaUnitId,
67
- name: 'SFU_LEFT',
68
- sfuId,
69
- timestamp: Date.now(),
70
- marker: sfu.marker,
71
- message: 'SFU is detached',
72
- });
73
- }
74
- }
75
- for (const [sfuTransportId, sfuTransport] of Array.from(updatedSfuTransports.entries())) {
76
- if (visitedSfuTransportIds.has(sfuTransportId)) {
77
- continue;
78
- }
79
- // delete PeerConnection
80
- const { serviceId, sfuId, transportId } = sfuTransport;
81
- if (!serviceId || !sfuId || !transportId) {
82
- continue;
83
- }
84
- const storedSfu = updatedSfus.get(sfuId);
85
- updatedSfuTransports.delete(transportId);
86
- deletedSfuTransports.add(transportId);
87
- // also update the peer connection model
88
- if (storedSfu) {
89
- storedSfu.sfuTransportIds = storedSfu.sfuTransportIds.filter((tId) => tId !== transportId);
90
- }
91
- }
92
- for (const [padId, sfuInboundRtpPad] of Array.from(updatedSfuInboundRtpPads.entries())) {
93
- if (visitedSfuInboundRtpPadIds.has(padId)) {
94
- continue;
95
- }
96
- // delete Sfu Inbound Rtp Pad
97
- const { serviceId, rtpPadId, sfuTransportId } = sfuInboundRtpPad;
98
- if (!serviceId || !sfuTransportId || !rtpPadId) {
99
- continue;
100
- }
101
- const storedSfuTransport = updatedSfuTransports.get(sfuTransportId);
102
- updatedSfuInboundRtpPads.delete(rtpPadId);
103
- deletedSfuInboundRtpPads.add(rtpPadId);
104
- // also update the sfu transport model
105
- if (storedSfuTransport) {
106
- storedSfuTransport.inboundRtpPadIds = storedSfuTransport.inboundRtpPadIds.filter((tId) => tId !== rtpPadId);
107
- }
108
- }
109
- for (const [padId, sfuOutboundRtpPad] of Array.from(updatedSfuOutboundRtpPads.entries())) {
110
- if (visitedSfuOutboundRtpPadIds.has(padId)) {
111
- continue;
112
- }
113
- // delete Sfu Outbound Rtp Pad
114
- const { serviceId, rtpPadId, sfuTransportId } = sfuOutboundRtpPad;
115
- if (!serviceId || !sfuTransportId || !rtpPadId) {
116
- continue;
117
- }
118
- const storedSfuTransport = updatedSfuTransports.get(sfuTransportId);
119
- updatedSfuOutboundRtpPads.delete(rtpPadId);
120
- deletedSfuOutboundRtpPads.add(rtpPadId);
121
- // also update the sfu transport model
122
- if (storedSfuTransport) {
123
- storedSfuTransport.outboundRtpPadIds = storedSfuTransport.outboundRtpPadIds.filter((tId) => tId !== rtpPadId);
124
- }
125
- }
126
- for (const [channelId, sfuSctpChannel] of Array.from(updatedSfuSctpChannels.entries())) {
127
- if (visitedSfuSctpChannels.has(channelId)) {
128
- continue;
129
- }
130
- // delete Sfu Outbound Rtp Pad
131
- const { serviceId, sfuSctpChannelId, sfuTransportId } = sfuSctpChannel;
132
- if (!serviceId || !sfuTransportId || !sfuSctpChannelId) {
133
- continue;
134
- }
135
- const storedSfuTransport = updatedSfuTransports.get(sfuTransportId);
136
- updatedSfuSctpChannels.delete(sfuSctpChannelId);
137
- deletedSfuSctpChannels.add(sfuSctpChannelId);
138
- // also update the sfu transport model
139
- if (storedSfuTransport) {
140
- storedSfuTransport.sctpChannelIds = storedSfuTransport.sctpChannelIds.filter((tId) => tId !== sfuSctpChannelId);
141
- }
142
- }
143
- };
144
- const result = (context, next) => __awaiter(this, void 0, void 0, function* () {
145
- yield process(context);
146
- if (next)
147
- yield next(context);
148
- });
149
- return result;
150
- }
151
- exports.createVisitObservedSfusMiddleware = createVisitObservedSfusMiddleware;
@@ -1,5 +0,0 @@
1
- import { ObservedClient } from '../../samples/ObservedClient';
2
- import * as Models from '../../models/Models';
3
- import { ReportsCollector } from '../../common/ReportsCollector';
4
- export declare function visitClient(observedClient: ObservedClient, client: Models.Client, reports: ReportsCollector, fetchSamples: boolean): void;
5
- //# sourceMappingURL=visitClient.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"visitClient.d.ts","sourceRoot":"","sources":["../../../src/middlewares/visitors/visitClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AASjE,wBAAgB,WAAW,CAC1B,cAAc,EAAE,cAAc,EAC9B,MAAM,EAAE,MAAM,CAAC,MAAM,EACrB,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,OAAO,QA8NrB"}
@@ -1,174 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.visitClient = void 0;
4
- const callMetaReports_1 = require("../../common/callMetaReports");
5
- const samples_pb_1 = require("../../models/samples_pb");
6
- function visitClient(observedClient, client, reports, fetchSamples) {
7
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
8
- const { mediaUnitId, clientId, userId } = observedClient;
9
- const { callId, serviceId, roomId } = observedClient.call;
10
- for (const clientSample of observedClient.samples()) {
11
- if (clientSample.os && (((_a = client.operationSystem) === null || _a === void 0 ? void 0 : _a.name) !== clientSample.os.name ||
12
- ((_b = client.operationSystem) === null || _b === void 0 ? void 0 : _b.version) !== clientSample.os.version ||
13
- ((_c = client.operationSystem) === null || _c === void 0 ? void 0 : _c.versionName) !== clientSample.os.versionName)) {
14
- if (fetchSamples) {
15
- client.operationSystem = new samples_pb_1.Samples_ClientSample_OperationSystem(Object.assign({}, clientSample.os));
16
- }
17
- const callMetaReport = (0, callMetaReports_1.createCallMetaReport)(serviceId, mediaUnitId, roomId, callId, clientId, {
18
- type: callMetaReports_1.CallMetaType.OPERATION_SYSTEM,
19
- payload: clientSample.os,
20
- }, userId);
21
- reports.addCallMetaReport(callMetaReport);
22
- }
23
- if (clientSample.engine && (((_d = client.engine) === null || _d === void 0 ? void 0 : _d.name) !== clientSample.engine.name ||
24
- ((_e = client.engine) === null || _e === void 0 ? void 0 : _e.version) !== clientSample.engine.version)) {
25
- if (fetchSamples) {
26
- client.engine = new samples_pb_1.Samples_ClientSample_Engine(Object.assign({}, clientSample.engine));
27
- }
28
- const callMetaReport = (0, callMetaReports_1.createCallMetaReport)(serviceId, mediaUnitId, roomId, callId, clientId, {
29
- type: callMetaReports_1.CallMetaType.ENGINE,
30
- payload: clientSample.engine,
31
- }, userId);
32
- reports.addCallMetaReport(callMetaReport);
33
- }
34
- if (clientSample.platform && (((_f = client.platform) === null || _f === void 0 ? void 0 : _f.model) !== clientSample.platform.model ||
35
- ((_g = client.platform) === null || _g === void 0 ? void 0 : _g.type) !== clientSample.platform.type ||
36
- ((_h = client.platform) === null || _h === void 0 ? void 0 : _h.vendor) !== clientSample.platform.vendor)) {
37
- if (fetchSamples) {
38
- client.platform = new samples_pb_1.Samples_ClientSample_Platform(Object.assign({}, clientSample.platform));
39
- }
40
- const callMetaReport = (0, callMetaReports_1.createCallMetaReport)(serviceId, mediaUnitId, roomId, callId, clientId, {
41
- type: callMetaReports_1.CallMetaType.PLATFORM,
42
- payload: clientSample.platform,
43
- }, userId);
44
- reports.addCallMetaReport(callMetaReport);
45
- }
46
- if (clientSample.browser && (((_j = client.browser) === null || _j === void 0 ? void 0 : _j.name) !== clientSample.browser.name ||
47
- ((_k = client.browser) === null || _k === void 0 ? void 0 : _k.version) !== clientSample.browser.version)) {
48
- if (fetchSamples) {
49
- client.browser = new samples_pb_1.Samples_ClientSample_Browser(Object.assign({}, clientSample.browser));
50
- }
51
- const callMetaReport = (0, callMetaReports_1.createCallMetaReport)(serviceId, mediaUnitId, roomId, callId, clientId, {
52
- type: callMetaReports_1.CallMetaType.BROWSER,
53
- payload: clientSample.browser,
54
- }, userId);
55
- reports.addCallMetaReport(callMetaReport);
56
- }
57
- if (clientSample.mediaConstraints && 0 < clientSample.mediaConstraints.length) {
58
- for (const mediaConstraint of clientSample.mediaConstraints) {
59
- const callMetaReport = (0, callMetaReports_1.createCallMetaReport)(serviceId, mediaUnitId, roomId, callId, clientId, {
60
- type: callMetaReports_1.CallMetaType.MEDIA_CONSTRAINT,
61
- payload: mediaConstraint,
62
- }, userId);
63
- reports.addCallMetaReport(callMetaReport);
64
- }
65
- }
66
- if (clientSample.localSDPs && 0 < clientSample.localSDPs.length) {
67
- for (const localSDP of clientSample.localSDPs) {
68
- const callMetaReport = (0, callMetaReports_1.createCallMetaReport)(serviceId, mediaUnitId, roomId, callId, clientId, {
69
- type: callMetaReports_1.CallMetaType.LOCAL_SDP,
70
- payload: localSDP,
71
- }, userId);
72
- reports.addCallMetaReport(callMetaReport);
73
- }
74
- }
75
- if (clientSample.extensionStats && 0 < clientSample.extensionStats.length) {
76
- for (const extensionStats of clientSample.extensionStats) {
77
- reports.addClientExtensionReport({
78
- serviceId,
79
- mediaUnitId,
80
- roomId,
81
- callId,
82
- clientId,
83
- userId,
84
- timestamp: Date.now(),
85
- payload: extensionStats.payload,
86
- extensionType: extensionStats.type,
87
- });
88
- }
89
- }
90
- if (clientSample.customCallEvents && 0 < clientSample.customCallEvents.length) {
91
- for (const callEvent of clientSample.customCallEvents) {
92
- reports.addCallEventReport(Object.assign(Object.assign({ serviceId,
93
- mediaUnitId,
94
- roomId,
95
- callId,
96
- clientId,
97
- userId }, callEvent), { timestamp: (_l = callEvent.timestamp) !== null && _l !== void 0 ? _l : Date.now() }));
98
- }
99
- }
100
- if (clientSample.userMediaErrors && 0 < clientSample.userMediaErrors.length) {
101
- for (const userMediaError of clientSample.userMediaErrors) {
102
- const callMetaReport = (0, callMetaReports_1.createCallMetaReport)(serviceId, mediaUnitId, roomId, callId, clientId, {
103
- type: callMetaReports_1.CallMetaType.USER_MEDIA_ERROR,
104
- payload: userMediaError,
105
- }, userId);
106
- reports.addCallMetaReport(callMetaReport);
107
- }
108
- }
109
- if (clientSample.certificates && 0 < clientSample.certificates.length) {
110
- for (const certificate of clientSample.certificates) {
111
- const callMetaReport = (0, callMetaReports_1.createCallMetaReport)(serviceId, mediaUnitId, roomId, callId, clientId, {
112
- type: callMetaReports_1.CallMetaType.CERTIFICATE,
113
- payload: certificate,
114
- }, userId);
115
- reports.addCallMetaReport(callMetaReport);
116
- }
117
- }
118
- if (clientSample.codecs && 0 < clientSample.codecs.length) {
119
- for (const codec of clientSample.codecs) {
120
- const callMetaReport = (0, callMetaReports_1.createCallMetaReport)(serviceId, mediaUnitId, roomId, callId, clientId, {
121
- type: callMetaReports_1.CallMetaType.CODEC,
122
- payload: codec,
123
- }, userId);
124
- reports.addCallMetaReport(callMetaReport);
125
- }
126
- }
127
- if (clientSample.iceServers && 0 < clientSample.iceServers.length) {
128
- for (const iceServer of clientSample.iceServers) {
129
- const callMetaReport = (0, callMetaReports_1.createCallMetaReport)(serviceId, mediaUnitId, roomId, callId, clientId, {
130
- type: callMetaReports_1.CallMetaType.ICE_SERVER,
131
- payload: iceServer,
132
- }, userId);
133
- reports.addCallMetaReport(callMetaReport);
134
- }
135
- }
136
- if (clientSample.mediaDevices && 0 < clientSample.mediaDevices.length) {
137
- for (const mediaDevice of clientSample.mediaDevices) {
138
- const callMetaReport = (0, callMetaReports_1.createCallMetaReport)(serviceId, mediaUnitId, roomId, callId, clientId, {
139
- type: callMetaReports_1.CallMetaType.MEDIA_DEVICE,
140
- payload: mediaDevice,
141
- }, userId);
142
- reports.addCallMetaReport(callMetaReport);
143
- }
144
- }
145
- if (clientSample.mediaSources && 0 < clientSample.mediaSources.length) {
146
- for (const mediaSource of clientSample.mediaSources) {
147
- const callMetaReport = (0, callMetaReports_1.createCallMetaReport)(serviceId, mediaUnitId, roomId, callId, clientId, {
148
- type: callMetaReports_1.CallMetaType.MEDIA_SOURCE,
149
- payload: mediaSource,
150
- }, userId);
151
- reports.addCallMetaReport(callMetaReport);
152
- }
153
- }
154
- if (clientSample.iceLocalCandidates && 0 < clientSample.iceLocalCandidates.length) {
155
- for (const iceLocalCandidate of clientSample.iceLocalCandidates) {
156
- const callMetaReport = (0, callMetaReports_1.createCallMetaReport)(serviceId, mediaUnitId, roomId, callId, clientId, {
157
- type: callMetaReports_1.CallMetaType.ICE_LOCAL_CANDIDATE,
158
- payload: iceLocalCandidate,
159
- }, userId);
160
- reports.addCallMetaReport(callMetaReport);
161
- }
162
- }
163
- if (clientSample.iceRemoteCandidates && 0 < clientSample.iceRemoteCandidates.length) {
164
- for (const iceRemoteCandidate of clientSample.iceRemoteCandidates) {
165
- const callMetaReport = (0, callMetaReports_1.createCallMetaReport)(serviceId, mediaUnitId, roomId, callId, clientId, {
166
- type: callMetaReports_1.CallMetaType.ICE_REMOTE_CANDIDATE,
167
- payload: iceRemoteCandidate,
168
- }, userId);
169
- reports.addCallMetaReport(callMetaReport);
170
- }
171
- }
172
- }
173
- }
174
- exports.visitClient = visitClient;
@@ -1,5 +0,0 @@
1
- import * as Models from '../../models/Models';
2
- import { ReportsCollector } from '../../common/ReportsCollector';
3
- import { ObservedInboundAudioTrack } from '../../samples/ObservedInboundAudioTrack';
4
- export declare function visitInboundAudioTrack(observedInboundAudioTrack: ObservedInboundAudioTrack, storedPeerConnection: Models.PeerConnection, storedInboundTracks: Map<string, Models.InboundTrack>, reports: ReportsCollector, fetchSamples: boolean, remoteTrackId?: string, remotePeerConnectionId?: string, remoteClientId?: string): void;
5
- //# sourceMappingURL=visitInboundAudioTrack.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"visitInboundAudioTrack.d.ts","sourceRoot":"","sources":["../../../src/middlewares/visitors/visitInboundAudioTrack.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAKpF,wBAAgB,sBAAsB,CACrC,yBAAyB,EAAE,yBAAyB,EACpD,oBAAoB,EAAE,MAAM,CAAC,cAAc,EAC3C,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,YAAY,CAAC,EACrD,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,OAAO,EACrB,aAAa,CAAC,EAAE,MAAM,EACtB,sBAAsB,CAAC,EAAE,MAAM,EAC/B,cAAc,CAAC,EAAE,MAAM,QAgGvB"}
@@ -1,93 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __rest = (this && this.__rest) || function (s, e) {
26
- var t = {};
27
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
28
- t[p] = s[p];
29
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
30
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
31
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
32
- t[p[i]] = s[p[i]];
33
- }
34
- return t;
35
- };
36
- Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.visitInboundAudioTrack = void 0;
38
- /* eslint-disable camelcase */
39
- const Models = __importStar(require("../../models/Models"));
40
- const VisitObservedCallsMiddleware_1 = require("../VisitObservedCallsMiddleware");
41
- const samples_pb_1 = require("../../models/samples_pb");
42
- function visitInboundAudioTrack(observedInboundAudioTrack, storedPeerConnection, storedInboundTracks, reports, fetchSamples, remoteTrackId, remotePeerConnectionId, remoteClientId) {
43
- const { trackId, sfuStreamId, sfuSinkId } = observedInboundAudioTrack;
44
- const { peerConnectionId } = observedInboundAudioTrack.peerConnection;
45
- const { mediaUnitId, clientId, userId, marker, minTimestamp: timestamp, } = observedInboundAudioTrack.peerConnection.client;
46
- const { serviceId, roomId, callId } = observedInboundAudioTrack.peerConnection.client.call;
47
- let storedInboundAudioTrack = storedInboundTracks.get(trackId);
48
- if (!storedInboundAudioTrack) {
49
- storedInboundAudioTrack = new Models.InboundTrack({
50
- serviceId,
51
- roomId,
52
- callId,
53
- clientId,
54
- kind: 'audio',
55
- peerConnectionId,
56
- mediaUnitId,
57
- trackId,
58
- sfuSinkId,
59
- sfuStreamId,
60
- userId,
61
- marker,
62
- });
63
- storedInboundTracks.set(trackId, storedInboundAudioTrack);
64
- if (!storedPeerConnection.inboundTrackIds.find((tId) => tId === trackId)) {
65
- storedPeerConnection.inboundTrackIds.push(trackId);
66
- }
67
- else {
68
- VisitObservedCallsMiddleware_1.logger.warn(`Attempted to add trackId to storedPeerConnection twice. serviceId: ${serviceId}, callId: ${callId}, clientId: ${clientId}, pcId: ${peerConnectionId}`);
69
- }
70
- }
71
- const statsMap = new Map();
72
- for (const inboundAudioSample of observedInboundAudioTrack.samples()) {
73
- const report = Object.assign(Object.assign({ serviceId,
74
- roomId,
75
- callId,
76
- clientId,
77
- userId,
78
- mediaUnitId,
79
- peerConnectionId }, inboundAudioSample), { timestamp, sampleSeq: -1, remoteClientId,
80
- remotePeerConnectionId,
81
- remoteTrackId });
82
- reports.addInboundAudioTrackReport(report);
83
- if (fetchSamples) {
84
- const { ssrc: sample_ssrc, bytesReceived: sample_bytesReceived, bytesSent: sample_bytesSent, estimatedPlayoutTimestamp: samples_estimatedPlayoutTimestamp, headerBytesReceived: samples_headerBytesReceived, lastPacketReceivedTimestamp: samples_lastPacketReceivedTimestamp, remoteTimestamp: samples_remoteTimestamp } = inboundAudioSample, sample = __rest(inboundAudioSample, ["ssrc", "bytesReceived", "bytesSent", "estimatedPlayoutTimestamp", "headerBytesReceived", "lastPacketReceivedTimestamp", "remoteTimestamp"]);
85
- const ssrc = BigInt(sample_ssrc);
86
- const audioStats = new samples_pb_1.Samples_ClientSample_InboundAudioTrack(Object.assign({ ssrc, bytesReceived: BigInt(sample_bytesReceived !== null && sample_bytesReceived !== void 0 ? sample_bytesReceived : -1), bytesSent: BigInt(sample_bytesSent !== null && sample_bytesSent !== void 0 ? sample_bytesSent : -1), estimatedPlayoutTimestamp: BigInt(samples_estimatedPlayoutTimestamp !== null && samples_estimatedPlayoutTimestamp !== void 0 ? samples_estimatedPlayoutTimestamp : -1), headerBytesReceived: BigInt(samples_headerBytesReceived !== null && samples_headerBytesReceived !== void 0 ? samples_headerBytesReceived : -1), lastPacketReceivedTimestamp: BigInt(samples_lastPacketReceivedTimestamp !== null && samples_lastPacketReceivedTimestamp !== void 0 ? samples_lastPacketReceivedTimestamp : -1), remoteTimestamp: BigInt(samples_remoteTimestamp !== null && samples_remoteTimestamp !== void 0 ? samples_remoteTimestamp : -1) }, sample));
87
- statsMap.set(ssrc, audioStats);
88
- }
89
- }
90
- storedInboundAudioTrack.ssrc = [...statsMap.keys()];
91
- storedInboundAudioTrack.videoStats = Array.from(statsMap.values());
92
- }
93
- exports.visitInboundAudioTrack = visitInboundAudioTrack;
@@ -1,5 +0,0 @@
1
- import { ReportsCollector } from '../../common/ReportsCollector';
2
- import { ObservedInboundVideoTrack } from '../../samples/ObservedInboundVideoTrack';
3
- import * as Models from '../../models/Models';
4
- export declare function visitInboundVideoTrack(observedInboundVideoTrack: ObservedInboundVideoTrack, storedPeerConnection: Models.PeerConnection, storedInboundTracks: Map<string, Models.InboundTrack>, reports: ReportsCollector, fetchSamples: boolean, remoteTrackId?: string, remotePeerConnectionId?: string, remoteClientId?: string): void;
5
- //# sourceMappingURL=visitInboundVideoTrack.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"visitInboundVideoTrack.d.ts","sourceRoot":"","sources":["../../../src/middlewares/visitors/visitInboundVideoTrack.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAEpF,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAK9C,wBAAgB,sBAAsB,CACrC,yBAAyB,EAAE,yBAAyB,EACpD,oBAAoB,EAAE,MAAM,CAAC,cAAc,EAC3C,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,YAAY,CAAC,EACrD,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,OAAO,EACrB,aAAa,CAAC,EAAE,MAAM,EACtB,sBAAsB,CAAC,EAAE,MAAM,EAC/B,cAAc,CAAC,EAAE,MAAM,QAkGvB"}
@@ -1,94 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __rest = (this && this.__rest) || function (s, e) {
26
- var t = {};
27
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
28
- t[p] = s[p];
29
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
30
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
31
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
32
- t[p[i]] = s[p[i]];
33
- }
34
- return t;
35
- };
36
- Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.visitInboundVideoTrack = void 0;
38
- const VisitObservedCallsMiddleware_1 = require("../VisitObservedCallsMiddleware");
39
- const Models = __importStar(require("../../models/Models"));
40
- const samples_pb_1 = require("../../models/samples_pb");
41
- // InboundVideoTrack visitor
42
- function visitInboundVideoTrack(observedInboundVideoTrack, storedPeerConnection, storedInboundTracks, reports, fetchSamples, remoteTrackId, remotePeerConnectionId, remoteClientId) {
43
- const { trackId, sfuStreamId, sfuSinkId } = observedInboundVideoTrack;
44
- const { peerConnectionId } = observedInboundVideoTrack.peerConnection;
45
- const { mediaUnitId, clientId, userId, marker, minTimestamp: timestamp, } = observedInboundVideoTrack.peerConnection.client;
46
- const { serviceId, roomId, callId } = observedInboundVideoTrack.peerConnection.client.call;
47
- let storedInboundVideoTrack = storedInboundTracks.get(trackId);
48
- if (!storedInboundVideoTrack) {
49
- storedInboundVideoTrack = new Models.InboundTrack({
50
- serviceId,
51
- roomId,
52
- callId,
53
- clientId,
54
- kind: 'video',
55
- peerConnectionId,
56
- mediaUnitId,
57
- trackId,
58
- sfuStreamId,
59
- sfuSinkId,
60
- userId,
61
- marker,
62
- });
63
- storedInboundTracks.set(trackId, storedInboundVideoTrack);
64
- if (!storedPeerConnection.inboundTrackIds.find((tId) => tId === trackId)) {
65
- storedPeerConnection.inboundTrackIds.push(trackId);
66
- }
67
- else {
68
- VisitObservedCallsMiddleware_1.logger.warn(`Attempted to add trackId to storedPeerConnection twice. serviceId: ${serviceId}, callId: ${callId}, clientId: ${clientId}, pcId: ${peerConnectionId}`);
69
- }
70
- }
71
- const statsMap = new Map();
72
- for (const inboundVideoSample of observedInboundVideoTrack.samples()) {
73
- const report = Object.assign(Object.assign({ serviceId,
74
- roomId,
75
- callId,
76
- clientId,
77
- userId,
78
- mediaUnitId,
79
- peerConnectionId }, inboundVideoSample), { timestamp, sampleSeq: -1, remoteClientId,
80
- remotePeerConnectionId,
81
- remoteTrackId });
82
- reports.addInboundVideoTrackReport(report);
83
- if (fetchSamples) {
84
- const { ssrc: sample_ssrc, bytesReceived: sample_bytesReceived, bytesSent: sample_bytesSent, estimatedPlayoutTimestamp: samples_estimatedPlayoutTimestamp, headerBytesReceived: samples_headerBytesReceived, lastPacketReceivedTimestamp: samples_lastPacketReceivedTimestamp, remoteTimestamp: samples_remoteTimestamp, qpSum: bytes_qpSum } = inboundVideoSample, sample = __rest(inboundVideoSample, ["ssrc", "bytesReceived", "bytesSent", "estimatedPlayoutTimestamp", "headerBytesReceived", "lastPacketReceivedTimestamp", "remoteTimestamp", "qpSum"]);
85
- const ssrc = BigInt(sample_ssrc);
86
- // const lastVideoStats = storedInboundVideoTrack.videoStats.find((stats) => stats.ssrc === ssrc);
87
- const videoStats = new samples_pb_1.Samples_ClientSample_InboundVideoTrack(Object.assign({ ssrc, bytesReceived: BigInt(sample_bytesReceived !== null && sample_bytesReceived !== void 0 ? sample_bytesReceived : -1), bytesSent: BigInt(sample_bytesSent !== null && sample_bytesSent !== void 0 ? sample_bytesSent : -1), estimatedPlayoutTimestamp: BigInt(samples_estimatedPlayoutTimestamp !== null && samples_estimatedPlayoutTimestamp !== void 0 ? samples_estimatedPlayoutTimestamp : -1), headerBytesReceived: BigInt(samples_headerBytesReceived !== null && samples_headerBytesReceived !== void 0 ? samples_headerBytesReceived : -1), lastPacketReceivedTimestamp: BigInt(samples_lastPacketReceivedTimestamp !== null && samples_lastPacketReceivedTimestamp !== void 0 ? samples_lastPacketReceivedTimestamp : -1), remoteTimestamp: BigInt(samples_remoteTimestamp !== null && samples_remoteTimestamp !== void 0 ? samples_remoteTimestamp : -1), qpSum: BigInt(bytes_qpSum !== null && bytes_qpSum !== void 0 ? bytes_qpSum : -1) }, sample));
88
- statsMap.set(ssrc, videoStats);
89
- }
90
- }
91
- storedInboundVideoTrack.ssrc = [...statsMap.keys()];
92
- storedInboundVideoTrack.videoStats = Array.from(statsMap.values());
93
- }
94
- exports.visitInboundVideoTrack = visitInboundVideoTrack;
@@ -1,5 +0,0 @@
1
- import * as Models from '../../models/Models';
2
- import { ReportsCollector } from '../../common/ReportsCollector';
3
- import { ObservedOutboundAudioTrack } from '../../samples/ObservedOutboundAudioTrack';
4
- export declare function visitOutboundAudioTrack(observedOutboundAudioTrack: ObservedOutboundAudioTrack, storedPeerConnection: Models.PeerConnection, storedOutboundTracks: Map<string, Models.OutboundTrack>, reports: ReportsCollector, fetchSamples: boolean): void;
5
- //# sourceMappingURL=visitOutboundAudioTrack.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"visitOutboundAudioTrack.d.ts","sourceRoot":"","sources":["../../../src/middlewares/visitors/visitOutboundAudioTrack.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAKtF,wBAAgB,uBAAuB,CACtC,0BAA0B,EAAE,0BAA0B,EACtD,oBAAoB,EAAE,MAAM,CAAC,cAAc,EAC3C,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,aAAa,CAAC,EACvD,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,OAAO,QAsFrB"}