@spatialwalk/avatarkit-rtc 1.0.0-beta.1
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 +417 -0
- package/dist/assets/animation-worker-CUXZycUw.js.map +1 -0
- package/dist/core/AnimationHandler.d.ts +17 -0
- package/dist/core/AnimationHandler.d.ts.map +1 -0
- package/dist/core/AvatarPlayer.d.ts +119 -0
- package/dist/core/AvatarPlayer.d.ts.map +1 -0
- package/dist/core/RTCProvider.d.ts +84 -0
- package/dist/core/RTCProvider.d.ts.map +1 -0
- package/dist/core/index.d.ts +7 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/types.d.ts +7 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/index10.js +67 -0
- package/dist/index10.js.map +1 -0
- package/dist/index11.js +390 -0
- package/dist/index11.js.map +1 -0
- package/dist/index12.js +108 -0
- package/dist/index12.js.map +1 -0
- package/dist/index13.js +18 -0
- package/dist/index13.js.map +1 -0
- package/dist/index14.js +48 -0
- package/dist/index14.js.map +1 -0
- package/dist/index15.js +29 -0
- package/dist/index15.js.map +1 -0
- package/dist/index16.js +144 -0
- package/dist/index16.js.map +1 -0
- package/dist/index17.js +106 -0
- package/dist/index17.js.map +1 -0
- package/dist/index18.js +28 -0
- package/dist/index18.js.map +1 -0
- package/dist/index2.js +220 -0
- package/dist/index2.js.map +1 -0
- package/dist/index3.js +586 -0
- package/dist/index3.js.map +1 -0
- package/dist/index4.js +410 -0
- package/dist/index4.js.map +1 -0
- package/dist/index5.js +20 -0
- package/dist/index5.js.map +1 -0
- package/dist/index6.js +282 -0
- package/dist/index6.js.map +1 -0
- package/dist/index7.js +53 -0
- package/dist/index7.js.map +1 -0
- package/dist/index8.js +189 -0
- package/dist/index8.js.map +1 -0
- package/dist/index9.js +178 -0
- package/dist/index9.js.map +1 -0
- package/dist/proto/animation.d.ts +12 -0
- package/dist/proto/animation.d.ts.map +1 -0
- package/dist/providers/agora/AgoraProvider.d.ts +71 -0
- package/dist/providers/agora/AgoraProvider.d.ts.map +1 -0
- package/dist/providers/agora/SEIExtractor.d.ts +29 -0
- package/dist/providers/agora/SEIExtractor.d.ts.map +1 -0
- package/dist/providers/agora/index.d.ts +11 -0
- package/dist/providers/agora/index.d.ts.map +1 -0
- package/dist/providers/agora/types.d.ts +14 -0
- package/dist/providers/agora/types.d.ts.map +1 -0
- package/dist/providers/base/BaseProvider.d.ts +11 -0
- package/dist/providers/base/BaseProvider.d.ts.map +1 -0
- package/dist/providers/index.d.ts +10 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/livekit/LiveKitProvider.d.ts +64 -0
- package/dist/providers/livekit/LiveKitProvider.d.ts.map +1 -0
- package/dist/providers/livekit/VP8Extractor.d.ts +10 -0
- package/dist/providers/livekit/VP8Extractor.d.ts.map +1 -0
- package/dist/providers/livekit/animation-transform.d.ts +11 -0
- package/dist/providers/livekit/animation-transform.d.ts.map +1 -0
- package/dist/providers/livekit/animation-worker.d.ts +14 -0
- package/dist/providers/livekit/animation-worker.d.ts.map +1 -0
- package/dist/providers/livekit/index.d.ts +11 -0
- package/dist/providers/livekit/index.d.ts.map +1 -0
- package/dist/providers/livekit/types.d.ts +11 -0
- package/dist/providers/livekit/types.d.ts.map +1 -0
- package/dist/providers/livekit/utils.d.ts +11 -0
- package/dist/providers/livekit/utils.d.ts.map +1 -0
- package/dist/types/index.d.ts +77 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +13 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/package.json +61 -0
package/dist/index9.js
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { varint64read, varint32read } from "./index16.js";
|
|
2
|
+
import { protoInt64 } from "./index17.js";
|
|
3
|
+
import { getTextEncoding } from "./index18.js";
|
|
4
|
+
var WireType;
|
|
5
|
+
(function(WireType2) {
|
|
6
|
+
WireType2[WireType2["Varint"] = 0] = "Varint";
|
|
7
|
+
WireType2[WireType2["Bit64"] = 1] = "Bit64";
|
|
8
|
+
WireType2[WireType2["LengthDelimited"] = 2] = "LengthDelimited";
|
|
9
|
+
WireType2[WireType2["StartGroup"] = 3] = "StartGroup";
|
|
10
|
+
WireType2[WireType2["EndGroup"] = 4] = "EndGroup";
|
|
11
|
+
WireType2[WireType2["Bit32"] = 5] = "Bit32";
|
|
12
|
+
})(WireType || (WireType = {}));
|
|
13
|
+
class BinaryReader {
|
|
14
|
+
constructor(buf, decodeUtf8 = getTextEncoding().decodeUtf8) {
|
|
15
|
+
this.decodeUtf8 = decodeUtf8;
|
|
16
|
+
this.varint64 = varint64read;
|
|
17
|
+
this.uint32 = varint32read;
|
|
18
|
+
this.buf = buf;
|
|
19
|
+
this.len = buf.length;
|
|
20
|
+
this.pos = 0;
|
|
21
|
+
this.view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Reads a tag - field number and wire type.
|
|
25
|
+
*/
|
|
26
|
+
tag() {
|
|
27
|
+
let tag = this.uint32(), fieldNo = tag >>> 3, wireType = tag & 7;
|
|
28
|
+
if (fieldNo <= 0 || wireType < 0 || wireType > 5)
|
|
29
|
+
throw new Error("illegal tag: field no " + fieldNo + " wire type " + wireType);
|
|
30
|
+
return [fieldNo, wireType];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Skip one element and return the skipped data.
|
|
34
|
+
*
|
|
35
|
+
* When skipping StartGroup, provide the tags field number to check for
|
|
36
|
+
* matching field number in the EndGroup tag.
|
|
37
|
+
*/
|
|
38
|
+
skip(wireType, fieldNo) {
|
|
39
|
+
let start = this.pos;
|
|
40
|
+
switch (wireType) {
|
|
41
|
+
case WireType.Varint:
|
|
42
|
+
while (this.buf[this.pos++] & 128) {
|
|
43
|
+
}
|
|
44
|
+
break;
|
|
45
|
+
// @ts-ignore TS7029: Fallthrough case in switch -- ignore instead of expect-error for compiler settings without noFallthroughCasesInSwitch: true
|
|
46
|
+
case WireType.Bit64:
|
|
47
|
+
this.pos += 4;
|
|
48
|
+
case WireType.Bit32:
|
|
49
|
+
this.pos += 4;
|
|
50
|
+
break;
|
|
51
|
+
case WireType.LengthDelimited:
|
|
52
|
+
let len = this.uint32();
|
|
53
|
+
this.pos += len;
|
|
54
|
+
break;
|
|
55
|
+
case WireType.StartGroup:
|
|
56
|
+
for (; ; ) {
|
|
57
|
+
const [fn, wt] = this.tag();
|
|
58
|
+
if (wt === WireType.EndGroup) {
|
|
59
|
+
if (fieldNo !== void 0 && fn !== fieldNo) {
|
|
60
|
+
throw new Error("invalid end group tag");
|
|
61
|
+
}
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
this.skip(wt, fn);
|
|
65
|
+
}
|
|
66
|
+
break;
|
|
67
|
+
default:
|
|
68
|
+
throw new Error("cant skip wire type " + wireType);
|
|
69
|
+
}
|
|
70
|
+
this.assertBounds();
|
|
71
|
+
return this.buf.subarray(start, this.pos);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Throws error if position in byte array is out of range.
|
|
75
|
+
*/
|
|
76
|
+
assertBounds() {
|
|
77
|
+
if (this.pos > this.len)
|
|
78
|
+
throw new RangeError("premature EOF");
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Read a `int32` field, a signed 32 bit varint.
|
|
82
|
+
*/
|
|
83
|
+
int32() {
|
|
84
|
+
return this.uint32() | 0;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Read a `sint32` field, a signed, zigzag-encoded 32-bit varint.
|
|
88
|
+
*/
|
|
89
|
+
sint32() {
|
|
90
|
+
let zze = this.uint32();
|
|
91
|
+
return zze >>> 1 ^ -(zze & 1);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Read a `int64` field, a signed 64-bit varint.
|
|
95
|
+
*/
|
|
96
|
+
int64() {
|
|
97
|
+
return protoInt64.dec(...this.varint64());
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Read a `uint64` field, an unsigned 64-bit varint.
|
|
101
|
+
*/
|
|
102
|
+
uint64() {
|
|
103
|
+
return protoInt64.uDec(...this.varint64());
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Read a `sint64` field, a signed, zig-zag-encoded 64-bit varint.
|
|
107
|
+
*/
|
|
108
|
+
sint64() {
|
|
109
|
+
let [lo, hi] = this.varint64();
|
|
110
|
+
let s = -(lo & 1);
|
|
111
|
+
lo = (lo >>> 1 | (hi & 1) << 31) ^ s;
|
|
112
|
+
hi = hi >>> 1 ^ s;
|
|
113
|
+
return protoInt64.dec(lo, hi);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Read a `bool` field, a variant.
|
|
117
|
+
*/
|
|
118
|
+
bool() {
|
|
119
|
+
let [lo, hi] = this.varint64();
|
|
120
|
+
return lo !== 0 || hi !== 0;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Read a `fixed32` field, an unsigned, fixed-length 32-bit integer.
|
|
124
|
+
*/
|
|
125
|
+
fixed32() {
|
|
126
|
+
return this.view.getUint32((this.pos += 4) - 4, true);
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Read a `sfixed32` field, a signed, fixed-length 32-bit integer.
|
|
130
|
+
*/
|
|
131
|
+
sfixed32() {
|
|
132
|
+
return this.view.getInt32((this.pos += 4) - 4, true);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Read a `fixed64` field, an unsigned, fixed-length 64 bit integer.
|
|
136
|
+
*/
|
|
137
|
+
fixed64() {
|
|
138
|
+
return protoInt64.uDec(this.sfixed32(), this.sfixed32());
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Read a `fixed64` field, a signed, fixed-length 64-bit integer.
|
|
142
|
+
*/
|
|
143
|
+
sfixed64() {
|
|
144
|
+
return protoInt64.dec(this.sfixed32(), this.sfixed32());
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Read a `float` field, 32-bit floating point number.
|
|
148
|
+
*/
|
|
149
|
+
float() {
|
|
150
|
+
return this.view.getFloat32((this.pos += 4) - 4, true);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Read a `double` field, a 64-bit floating point number.
|
|
154
|
+
*/
|
|
155
|
+
double() {
|
|
156
|
+
return this.view.getFloat64((this.pos += 8) - 8, true);
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Read a `bytes` field, length-delimited arbitrary data.
|
|
160
|
+
*/
|
|
161
|
+
bytes() {
|
|
162
|
+
let len = this.uint32(), start = this.pos;
|
|
163
|
+
this.pos += len;
|
|
164
|
+
this.assertBounds();
|
|
165
|
+
return this.buf.subarray(start, start + len);
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Read a `string` field, length-delimited data converted to UTF-8 text.
|
|
169
|
+
*/
|
|
170
|
+
string() {
|
|
171
|
+
return this.decodeUtf8(this.bytes());
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
export {
|
|
175
|
+
BinaryReader,
|
|
176
|
+
WireType
|
|
177
|
+
};
|
|
178
|
+
//# sourceMappingURL=index9.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index9.js","sources":["../node_modules/.pnpm/@bufbuild+protobuf@2.11.0/node_modules/@bufbuild/protobuf/dist/esm/wire/binary-encoding.js"],"sourcesContent":["// Copyright 2021-2026 Buf Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { varint32read, varint32write, varint64read, varint64write, } from \"./varint.js\";\nimport { protoInt64 } from \"../proto-int64.js\";\nimport { getTextEncoding } from \"./text-encoding.js\";\n/**\n * Protobuf binary format wire types.\n *\n * A wire type provides just enough information to find the length of the\n * following value.\n *\n * See https://developers.google.com/protocol-buffers/docs/encoding#structure\n */\nexport var WireType;\n(function (WireType) {\n /**\n * Used for int32, int64, uint32, uint64, sint32, sint64, bool, enum\n */\n WireType[WireType[\"Varint\"] = 0] = \"Varint\";\n /**\n * Used for fixed64, sfixed64, double.\n * Always 8 bytes with little-endian byte order.\n */\n WireType[WireType[\"Bit64\"] = 1] = \"Bit64\";\n /**\n * Used for string, bytes, embedded messages, packed repeated fields\n *\n * Only repeated numeric types (types which use the varint, 32-bit,\n * or 64-bit wire types) can be packed. In proto3, such fields are\n * packed by default.\n */\n WireType[WireType[\"LengthDelimited\"] = 2] = \"LengthDelimited\";\n /**\n * Start of a tag-delimited aggregate, such as a proto2 group, or a message\n * in editions with message_encoding = DELIMITED.\n */\n WireType[WireType[\"StartGroup\"] = 3] = \"StartGroup\";\n /**\n * End of a tag-delimited aggregate.\n */\n WireType[WireType[\"EndGroup\"] = 4] = \"EndGroup\";\n /**\n * Used for fixed32, sfixed32, float.\n * Always 4 bytes with little-endian byte order.\n */\n WireType[WireType[\"Bit32\"] = 5] = \"Bit32\";\n})(WireType || (WireType = {}));\n/**\n * Maximum value for a 32-bit floating point value (Protobuf FLOAT).\n */\nexport const FLOAT32_MAX = 3.4028234663852886e38;\n/**\n * Minimum value for a 32-bit floating point value (Protobuf FLOAT).\n */\nexport const FLOAT32_MIN = -3.4028234663852886e38;\n/**\n * Maximum value for an unsigned 32-bit integer (Protobuf UINT32, FIXED32).\n */\nexport const UINT32_MAX = 0xffffffff;\n/**\n * Maximum value for a signed 32-bit integer (Protobuf INT32, SFIXED32, SINT32).\n */\nexport const INT32_MAX = 0x7fffffff;\n/**\n * Minimum value for a signed 32-bit integer (Protobuf INT32, SFIXED32, SINT32).\n */\nexport const INT32_MIN = -0x80000000;\nexport class BinaryWriter {\n constructor(encodeUtf8 = getTextEncoding().encodeUtf8) {\n this.encodeUtf8 = encodeUtf8;\n /**\n * Previous fork states.\n */\n this.stack = [];\n this.chunks = [];\n this.buf = [];\n }\n /**\n * Return all bytes written and reset this writer.\n */\n finish() {\n if (this.buf.length) {\n this.chunks.push(new Uint8Array(this.buf)); // flush the buffer\n this.buf = [];\n }\n let len = 0;\n for (let i = 0; i < this.chunks.length; i++)\n len += this.chunks[i].length;\n let bytes = new Uint8Array(len);\n let offset = 0;\n for (let i = 0; i < this.chunks.length; i++) {\n bytes.set(this.chunks[i], offset);\n offset += this.chunks[i].length;\n }\n this.chunks = [];\n return bytes;\n }\n /**\n * Start a new fork for length-delimited data like a message\n * or a packed repeated field.\n *\n * Must be joined later with `join()`.\n */\n fork() {\n this.stack.push({ chunks: this.chunks, buf: this.buf });\n this.chunks = [];\n this.buf = [];\n return this;\n }\n /**\n * Join the last fork. Write its length and bytes, then\n * return to the previous state.\n */\n join() {\n // get chunk of fork\n let chunk = this.finish();\n // restore previous state\n let prev = this.stack.pop();\n if (!prev)\n throw new Error(\"invalid state, fork stack empty\");\n this.chunks = prev.chunks;\n this.buf = prev.buf;\n // write length of chunk as varint\n this.uint32(chunk.byteLength);\n return this.raw(chunk);\n }\n /**\n * Writes a tag (field number and wire type).\n *\n * Equivalent to `uint32( (fieldNo << 3 | type) >>> 0 )`.\n *\n * Generated code should compute the tag ahead of time and call `uint32()`.\n */\n tag(fieldNo, type) {\n return this.uint32(((fieldNo << 3) | type) >>> 0);\n }\n /**\n * Write a chunk of raw bytes.\n */\n raw(chunk) {\n if (this.buf.length) {\n this.chunks.push(new Uint8Array(this.buf));\n this.buf = [];\n }\n this.chunks.push(chunk);\n return this;\n }\n /**\n * Write a `uint32` value, an unsigned 32 bit varint.\n */\n uint32(value) {\n assertUInt32(value);\n // write value as varint 32, inlined for speed\n while (value > 0x7f) {\n this.buf.push((value & 0x7f) | 0x80);\n value = value >>> 7;\n }\n this.buf.push(value);\n return this;\n }\n /**\n * Write a `int32` value, a signed 32 bit varint.\n */\n int32(value) {\n assertInt32(value);\n varint32write(value, this.buf);\n return this;\n }\n /**\n * Write a `bool` value, a variant.\n */\n bool(value) {\n this.buf.push(value ? 1 : 0);\n return this;\n }\n /**\n * Write a `bytes` value, length-delimited arbitrary data.\n */\n bytes(value) {\n this.uint32(value.byteLength); // write length of chunk as varint\n return this.raw(value);\n }\n /**\n * Write a `string` value, length-delimited data converted to UTF-8 text.\n */\n string(value) {\n let chunk = this.encodeUtf8(value);\n this.uint32(chunk.byteLength); // write length of chunk as varint\n return this.raw(chunk);\n }\n /**\n * Write a `float` value, 32-bit floating point number.\n */\n float(value) {\n assertFloat32(value);\n let chunk = new Uint8Array(4);\n new DataView(chunk.buffer).setFloat32(0, value, true);\n return this.raw(chunk);\n }\n /**\n * Write a `double` value, a 64-bit floating point number.\n */\n double(value) {\n let chunk = new Uint8Array(8);\n new DataView(chunk.buffer).setFloat64(0, value, true);\n return this.raw(chunk);\n }\n /**\n * Write a `fixed32` value, an unsigned, fixed-length 32-bit integer.\n */\n fixed32(value) {\n assertUInt32(value);\n let chunk = new Uint8Array(4);\n new DataView(chunk.buffer).setUint32(0, value, true);\n return this.raw(chunk);\n }\n /**\n * Write a `sfixed32` value, a signed, fixed-length 32-bit integer.\n */\n sfixed32(value) {\n assertInt32(value);\n let chunk = new Uint8Array(4);\n new DataView(chunk.buffer).setInt32(0, value, true);\n return this.raw(chunk);\n }\n /**\n * Write a `sint32` value, a signed, zigzag-encoded 32-bit varint.\n */\n sint32(value) {\n assertInt32(value);\n // zigzag encode\n value = ((value << 1) ^ (value >> 31)) >>> 0;\n varint32write(value, this.buf);\n return this;\n }\n /**\n * Write a `fixed64` value, a signed, fixed-length 64-bit integer.\n */\n sfixed64(value) {\n let chunk = new Uint8Array(8), view = new DataView(chunk.buffer), tc = protoInt64.enc(value);\n view.setInt32(0, tc.lo, true);\n view.setInt32(4, tc.hi, true);\n return this.raw(chunk);\n }\n /**\n * Write a `fixed64` value, an unsigned, fixed-length 64 bit integer.\n */\n fixed64(value) {\n let chunk = new Uint8Array(8), view = new DataView(chunk.buffer), tc = protoInt64.uEnc(value);\n view.setInt32(0, tc.lo, true);\n view.setInt32(4, tc.hi, true);\n return this.raw(chunk);\n }\n /**\n * Write a `int64` value, a signed 64-bit varint.\n */\n int64(value) {\n let tc = protoInt64.enc(value);\n varint64write(tc.lo, tc.hi, this.buf);\n return this;\n }\n /**\n * Write a `sint64` value, a signed, zig-zag-encoded 64-bit varint.\n */\n sint64(value) {\n const tc = protoInt64.enc(value), \n // zigzag encode\n sign = tc.hi >> 31, lo = (tc.lo << 1) ^ sign, hi = ((tc.hi << 1) | (tc.lo >>> 31)) ^ sign;\n varint64write(lo, hi, this.buf);\n return this;\n }\n /**\n * Write a `uint64` value, an unsigned 64-bit varint.\n */\n uint64(value) {\n const tc = protoInt64.uEnc(value);\n varint64write(tc.lo, tc.hi, this.buf);\n return this;\n }\n}\nexport class BinaryReader {\n constructor(buf, decodeUtf8 = getTextEncoding().decodeUtf8) {\n this.decodeUtf8 = decodeUtf8;\n this.varint64 = varint64read; // dirty cast for `this`\n /**\n * Read a `uint32` field, an unsigned 32 bit varint.\n */\n this.uint32 = varint32read;\n this.buf = buf;\n this.len = buf.length;\n this.pos = 0;\n this.view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength);\n }\n /**\n * Reads a tag - field number and wire type.\n */\n tag() {\n let tag = this.uint32(), fieldNo = tag >>> 3, wireType = tag & 7;\n if (fieldNo <= 0 || wireType < 0 || wireType > 5)\n throw new Error(\"illegal tag: field no \" + fieldNo + \" wire type \" + wireType);\n return [fieldNo, wireType];\n }\n /**\n * Skip one element and return the skipped data.\n *\n * When skipping StartGroup, provide the tags field number to check for\n * matching field number in the EndGroup tag.\n */\n skip(wireType, fieldNo) {\n let start = this.pos;\n switch (wireType) {\n case WireType.Varint:\n while (this.buf[this.pos++] & 0x80) {\n // ignore\n }\n break;\n // @ts-ignore TS7029: Fallthrough case in switch -- ignore instead of expect-error for compiler settings without noFallthroughCasesInSwitch: true\n case WireType.Bit64:\n this.pos += 4;\n case WireType.Bit32:\n this.pos += 4;\n break;\n case WireType.LengthDelimited:\n let len = this.uint32();\n this.pos += len;\n break;\n case WireType.StartGroup:\n for (;;) {\n const [fn, wt] = this.tag();\n if (wt === WireType.EndGroup) {\n if (fieldNo !== undefined && fn !== fieldNo) {\n throw new Error(\"invalid end group tag\");\n }\n break;\n }\n this.skip(wt, fn);\n }\n break;\n default:\n throw new Error(\"cant skip wire type \" + wireType);\n }\n this.assertBounds();\n return this.buf.subarray(start, this.pos);\n }\n /**\n * Throws error if position in byte array is out of range.\n */\n assertBounds() {\n if (this.pos > this.len)\n throw new RangeError(\"premature EOF\");\n }\n /**\n * Read a `int32` field, a signed 32 bit varint.\n */\n int32() {\n return this.uint32() | 0;\n }\n /**\n * Read a `sint32` field, a signed, zigzag-encoded 32-bit varint.\n */\n sint32() {\n let zze = this.uint32();\n // decode zigzag\n return (zze >>> 1) ^ -(zze & 1);\n }\n /**\n * Read a `int64` field, a signed 64-bit varint.\n */\n int64() {\n return protoInt64.dec(...this.varint64());\n }\n /**\n * Read a `uint64` field, an unsigned 64-bit varint.\n */\n uint64() {\n return protoInt64.uDec(...this.varint64());\n }\n /**\n * Read a `sint64` field, a signed, zig-zag-encoded 64-bit varint.\n */\n sint64() {\n let [lo, hi] = this.varint64();\n // decode zig zag\n let s = -(lo & 1);\n lo = ((lo >>> 1) | ((hi & 1) << 31)) ^ s;\n hi = (hi >>> 1) ^ s;\n return protoInt64.dec(lo, hi);\n }\n /**\n * Read a `bool` field, a variant.\n */\n bool() {\n let [lo, hi] = this.varint64();\n return lo !== 0 || hi !== 0;\n }\n /**\n * Read a `fixed32` field, an unsigned, fixed-length 32-bit integer.\n */\n fixed32() {\n // biome-ignore lint/suspicious/noAssignInExpressions: no\n return this.view.getUint32((this.pos += 4) - 4, true);\n }\n /**\n * Read a `sfixed32` field, a signed, fixed-length 32-bit integer.\n */\n sfixed32() {\n // biome-ignore lint/suspicious/noAssignInExpressions: no\n return this.view.getInt32((this.pos += 4) - 4, true);\n }\n /**\n * Read a `fixed64` field, an unsigned, fixed-length 64 bit integer.\n */\n fixed64() {\n return protoInt64.uDec(this.sfixed32(), this.sfixed32());\n }\n /**\n * Read a `fixed64` field, a signed, fixed-length 64-bit integer.\n */\n sfixed64() {\n return protoInt64.dec(this.sfixed32(), this.sfixed32());\n }\n /**\n * Read a `float` field, 32-bit floating point number.\n */\n float() {\n // biome-ignore lint/suspicious/noAssignInExpressions: no\n return this.view.getFloat32((this.pos += 4) - 4, true);\n }\n /**\n * Read a `double` field, a 64-bit floating point number.\n */\n double() {\n // biome-ignore lint/suspicious/noAssignInExpressions: no\n return this.view.getFloat64((this.pos += 8) - 8, true);\n }\n /**\n * Read a `bytes` field, length-delimited arbitrary data.\n */\n bytes() {\n let len = this.uint32(), start = this.pos;\n this.pos += len;\n this.assertBounds();\n return this.buf.subarray(start, start + len);\n }\n /**\n * Read a `string` field, length-delimited data converted to UTF-8 text.\n */\n string() {\n return this.decodeUtf8(this.bytes());\n }\n}\n/**\n * Assert a valid signed protobuf 32-bit integer as a number or string.\n */\nfunction assertInt32(arg) {\n if (typeof arg == \"string\") {\n arg = Number(arg);\n }\n else if (typeof arg != \"number\") {\n throw new Error(\"invalid int32: \" + typeof arg);\n }\n if (!Number.isInteger(arg) ||\n arg > INT32_MAX ||\n arg < INT32_MIN)\n throw new Error(\"invalid int32: \" + arg);\n}\n/**\n * Assert a valid unsigned protobuf 32-bit integer as a number or string.\n */\nfunction assertUInt32(arg) {\n if (typeof arg == \"string\") {\n arg = Number(arg);\n }\n else if (typeof arg != \"number\") {\n throw new Error(\"invalid uint32: \" + typeof arg);\n }\n if (!Number.isInteger(arg) ||\n arg > UINT32_MAX ||\n arg < 0)\n throw new Error(\"invalid uint32: \" + arg);\n}\n/**\n * Assert a valid protobuf float value as a number or string.\n */\nfunction assertFloat32(arg) {\n if (typeof arg == \"string\") {\n const o = arg;\n arg = Number(arg);\n if (Number.isNaN(arg) && o !== \"NaN\") {\n throw new Error(\"invalid float32: \" + o);\n }\n }\n else if (typeof arg != \"number\") {\n throw new Error(\"invalid float32: \" + typeof arg);\n }\n if (Number.isFinite(arg) &&\n (arg > FLOAT32_MAX || arg < FLOAT32_MIN))\n throw new Error(\"invalid float32: \" + arg);\n}\n"],"names":["WireType"],"mappings":"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","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal protobuf definitions for animation data decoding.
|
|
3
|
+
*
|
|
4
|
+
* This is a stripped-down version containing only the types needed
|
|
5
|
+
* to decode animation frames from the server response.
|
|
6
|
+
*
|
|
7
|
+
* Based on driveningress/v2/driveningress.proto
|
|
8
|
+
*
|
|
9
|
+
* @packageDocumentation
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=animation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../src/proto/animation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { BaseProvider } from '../base/BaseProvider';
|
|
2
|
+
import { RTCConnectionConfig } from '../../types';
|
|
3
|
+
import { AnimationTrackCallbacks, AudioTrackCallbacks } from '../../core/types';
|
|
4
|
+
import { AgoraClient } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Agora Provider.
|
|
7
|
+
*
|
|
8
|
+
* Implements RTCProvider interface for Agora platform.
|
|
9
|
+
* Uses native SEI events to receive animation data from H.264 video tracks.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import { AvatarPlayer } from '@spatialwalk/avatarkit-rtc';
|
|
14
|
+
* import { AgoraProvider } from '@spatialwalk/avatarkit-rtc/providers/agora';
|
|
15
|
+
*
|
|
16
|
+
* const provider = new AgoraProvider();
|
|
17
|
+
* const player = new AvatarPlayer(provider, renderer);
|
|
18
|
+
*
|
|
19
|
+
* await player.connect({
|
|
20
|
+
* appId: 'your-agora-app-id',
|
|
21
|
+
* channel: 'your-channel',
|
|
22
|
+
* token: 'your-token',
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare class AgoraProvider extends BaseProvider {
|
|
27
|
+
/** Provider name identifier */
|
|
28
|
+
readonly name = "agora";
|
|
29
|
+
constructor(_options?: AgoraProviderOptions);
|
|
30
|
+
/**
|
|
31
|
+
* Enable or disable debug logging.
|
|
32
|
+
* @param enabled - Whether to enable debug logging
|
|
33
|
+
*/
|
|
34
|
+
setDebugLogging(enabled: boolean): void;
|
|
35
|
+
connect(config: RTCConnectionConfig): Promise<void>;
|
|
36
|
+
disconnect(): Promise<void>;
|
|
37
|
+
getConnectionState(): string;
|
|
38
|
+
subscribeAnimationTrack(callbacks: AnimationTrackCallbacks): Promise<void>;
|
|
39
|
+
unsubscribeAnimationTrack(): Promise<void>;
|
|
40
|
+
subscribeAudioTrack(callbacks: AudioTrackCallbacks): Promise<void>;
|
|
41
|
+
unsubscribeAudioTrack(): Promise<void>;
|
|
42
|
+
publishAudioTrack(track?: MediaStreamTrack): Promise<void>;
|
|
43
|
+
unpublishAudioTrack(): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Play remote audio (resume playback)
|
|
46
|
+
*/
|
|
47
|
+
playRemoteAudio(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Pause remote audio
|
|
50
|
+
*/
|
|
51
|
+
pauseRemoteAudio(): void;
|
|
52
|
+
/**
|
|
53
|
+
* Get the native Agora RTC Client instance.
|
|
54
|
+
*
|
|
55
|
+
* Allows advanced users to access Agora-specific features
|
|
56
|
+
* not exposed through the unified API.
|
|
57
|
+
*
|
|
58
|
+
* @returns The Agora IAgoraRTCClient instance, or null if not connected
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```typescript
|
|
62
|
+
* const client = provider.getNativeClient();
|
|
63
|
+
* if (client) {
|
|
64
|
+
* // Access Agora-specific features
|
|
65
|
+
* console.log('Connection state:', client.connectionState);
|
|
66
|
+
* }
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
getNativeClient(): AgoraClient | null;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=AgoraProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgoraProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/agora/AgoraProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAyB,MAAM,aAAa,CAAC;AAE9E,OAAO,KAAK,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAGrF,OAAO,KAAK,EACV,WAAW,EAKZ,MAAM,SAAS,CAAC;AAoBjB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,aAAc,SAAQ,YAAY;IAC7C,+BAA+B;IAC/B,QAAQ,CAAC,IAAI,WAAW;gBA8BZ,QAAQ,GAAE,oBAAyB;IAI/C;;;OAGG;IACH,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAiCjC,OAAO,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAyOnD,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAUjC,kBAAkB,IAAI,MAAM;IAOtB,uBAAuB,CAAC,SAAS,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;IA2B1E,yBAAyB,IAAI,OAAO,CAAC,IAAI,CAAC;IAyB1C,mBAAmB,CAAC,SAAS,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAKlE,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC;IAQtC,iBAAiB,CAAC,KAAK,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IA0B1D,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAU1C;;OAEG;IACH,eAAe,IAAI,IAAI;IAMvB;;OAEG;IACH,gBAAgB,IAAI,IAAI;IAMxB;;;;;;;;;;;;;;;;OAgBG;IACH,eAAe,IAAI,WAAW,GAAG,IAAI;CA6CtC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SEI Data Extractor for Agora.
|
|
3
|
+
*
|
|
4
|
+
* Extracts animation data from Agora's H.264 SEI events.
|
|
5
|
+
*
|
|
6
|
+
* SEI Packet Format:
|
|
7
|
+
* ```
|
|
8
|
+
* [1B flags][4B msgLen (LE)][msgLen bytes compressed data]
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* Packet Flags:
|
|
12
|
+
* - 0x01: Idle (no payload)
|
|
13
|
+
* - 0x02: Start (first frame of session)
|
|
14
|
+
* - 0x04: End (last frame of session)
|
|
15
|
+
* - 0x08: Gzipped (payload is zlib compressed)
|
|
16
|
+
* - 0x10: Transition (transition from idle to animation)
|
|
17
|
+
* - 0x20: TransitionEnd (transition from animation back to idle)
|
|
18
|
+
*
|
|
19
|
+
* Key differences from LiveKit VP8Extractor:
|
|
20
|
+
* - No VP8 header parsing needed
|
|
21
|
+
* - No ALR (Application-Level Redundancy) - Agora handles reliability
|
|
22
|
+
* - Uses native SEI events instead of RTCRtpScriptTransform
|
|
23
|
+
* - Requires EBSP to RBSP conversion (H.264 emulation prevention byte removal)
|
|
24
|
+
*
|
|
25
|
+
* @internal
|
|
26
|
+
* @packageDocumentation
|
|
27
|
+
*/
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=SEIExtractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SEIExtractor.d.ts","sourceRoot":"","sources":["../../../src/providers/agora/SEIExtractor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IAgoraRTCClient } from 'agora-rtc-sdk-ng';
|
|
2
|
+
/**
|
|
3
|
+
* Agora Provider exports.
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
export { AgoraProvider, type AgoraProviderOptions } from './AgoraProvider';
|
|
7
|
+
/**
|
|
8
|
+
* Agora RTC Client type - the native client returned by AgoraProvider.getNativeClient()
|
|
9
|
+
*/
|
|
10
|
+
export type AgoraClient = IAgoraRTCClient;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/agora/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAG3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,eAAe,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agora SDK type definitions.
|
|
3
|
+
*
|
|
4
|
+
* These types are used for static type checking while the SDK is loaded dynamically.
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Agora RTC Client type.
|
|
11
|
+
* Exported publicly via providers/agora/index.ts
|
|
12
|
+
*/
|
|
13
|
+
export type AgoraClient = IAgoraRTCClient;
|
|
14
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/providers/agora/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA6BH;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,eAAe,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base Provider - Common implementation for RTC providers.
|
|
3
|
+
*
|
|
4
|
+
* This class provides common functionality that can be shared
|
|
5
|
+
* across different provider implementations.
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=BaseProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/base/BaseProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RTC Provider exports.
|
|
3
|
+
* All providers are exported from here for convenience.
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
export { LiveKitProvider } from './livekit';
|
|
7
|
+
export type { LiveKitRoom } from './livekit';
|
|
8
|
+
export { AgoraProvider, type AgoraProviderOptions } from './agora';
|
|
9
|
+
export type { AgoraClient } from './agora';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACnE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { BaseProvider } from '../base/BaseProvider';
|
|
2
|
+
import { RTCConnectionConfig } from '../../types';
|
|
3
|
+
import { AnimationTrackCallbacks, AudioTrackCallbacks } from '../../core/types';
|
|
4
|
+
import { LiveKitRoom } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* LiveKit Provider.
|
|
7
|
+
*
|
|
8
|
+
* Implements RTCProvider interface for LiveKit platform.
|
|
9
|
+
* Uses RTCRtpScriptTransform to extract animation data from VP8 video tracks.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import { AvatarPlayer, LiveKitProvider } from '@spatialwalk/avatarkit-rtc';
|
|
14
|
+
*
|
|
15
|
+
* const provider = new LiveKitProvider();
|
|
16
|
+
* const player = new AvatarPlayer(provider, renderer);
|
|
17
|
+
*
|
|
18
|
+
* await player.connect({
|
|
19
|
+
* url: 'wss://your-livekit-server.com',
|
|
20
|
+
* token: 'your-token',
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare class LiveKitProvider extends BaseProvider {
|
|
25
|
+
/** Provider name identifier */
|
|
26
|
+
readonly name = "livekit";
|
|
27
|
+
constructor();
|
|
28
|
+
connect(config: RTCConnectionConfig): Promise<void>;
|
|
29
|
+
disconnect(): Promise<void>;
|
|
30
|
+
getConnectionState(): string;
|
|
31
|
+
subscribeAnimationTrack(callbacks: AnimationTrackCallbacks): Promise<void>;
|
|
32
|
+
unsubscribeAnimationTrack(): Promise<void>;
|
|
33
|
+
subscribeAudioTrack(callbacks: AudioTrackCallbacks): Promise<void>;
|
|
34
|
+
unsubscribeAudioTrack(): Promise<void>;
|
|
35
|
+
publishAudioTrack(track: MediaStreamTrack): Promise<void>;
|
|
36
|
+
unpublishAudioTrack(): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Play remote audio (resume playback)
|
|
39
|
+
*/
|
|
40
|
+
playRemoteAudio(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Pause remote audio
|
|
43
|
+
*/
|
|
44
|
+
pauseRemoteAudio(): void;
|
|
45
|
+
/**
|
|
46
|
+
* Get the native LiveKit Room instance.
|
|
47
|
+
*
|
|
48
|
+
* Allows advanced users to access LiveKit-specific features
|
|
49
|
+
* not exposed through the unified API.
|
|
50
|
+
*
|
|
51
|
+
* @returns The LiveKit Room instance, or null if not connected
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```typescript
|
|
55
|
+
* const room = provider.getNativeClient();
|
|
56
|
+
* if (room) {
|
|
57
|
+
* // Access LiveKit-specific features
|
|
58
|
+
* console.log('Participants:', room.remoteParticipants.size);
|
|
59
|
+
* }
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
getNativeClient(): LiveKitRoom | null;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=LiveKitProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveKitProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/livekit/LiveKitProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAA2B,MAAM,aAAa,CAAC;AAEhF,OAAO,KAAK,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAIrF,OAAO,KAAK,EAEV,WAAW,EAEZ,MAAM,SAAS,CAAC;AAoFjB;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,eAAgB,SAAQ,YAAY;IAC/C,+BAA+B;IAC/B,QAAQ,CAAC,IAAI,aAAa;;IAgPpB,OAAO,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAgLnD,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAUjC,kBAAkB,IAAI,MAAM;IAOtB,uBAAuB,CAAC,SAAS,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;IAqC1E,yBAAyB,IAAI,OAAO,CAAC,IAAI,CAAC;IAiB1C,mBAAmB,CAAC,SAAS,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAKlE,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC;IAStC,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAyCzD,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAW1C;;OAEG;IACH,eAAe,IAAI,IAAI;IAQvB;;OAEG;IACH,gBAAgB,IAAI,IAAI;IAQxB;;;;;;;;;;;;;;;;OAgBG;IACH,eAAe,IAAI,WAAW,GAAG,IAAI;CA+BtC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VP8Extractor.d.ts","sourceRoot":"","sources":["../../../src/providers/livekit/VP8Extractor.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Animation Transform for Video Track.
|
|
3
|
+
*
|
|
4
|
+
* Uses RTCRtpScriptTransform to extract animation data from the video track.
|
|
5
|
+
* The video track carries animation data in binary format (not actual video).
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
export { METADATA_FIXED_HEADER_SIZE, PACKET_FLAGS } from './types';
|
|
11
|
+
//# sourceMappingURL=animation-transform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animation-transform.d.ts","sourceRoot":"","sources":["../../../src/providers/livekit/animation-transform.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,EAAE,0BAA0B,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RTCRtpScriptTransform Worker for Animation Track (VP8 Video)
|
|
3
|
+
*
|
|
4
|
+
* This worker handles extracting animation data from VP8 video frames.
|
|
5
|
+
* The server prepends a minimal VP8 header to trick the browser's depacketizer.
|
|
6
|
+
*
|
|
7
|
+
* Frame format after depacketization (VP8 descriptor is stripped by depacketizer):
|
|
8
|
+
* [0-9] VP8 frame header (10 bytes) - minimal keyframe structure, skipped
|
|
9
|
+
* [10] flags (uint8) - packet flags
|
|
10
|
+
* [11-14] msgLen (little-endian u32) - length of protobuf message
|
|
11
|
+
* [15..15+msgLen) protobuf Message binary
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=animation-worker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animation-worker.d.ts","sourceRoot":"","sources":["../../../src/providers/livekit/animation-worker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAgjBH,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Room } from 'livekit-client';
|
|
2
|
+
/**
|
|
3
|
+
* LiveKit Provider exports.
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
export { LiveKitProvider } from './LiveKitProvider';
|
|
7
|
+
/**
|
|
8
|
+
* LiveKit Room type - the native client returned by LiveKitProvider.getNativeClient()
|
|
9
|
+
*/
|
|
10
|
+
export type LiveKitRoom = Room;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/livekit/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAC3C;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/providers/livekit/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAiBH;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Insertable Streams utilities.
|
|
3
|
+
*
|
|
4
|
+
* Note: Audio tracks no longer embed metadata - animation data is now sent via a separate video track.
|
|
5
|
+
* These utilities are kept for potential future use and backwards compatibility.
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/providers/livekit/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|