moqtail 0.15.0 → 0.16.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.
- package/README.md +153 -473
- package/dist/{client-BviQ20Lc.cjs → client-DQ5aGbLR.cjs} +1089 -1074
- package/dist/client-DUzLw_Y8.d.cts +1932 -0
- package/dist/{client-zi0lmuIL.mjs → client-DVi4Nh1J.mjs} +930 -921
- package/dist/client-epHqMdHm.d.mts +1932 -0
- package/dist/client.cjs +121 -4
- package/dist/client.d.cts +23 -1944
- package/dist/client.d.mts +23 -1944
- package/dist/client.mjs +117 -2
- package/dist/emitter-UbeRcbuf.mjs +109 -0
- package/dist/{logger-c2NoQqtx.cjs → emitter-qNJYD3yQ.cjs} +61 -2
- package/dist/index-B-BMK-b6.d.mts +2090 -0
- package/dist/index-BtemTtwe.d.cts +2090 -0
- package/dist/{index-BY6e1obL.d.cts → index-CNn9BgO6.d.mts} +119 -324
- package/dist/index.cjs +38 -34
- package/dist/index.d.cts +20 -4
- package/dist/index.d.mts +20 -4
- package/dist/index.mjs +5 -4
- package/dist/logger-B8IYkljn.d.cts +64 -0
- package/dist/logger-B8IYkljn.d.mts +64 -0
- package/dist/model.cjs +122 -340
- package/dist/model.d.cts +2896 -2
- package/dist/model.d.mts +17 -2
- package/dist/model.mjs +122 -340
- package/dist/player/component.cjs +317 -0
- package/dist/player/component.d.cts +50 -0
- package/dist/player/component.d.mts +50 -0
- package/dist/player/component.mjs +315 -0
- package/dist/player-CJayEzwt.cjs +6750 -0
- package/dist/player-DcctWhyM.mjs +6599 -0
- package/dist/player.cjs +27 -0
- package/dist/player.d.cts +17 -0
- package/dist/player.d.mts +17 -0
- package/dist/player.mjs +1 -0
- package/dist/rolldown-runtime-CmQyd0Gu.cjs +27 -0
- package/dist/util.cjs +9 -10
- package/dist/util.d.cts +20 -13
- package/dist/util.d.mts +20 -13
- package/dist/util.mjs +4 -6
- package/package.json +45 -5
- package/dist/index-BY6e1obL.d.mts +0 -3087
- package/dist/logger-ByDB8lYF.mjs +0 -56
- package/dist/logger-dEoueCj7.d.cts +0 -35
- package/dist/logger-dEoueCj7.d.mts +0 -35
package/dist/client.cjs
CHANGED
|
@@ -1,8 +1,124 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_client = require("./client-
|
|
2
|
+
const require_client = require("./client-DQ5aGbLR.cjs");
|
|
3
|
+
const require_model = require("./model.cjs");
|
|
4
|
+
// src/client/track/object_cache.ts
|
|
5
|
+
/**
|
|
6
|
+
* Copyright 2025 The MOQtail Authors
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
* you may not use this file except in compliance with the License.
|
|
10
|
+
* You may obtain a copy of the License at
|
|
11
|
+
*
|
|
12
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
*
|
|
14
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
* See the License for the specific language governing permissions and
|
|
18
|
+
* limitations under the License.
|
|
19
|
+
*/
|
|
20
|
+
var MemoryObjectCache = class {
|
|
21
|
+
objects = [];
|
|
22
|
+
add(obj) {
|
|
23
|
+
const idx = this._findInsertIndex(obj);
|
|
24
|
+
this.objects.splice(idx, 0, obj);
|
|
25
|
+
}
|
|
26
|
+
getRange(start, end) {
|
|
27
|
+
const startIdx = start ? this._findIndex(start, false) : 0;
|
|
28
|
+
const endIdx = end ? this._findIndex(end, true) : this.objects.length;
|
|
29
|
+
return this.objects.slice(startIdx, endIdx);
|
|
30
|
+
}
|
|
31
|
+
getByLocation(location) {
|
|
32
|
+
const idx = this._findIndex(location, false);
|
|
33
|
+
const obj = this.objects[idx];
|
|
34
|
+
if (obj && obj.groupId === location.group && obj.objectId === location.object) return obj;
|
|
35
|
+
}
|
|
36
|
+
size() {
|
|
37
|
+
return this.objects.length;
|
|
38
|
+
}
|
|
39
|
+
clear() {
|
|
40
|
+
this.objects = [];
|
|
41
|
+
}
|
|
42
|
+
_findInsertIndex(obj) {
|
|
43
|
+
let low = 0, high = this.objects.length;
|
|
44
|
+
while (low < high) {
|
|
45
|
+
const mid = low + high >> 1;
|
|
46
|
+
const midObj = this.objects[mid];
|
|
47
|
+
if (!midObj) break;
|
|
48
|
+
if (new require_model.Location(midObj.groupId, midObj.objectId).compare(new require_model.Location(obj.groupId, obj.objectId)) < 0) low = mid + 1;
|
|
49
|
+
else high = mid;
|
|
50
|
+
}
|
|
51
|
+
return low;
|
|
52
|
+
}
|
|
53
|
+
_findIndex(location, exclusive) {
|
|
54
|
+
let low = 0, high = this.objects.length;
|
|
55
|
+
while (low < high) {
|
|
56
|
+
const mid = low + high >> 1;
|
|
57
|
+
const midObj = this.objects[mid];
|
|
58
|
+
if (!midObj) break;
|
|
59
|
+
const cmp = new require_model.Location(midObj.groupId, midObj.objectId).compare(location);
|
|
60
|
+
if (cmp < 0 || exclusive && cmp === 0) low = mid + 1;
|
|
61
|
+
else high = mid;
|
|
62
|
+
}
|
|
63
|
+
return low;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
var RingBufferObjectCache = class {
|
|
67
|
+
buffer;
|
|
68
|
+
maxSize;
|
|
69
|
+
constructor(maxSize = 100) {
|
|
70
|
+
this.buffer = [];
|
|
71
|
+
this.maxSize = maxSize;
|
|
72
|
+
}
|
|
73
|
+
add(obj) {
|
|
74
|
+
const idx = this._findInsertIndex(obj);
|
|
75
|
+
this.buffer.splice(idx, 0, obj);
|
|
76
|
+
if (this.buffer.length > this.maxSize) this.buffer.shift();
|
|
77
|
+
}
|
|
78
|
+
getRange(start, end) {
|
|
79
|
+
const startIdx = start ? this._findIndex(start, false) : 0;
|
|
80
|
+
const endIdx = end ? this._findIndex(end, true) : this.buffer.length;
|
|
81
|
+
return this.buffer.slice(startIdx, endIdx);
|
|
82
|
+
}
|
|
83
|
+
getByLocation(location) {
|
|
84
|
+
const idx = this._findIndex(location, false);
|
|
85
|
+
const obj = this.buffer[idx];
|
|
86
|
+
if (obj && obj.groupId === location.group && obj.objectId === location.object) return obj;
|
|
87
|
+
}
|
|
88
|
+
size() {
|
|
89
|
+
return this.buffer.length;
|
|
90
|
+
}
|
|
91
|
+
clear() {
|
|
92
|
+
this.buffer = [];
|
|
93
|
+
}
|
|
94
|
+
_findInsertIndex(obj) {
|
|
95
|
+
let low = 0, high = this.buffer.length;
|
|
96
|
+
while (low < high) {
|
|
97
|
+
const mid = low + high >> 1;
|
|
98
|
+
const midObj = this.buffer[mid];
|
|
99
|
+
if (!midObj) break;
|
|
100
|
+
if (new require_model.Location(midObj.groupId, midObj.objectId).compare(new require_model.Location(obj.groupId, obj.objectId)) < 0) low = mid + 1;
|
|
101
|
+
else high = mid;
|
|
102
|
+
}
|
|
103
|
+
return low;
|
|
104
|
+
}
|
|
105
|
+
_findIndex(location, exclusive) {
|
|
106
|
+
let low = 0, high = this.buffer.length;
|
|
107
|
+
while (low < high) {
|
|
108
|
+
const mid = low + high >> 1;
|
|
109
|
+
const midObj = this.buffer[mid];
|
|
110
|
+
if (!midObj) break;
|
|
111
|
+
const cmp = new require_model.Location(midObj.groupId, midObj.objectId).compare(location);
|
|
112
|
+
if (cmp < 0 || exclusive && cmp === 0) low = mid + 1;
|
|
113
|
+
else high = mid;
|
|
114
|
+
}
|
|
115
|
+
return low;
|
|
116
|
+
}
|
|
117
|
+
};
|
|
3
118
|
exports.ControlRecvStream = require_client.ControlRecvStream;
|
|
4
119
|
exports.ControlSendStream = require_client.ControlSendStream;
|
|
5
120
|
exports.ControlStream = require_client.ControlStream;
|
|
121
|
+
exports.DEFAULT_FILL_OPEN_TIMEOUT_MS = require_client.DEFAULT_FILL_OPEN_TIMEOUT_MS;
|
|
6
122
|
exports.DEFAULT_MAX_FILTER_RANGES = require_client.DEFAULT_MAX_FILTER_RANGES;
|
|
7
123
|
exports.DEFAULT_SWITCH_DRAIN_TIMEOUT_MS = require_client.DEFAULT_SWITCH_DRAIN_TIMEOUT_MS;
|
|
8
124
|
exports.DEFAULT_TRACK_ALIAS_RESOLUTION_TIMEOUT_MS = require_client.DEFAULT_TRACK_ALIAS_RESOLUTION_TIMEOUT_MS;
|
|
@@ -12,14 +128,15 @@ exports.FetchRequest = require_client.FetchRequest;
|
|
|
12
128
|
exports.HybridTrackSource = require_client.HybridTrackSource;
|
|
13
129
|
exports.LiveTrackSource = require_client.LiveTrackSource;
|
|
14
130
|
exports.MOQtailClient = require_client.MOQtailClient;
|
|
15
|
-
exports.MemoryObjectCache =
|
|
131
|
+
exports.MemoryObjectCache = MemoryObjectCache;
|
|
132
|
+
exports.ObjectOrderer = require_client.ObjectOrderer;
|
|
133
|
+
exports.ObjectStream = require_client.ObjectStream;
|
|
16
134
|
exports.PublishNamespaceRequest = require_client.PublishNamespaceRequest;
|
|
17
135
|
exports.PublishPublication = require_client.PublishPublication;
|
|
18
136
|
exports.PublishRequest = require_client.PublishRequest;
|
|
19
|
-
exports.RecvDatagramStream = require_client.RecvDatagramStream;
|
|
20
137
|
exports.RecvStream = require_client.RecvStream;
|
|
21
138
|
exports.RequestStream = require_client.RequestStream;
|
|
22
|
-
exports.RingBufferObjectCache =
|
|
139
|
+
exports.RingBufferObjectCache = RingBufferObjectCache;
|
|
23
140
|
exports.SendDatagramStream = require_client.SendDatagramStream;
|
|
24
141
|
exports.SendStream = require_client.SendStream;
|
|
25
142
|
exports.StaticTrackSource = require_client.StaticTrackSource;
|