mediasoup 3.20.6 → 3.20.8

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 (168) hide show
  1. package/node/lib/fbs/data-consumer/binary.d.ts +25 -0
  2. package/node/lib/fbs/data-consumer/binary.d.ts.map +1 -0
  3. package/node/lib/fbs/data-consumer/binary.js +110 -0
  4. package/node/lib/fbs/data-consumer/data.d.ts +10 -0
  5. package/node/lib/fbs/data-consumer/data.d.ts.map +1 -0
  6. package/node/lib/fbs/data-consumer/data.js +30 -0
  7. package/node/lib/fbs/data-consumer/string.d.ts +22 -0
  8. package/node/lib/fbs/data-consumer/string.d.ts.map +1 -0
  9. package/node/lib/fbs/{worker/close-notification.js → data-consumer/string.js} +34 -20
  10. package/node/lib/fbs/data-producer/binary.d.ts +25 -0
  11. package/node/lib/fbs/data-producer/binary.d.ts.map +1 -0
  12. package/node/lib/fbs/data-producer/binary.js +110 -0
  13. package/node/lib/fbs/data-producer/data.d.ts +10 -0
  14. package/node/lib/fbs/data-producer/data.d.ts.map +1 -0
  15. package/node/lib/fbs/data-producer/data.js +30 -0
  16. package/node/lib/fbs/data-producer/string.d.ts +22 -0
  17. package/node/lib/fbs/data-producer/string.d.ts.map +1 -0
  18. package/node/lib/fbs/data-producer/string.js +92 -0
  19. package/node/lib/fbs/message/type.d.ts +7 -0
  20. package/node/lib/fbs/message/type.d.ts.map +1 -0
  21. package/node/lib/fbs/message/type.js +11 -0
  22. package/node/lib/fbs/message-from-worker/body.d.ts +12 -0
  23. package/node/lib/fbs/message-from-worker/body.d.ts.map +1 -0
  24. package/node/lib/fbs/message-from-worker/body.js +34 -0
  25. package/node/lib/fbs/message-from-worker/message.d.ts +30 -0
  26. package/node/lib/fbs/message-from-worker/message.d.ts.map +1 -0
  27. package/node/lib/fbs/message-from-worker/message.js +122 -0
  28. package/node/lib/fbs/message-from-worker.d.ts +3 -0
  29. package/node/lib/fbs/message-from-worker.d.ts.map +1 -0
  30. package/node/lib/fbs/message-from-worker.js +9 -0
  31. package/node/lib/fbs/message-to-worker/body.d.ts +10 -0
  32. package/node/lib/fbs/message-to-worker/body.d.ts.map +1 -0
  33. package/node/lib/fbs/message-to-worker/body.js +30 -0
  34. package/node/lib/fbs/message-to-worker/message.d.ts +29 -0
  35. package/node/lib/fbs/message-to-worker/message.d.ts.map +1 -0
  36. package/node/lib/fbs/message-to-worker/message.js +122 -0
  37. package/node/lib/fbs/message-to-worker.d.ts +3 -0
  38. package/node/lib/fbs/message-to-worker.d.ts.map +1 -0
  39. package/node/lib/fbs/message-to-worker.js +9 -0
  40. package/node/lib/fbs/notification-from-worker/body.d.ts +44 -0
  41. package/node/lib/fbs/notification-from-worker/body.d.ts.map +1 -0
  42. package/node/lib/fbs/notification-from-worker/body.js +98 -0
  43. package/node/lib/fbs/notification-from-worker/event.d.ts +31 -0
  44. package/node/lib/fbs/notification-from-worker/event.d.ts.map +1 -0
  45. package/node/lib/fbs/notification-from-worker/event.js +35 -0
  46. package/node/lib/fbs/notification-from-worker/notification.d.ts +52 -0
  47. package/node/lib/fbs/notification-from-worker/notification.d.ts.map +1 -0
  48. package/node/lib/fbs/notification-from-worker/notification.js +140 -0
  49. package/node/lib/fbs/notification-from-worker.d.ts +4 -0
  50. package/node/lib/fbs/notification-from-worker.d.ts.map +1 -0
  51. package/node/lib/fbs/notification-from-worker.js +11 -0
  52. package/node/lib/fbs/notification-to-worker/body.d.ts +12 -0
  53. package/node/lib/fbs/notification-to-worker/body.d.ts.map +1 -0
  54. package/node/lib/fbs/notification-to-worker/body.js +34 -0
  55. package/node/lib/fbs/notification-to-worker/event.d.ts +6 -0
  56. package/node/lib/fbs/notification-to-worker/event.d.ts.map +1 -0
  57. package/node/lib/fbs/notification-to-worker/event.js +10 -0
  58. package/node/lib/fbs/notification-to-worker/notification.d.ts +36 -0
  59. package/node/lib/fbs/notification-to-worker/notification.d.ts.map +1 -0
  60. package/node/lib/fbs/notification-to-worker/notification.js +140 -0
  61. package/node/lib/fbs/notification-to-worker.d.ts +4 -0
  62. package/node/lib/fbs/notification-to-worker.d.ts.map +1 -0
  63. package/node/lib/fbs/notification-to-worker.js +11 -0
  64. package/node/lib/fbs/sctp-parameters/num-sctp-streams.d.ts.map +1 -1
  65. package/node/lib/fbs/sctp-parameters/num-sctp-streams.js +5 -5
  66. package/node/lib/fbs/trace-events/fir-trace-info.d.ts +21 -0
  67. package/node/lib/fbs/trace-events/fir-trace-info.d.ts.map +1 -0
  68. package/node/lib/fbs/{worker/close-request.js → trace-events/fir-trace-info.js} +32 -20
  69. package/node/lib/fbs/trace-events/key-frame-trace-info.d.ts +25 -0
  70. package/node/lib/fbs/trace-events/key-frame-trace-info.d.ts.map +1 -0
  71. package/node/lib/fbs/trace-events/key-frame-trace-info.js +104 -0
  72. package/node/lib/fbs/trace-events/pli-trace-info.d.ts +21 -0
  73. package/node/lib/fbs/trace-events/pli-trace-info.d.ts.map +1 -0
  74. package/node/lib/fbs/{worker/close-worker-notification.js → trace-events/pli-trace-info.js} +32 -20
  75. package/node/lib/fbs/trace-events/rtp-trace-info.d.ts +25 -0
  76. package/node/lib/fbs/trace-events/rtp-trace-info.d.ts.map +1 -0
  77. package/node/lib/fbs/{consumer/enable-delay-and-loss-request.js → trace-events/rtp-trace-info.js} +35 -33
  78. package/node/lib/fbs/trace-events/trace-event-type.d.ts +8 -0
  79. package/node/lib/fbs/trace-events/trace-event-type.d.ts.map +1 -0
  80. package/node/lib/fbs/trace-events/trace-event-type.js +12 -0
  81. package/node/lib/fbs/trace-events/trace-info.d.ts +14 -0
  82. package/node/lib/fbs/trace-events/trace-info.d.ts.map +1 -0
  83. package/node/lib/fbs/trace-events/trace-info.js +38 -0
  84. package/node/lib/fbs/trace-events.d.ts +7 -0
  85. package/node/lib/fbs/trace-events.d.ts.map +1 -0
  86. package/node/lib/fbs/trace-events.js +20 -0
  87. package/npm-scripts.mjs +13 -8
  88. package/package.json +6 -6
  89. package/worker/fbs/meson.build +0 -1
  90. package/worker/fbs/plainTransport.fbs +1 -1
  91. package/worker/fbs/worker.fbs +0 -2
  92. package/worker/include/RTC/ICE/StunPacket.hpp +8 -9
  93. package/worker/include/RTC/RTP/Packet.hpp +1 -1
  94. package/worker/include/RTC/RTP/ProbationGenerator.hpp +1 -1
  95. package/worker/include/RTC/SCTP/packet/Chunk.hpp +1 -1
  96. package/worker/include/RTC/SCTP/packet/ErrorCause.hpp +1 -1
  97. package/worker/include/RTC/SCTP/packet/Packet.hpp +1 -2
  98. package/worker/include/RTC/SCTP/packet/Parameter.hpp +1 -1
  99. package/worker/include/RTC/SCTP/packet/TLV.hpp +1 -1
  100. package/worker/include/RTC/SCTP/packet/chunks/DataChunk.hpp +1 -1
  101. package/worker/include/RTC/SCTP/packet/chunks/ForwardTsnChunk.hpp +1 -1
  102. package/worker/include/RTC/SCTP/packet/chunks/IDataChunk.hpp +1 -1
  103. package/worker/include/RTC/SCTP/packet/chunks/IForwardTsnChunk.hpp +1 -1
  104. package/worker/include/RTC/SCTP/packet/chunks/InitAckChunk.hpp +1 -1
  105. package/worker/include/RTC/SCTP/packet/chunks/InitChunk.hpp +1 -1
  106. package/worker/include/RTC/SCTP/packet/chunks/SackChunk.hpp +1 -1
  107. package/worker/include/RTC/SCTP/packet/chunks/ShutdownChunk.hpp +1 -1
  108. package/worker/include/RTC/SCTP/packet/errorCauses/InvalidStreamIdentifierErrorCause.hpp +1 -1
  109. package/worker/include/RTC/SCTP/packet/errorCauses/MissingMandatoryParameterErrorCause.hpp +1 -1
  110. package/worker/include/RTC/SCTP/packet/errorCauses/NoUserDataErrorCause.hpp +1 -1
  111. package/worker/include/RTC/SCTP/packet/errorCauses/StaleCookieErrorCause.hpp +1 -1
  112. package/worker/include/RTC/SCTP/packet/parameters/AddIncomingStreamsRequestParameter.hpp +1 -1
  113. package/worker/include/RTC/SCTP/packet/parameters/AddOutgoingStreamsRequestParameter.hpp +1 -1
  114. package/worker/include/RTC/SCTP/packet/parameters/CookiePreservativeParameter.hpp +1 -1
  115. package/worker/include/RTC/SCTP/packet/parameters/IPv4AddressParameter.hpp +1 -1
  116. package/worker/include/RTC/SCTP/packet/parameters/IPv6AddressParameter.hpp +1 -1
  117. package/worker/include/RTC/SCTP/packet/parameters/IncomingSsnResetRequestParameter.hpp +1 -1
  118. package/worker/include/RTC/SCTP/packet/parameters/OutgoingSsnResetRequestParameter.hpp +1 -1
  119. package/worker/include/RTC/SCTP/packet/parameters/ReconfigurationResponseParameter.hpp +2 -2
  120. package/worker/include/RTC/SCTP/packet/parameters/SsnTsnResetRequestParameter.hpp +1 -1
  121. package/worker/include/RTC/SCTP/packet/parameters/ZeroChecksumAcceptableParameter.hpp +1 -1
  122. package/worker/include/Settings.hpp +0 -1
  123. package/worker/include/handles/TcpConnectionHandle.hpp +0 -4
  124. package/worker/include/handles/UdpSocketHandle.hpp +0 -4
  125. package/worker/meson.build +0 -34
  126. package/worker/meson_options.txt +0 -1
  127. package/worker/src/RTC/PipeTransport.cpp +5 -5
  128. package/worker/src/RTC/PlainTransport.cpp +5 -5
  129. package/worker/src/RTC/RTP/Packet.cpp +0 -2
  130. package/worker/src/RTC/RTP/RtpStreamSend.cpp +0 -20
  131. package/worker/src/RTC/Router.cpp +0 -37
  132. package/worker/src/RTC/SCTP/association/Association.cpp +12 -7
  133. package/worker/src/RTC/SimpleProducerStreamManager.cpp +6 -3
  134. package/worker/src/RTC/SimulcastProducerStreamManager.cpp +2 -2
  135. package/worker/src/RTC/SrtpSession.cpp +0 -24
  136. package/worker/src/RTC/Transport.cpp +3 -22
  137. package/worker/src/RTC/WebRtcTransport.cpp +5 -5
  138. package/worker/src/Settings.cpp +0 -14
  139. package/worker/src/Utils/Crypto.cpp +3 -3
  140. package/worker/src/Utils/String.cpp +1 -1
  141. package/worker/src/Worker.cpp +5 -38
  142. package/worker/src/handles/TcpConnectionHandle.cpp +1 -42
  143. package/worker/src/handles/UdpSocketHandle.cpp +1 -42
  144. package/worker/src/lib.cpp +1 -10
  145. package/node/lib/fbs/consumer/degrade-request.d.ts +0 -30
  146. package/node/lib/fbs/consumer/degrade-request.d.ts.map +0 -1
  147. package/node/lib/fbs/consumer/degrade-request.js +0 -124
  148. package/node/lib/fbs/consumer/enable-delay-and-loss-request.d.ts +0 -24
  149. package/node/lib/fbs/consumer/enable-delay-and-loss-request.d.ts.map +0 -1
  150. package/node/lib/fbs/producer/degrade-request.d.ts +0 -30
  151. package/node/lib/fbs/producer/degrade-request.d.ts.map +0 -1
  152. package/node/lib/fbs/producer/degrade-request.js +0 -124
  153. package/node/lib/fbs/transport/sctp-negotiated-max-streams-notification.d.ts +0 -24
  154. package/node/lib/fbs/transport/sctp-negotiated-max-streams-notification.d.ts.map +0 -1
  155. package/node/lib/fbs/transport/sctp-negotiated-max-streams-notification.js +0 -102
  156. package/node/lib/fbs/transport/sctp-negotiated-options-notification.d.ts +0 -24
  157. package/node/lib/fbs/transport/sctp-negotiated-options-notification.d.ts.map +0 -1
  158. package/node/lib/fbs/transport/sctp-negotiated-options-notification.js +0 -102
  159. package/node/lib/fbs/worker/close-notification.d.ts +0 -18
  160. package/node/lib/fbs/worker/close-notification.d.ts.map +0 -1
  161. package/node/lib/fbs/worker/close-request.d.ts +0 -18
  162. package/node/lib/fbs/worker/close-request.d.ts.map +0 -1
  163. package/node/lib/fbs/worker/close-worker-notification.d.ts +0 -18
  164. package/node/lib/fbs/worker/close-worker-notification.d.ts.map +0 -1
  165. package/worker/fbs/liburing.fbs +0 -7
  166. package/worker/include/DepLibUring.hpp +0 -143
  167. package/worker/src/DepLibUring.cpp +0 -638
  168. package/worker/subprojects/liburing.wrap +0 -14
@@ -1,7 +0,0 @@
1
- namespace FBS.LibUring;
2
-
3
- table Dump {
4
- sqe_process_count: uint64;
5
- sqe_miss_count: uint64;
6
- user_data_miss_count: uint64;
7
- }
@@ -1,143 +0,0 @@
1
- #ifndef MS_DEP_LIBURING_HPP
2
- #define MS_DEP_LIBURING_HPP
3
-
4
- #include "FBS/liburing.h"
5
- #include <uv.h>
6
- #include <functional>
7
- #include <liburing.h>
8
- #include <queue>
9
-
10
- class DepLibUring
11
- {
12
- public:
13
- using onSendCallback = const std::function<void(bool sent)>;
14
-
15
- /* Struct for the user data field of SQE and CQE. */
16
- struct UserData
17
- {
18
- // Pointer to send buffer.
19
- uint8_t* store{ nullptr };
20
- // Frame len buffer for TCP.
21
- uint8_t frameLen[2] = { 0 };
22
- // iovec for TCP, first item for framing, second item for payload.
23
- struct iovec iov[2];
24
- // Send callback.
25
- onSendCallback* cb{ nullptr };
26
- // Index in userDatas array.
27
- size_t idx{ 0 };
28
- };
29
-
30
- /* Number of submission queue entries (SQE). */
31
- static constexpr size_t QueueDepth{ 1024 * 4 };
32
- static constexpr size_t SendBufferSize{ 1500 };
33
-
34
- using SendBuffer = uint8_t[SendBufferSize];
35
-
36
- static void ClassInit();
37
- static void ClassDestroy();
38
- static bool CheckRuntimeSupport();
39
- static bool IsEnabled();
40
- static flatbuffers::Offset<FBS::LibUring::Dump> FillBuffer(flatbuffers::FlatBufferBuilder& builder);
41
- static void StartPollingCQEs();
42
- static void StopPollingCQEs();
43
- static uint8_t* GetSendBuffer();
44
- static bool PrepareSend(
45
- int sockfd, const uint8_t* data, size_t len, const struct sockaddr* addr, onSendCallback* cb);
46
- static bool PrepareWrite(
47
- int sockfd, const uint8_t* data1, size_t len1, const uint8_t* data2, size_t len2, onSendCallback* cb);
48
- static void Submit();
49
- static void SetActive();
50
- static bool IsActive();
51
-
52
- class LibUring;
53
-
54
- // Whether liburing is enabled or not after runtime checks.
55
- static thread_local bool enabled;
56
- static thread_local LibUring* liburing;
57
-
58
- public:
59
- // Singleton.
60
- class LibUring
61
- {
62
- public:
63
- LibUring();
64
- ~LibUring();
65
- flatbuffers::Offset<FBS::LibUring::Dump> FillBuffer(flatbuffers::FlatBufferBuilder& builder) const;
66
- void StartPollingCQEs();
67
- void StopPollingCQEs();
68
- uint8_t* GetSendBuffer();
69
- bool PrepareSend(
70
- int sockfd, const uint8_t* data, size_t len, const struct sockaddr* addr, onSendCallback* cb);
71
- bool PrepareWrite(
72
- int sockfd,
73
- const uint8_t* data1,
74
- size_t len1,
75
- const uint8_t* data2,
76
- size_t len2,
77
- onSendCallback* cb);
78
- void Submit();
79
- void SetActive()
80
- {
81
- this->active = true;
82
- }
83
- bool IsActive() const
84
- {
85
- return this->active;
86
- }
87
- bool IsZeroCopyEnabled() const
88
- {
89
- return this->zeroCopyEnabled;
90
- }
91
- io_uring* GetRing()
92
- {
93
- return std::addressof(this->ring);
94
- }
95
- int GetEventFd() const
96
- {
97
- return this->efd;
98
- }
99
- void ReleaseUserDataEntry(size_t idx)
100
- {
101
- this->availableUserDataEntries.push(idx);
102
- }
103
-
104
- private:
105
- void SetInactive()
106
- {
107
- this->active = false;
108
- }
109
- UserData* GetUserData();
110
- bool IsDataInSendBuffers(const uint8_t* data) const
111
- {
112
- return data >= this->sendBuffers[0] && data <= this->sendBuffers[DepLibUring::QueueDepth - 1];
113
- }
114
-
115
- private:
116
- // io_uring instance.
117
- io_uring ring;
118
- // Event file descriptor to watch for io_uring completions.
119
- int efd;
120
- // libuv handle used to poll io_uring completions.
121
- uv_poll_t* uvHandle{ nullptr };
122
- // Whether we are currently sending RTP over io_uring.
123
- bool active{ false };
124
- // Whether Zero Copy feature is enabled.
125
- bool zeroCopyEnabled{ true };
126
- // Pre-allocated UserData's.
127
- UserData userDatas[QueueDepth]{};
128
- // Indexes of available UserData entries.
129
- std::queue<size_t> availableUserDataEntries;
130
- // Pre-allocated SendBuffer's.
131
- SendBuffer sendBuffers[QueueDepth];
132
- // iovec structs to be registered for Zero Copy.
133
- struct iovec iovecs[QueueDepth];
134
- // Submission queue entry process count.
135
- uint64_t sqeProcessCount{ 0u };
136
- // Submission queue entry miss count.
137
- uint64_t sqeMissCount{ 0u };
138
- // User data miss count.
139
- uint64_t userDataMissCount{ 0u };
140
- };
141
- };
142
-
143
- #endif