@livekit/rtc-node 0.11.0 → 0.12.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/dist/audio_frame.cjs +94 -0
- package/dist/audio_frame.cjs.map +1 -0
- package/dist/audio_frame.js +64 -67
- package/dist/audio_frame.js.map +1 -1
- package/dist/audio_resampler.cjs +153 -0
- package/dist/audio_resampler.cjs.map +1 -0
- package/dist/audio_resampler.js +129 -134
- package/dist/audio_resampler.js.map +1 -1
- package/dist/audio_source.cjs +116 -0
- package/dist/audio_source.cjs.map +1 -0
- package/dist/audio_source.js +92 -85
- package/dist/audio_source.js.map +1 -1
- package/dist/audio_stream.cjs +104 -0
- package/dist/audio_stream.cjs.map +1 -0
- package/dist/audio_stream.js +77 -78
- package/dist/audio_stream.js.map +1 -1
- package/dist/e2ee.cjs +268 -0
- package/dist/e2ee.cjs.map +1 -0
- package/dist/e2ee.d.ts.map +1 -1
- package/dist/e2ee.js +244 -221
- package/dist/e2ee.js.map +1 -1
- package/dist/ffi_client.cjs +101 -0
- package/dist/ffi_client.cjs.map +1 -0
- package/dist/ffi_client.js +73 -48
- package/dist/ffi_client.js.map +1 -1
- package/dist/index.cjs +188 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +130 -48
- package/dist/index.js.map +1 -1
- package/dist/napi/native.d.cjs +17 -0
- package/dist/napi/native.d.cjs.map +1 -0
- package/dist/napi/native.d.js +1 -0
- package/dist/napi/native.d.js.map +1 -0
- package/dist/napi/native.d.ts +5 -5
- package/dist/native.cjs +301 -0
- package/dist/native.d.ts +19 -0
- package/dist/native.js +15 -0
- package/dist/participant.cjs +388 -0
- package/dist/participant.cjs.map +1 -0
- package/dist/participant.js +363 -339
- package/dist/participant.js.map +1 -1
- package/dist/proto/audio_frame_pb.cjs +193 -0
- package/dist/proto/audio_frame_pb.cjs.map +1 -0
- package/dist/proto/audio_frame_pb.d.ts +8 -8
- package/dist/proto/audio_frame_pb.d.ts.map +1 -1
- package/dist/proto/audio_frame_pb.js +122 -322
- package/dist/proto/audio_frame_pb.js.map +1 -1
- package/dist/proto/e2ee_pb.cjs +131 -0
- package/dist/proto/e2ee_pb.cjs.map +1 -0
- package/dist/proto/e2ee_pb.js +76 -202
- package/dist/proto/e2ee_pb.js.map +1 -1
- package/dist/proto/ffi_pb.cjs +76 -0
- package/dist/proto/ffi_pb.cjs.map +1 -0
- package/dist/proto/ffi_pb.d.ts +6 -6
- package/dist/proto/ffi_pb.d.ts.map +1 -1
- package/dist/proto/ffi_pb.js +39 -98
- package/dist/proto/ffi_pb.js.map +1 -1
- package/dist/proto/handle_pb.cjs +33 -0
- package/dist/proto/handle_pb.cjs.map +1 -0
- package/dist/proto/handle_pb.js +6 -22
- package/dist/proto/handle_pb.js.map +1 -1
- package/dist/proto/participant_pb.cjs +50 -0
- package/dist/proto/participant_pb.cjs.map +1 -0
- package/dist/proto/participant_pb.d.ts +1 -1
- package/dist/proto/participant_pb.d.ts.map +1 -1
- package/dist/proto/participant_pb.js +20 -58
- package/dist/proto/participant_pb.js.map +1 -1
- package/dist/proto/room_pb.cjs +370 -0
- package/dist/proto/room_pb.cjs.map +1 -0
- package/dist/proto/room_pb.d.ts +16 -16
- package/dist/proto/room_pb.d.ts.map +1 -1
- package/dist/proto/room_pb.js +245 -638
- package/dist/proto/room_pb.js.map +1 -1
- package/dist/proto/rpc_pb.cjs +63 -0
- package/dist/proto/rpc_pb.cjs.map +1 -0
- package/dist/proto/rpc_pb.js +26 -72
- package/dist/proto/rpc_pb.js.map +1 -1
- package/dist/proto/stats_pb.cjs +256 -0
- package/dist/proto/stats_pb.cjs.map +1 -0
- package/dist/proto/stats_pb.js +175 -456
- package/dist/proto/stats_pb.js.map +1 -1
- package/dist/proto/track_pb.cjs +116 -0
- package/dist/proto/track_pb.cjs.map +1 -0
- package/dist/proto/track_pb.d.ts +3 -3
- package/dist/proto/track_pb.d.ts.map +1 -1
- package/dist/proto/track_pb.js +68 -174
- package/dist/proto/track_pb.js.map +1 -1
- package/dist/proto/video_frame_pb.cjs +161 -0
- package/dist/proto/video_frame_pb.cjs.map +1 -0
- package/dist/proto/video_frame_pb.d.ts +5 -5
- package/dist/proto/video_frame_pb.d.ts.map +1 -1
- package/dist/proto/video_frame_pb.js +103 -271
- package/dist/proto/video_frame_pb.js.map +1 -1
- package/dist/room.cjs +440 -0
- package/dist/room.cjs.map +1 -0
- package/dist/room.js +384 -373
- package/dist/room.js.map +1 -1
- package/dist/rpc.cjs +89 -0
- package/dist/rpc.cjs.map +1 -0
- package/dist/rpc.js +59 -63
- package/dist/rpc.js.map +1 -1
- package/dist/track.cjs +100 -0
- package/dist/track.cjs.map +1 -0
- package/dist/track.js +66 -62
- package/dist/track.js.map +1 -1
- package/dist/track_publication.cjs +106 -0
- package/dist/track_publication.cjs.map +1 -0
- package/dist/track_publication.js +76 -74
- package/dist/track_publication.js.map +1 -1
- package/dist/transcription.cjs +17 -0
- package/dist/transcription.cjs.map +1 -0
- package/dist/transcription.js +0 -1
- package/dist/transcription.js.map +1 -1
- package/dist/types.cjs +17 -0
- package/dist/types.cjs.map +1 -0
- package/dist/types.js +0 -1
- package/dist/types.js.map +1 -1
- package/dist/version.cjs +29 -0
- package/dist/version.cjs.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +4 -1
- package/dist/version.js.map +1 -1
- package/dist/video_frame.cjs +242 -0
- package/dist/video_frame.cjs.map +1 -0
- package/dist/video_frame.js +212 -201
- package/dist/video_frame.js.map +1 -1
- package/dist/video_source.cjs +63 -0
- package/dist/video_source.cjs.map +1 -0
- package/dist/video_source.d.ts.map +1 -1
- package/dist/video_source.js +42 -37
- package/dist/video_source.js.map +1 -1
- package/dist/video_stream.cjs +103 -0
- package/dist/video_stream.cjs.map +1 -0
- package/dist/video_stream.js +76 -77
- package/dist/video_stream.js.map +1 -1
- package/package.json +18 -9
- package/src/audio_frame.ts +2 -2
- package/src/audio_source.ts +2 -2
- package/src/e2ee.ts +2 -2
- package/src/napi/native.d.ts +5 -5
- package/src/proto/audio_frame_pb.ts +12 -12
- package/src/proto/e2ee_pb.ts +1 -1
- package/src/proto/ffi_pb.ts +13 -13
- package/src/proto/handle_pb.ts +1 -1
- package/src/proto/participant_pb.ts +3 -3
- package/src/proto/room_pb.ts +24 -24
- package/src/proto/rpc_pb.ts +1 -1
- package/src/proto/stats_pb.ts +1 -1
- package/src/proto/track_pb.ts +7 -7
- package/src/proto/video_frame_pb.ts +9 -9
- package/src/version.ts +1 -1
- package/src/video_frame.ts +1 -1
- package/src/video_source.ts +5 -1
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var video_stream_exports = {};
|
|
20
|
+
__export(video_stream_exports, {
|
|
21
|
+
VideoStream: () => VideoStream
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(video_stream_exports);
|
|
24
|
+
var import_protobuf = require("@bufbuild/protobuf");
|
|
25
|
+
var import_mutex = require("@livekit/mutex");
|
|
26
|
+
var import_ffi_client = require("./ffi_client.cjs");
|
|
27
|
+
var import_video_frame_pb = require("./proto/video_frame_pb.cjs");
|
|
28
|
+
var import_video_frame = require("./video_frame.cjs");
|
|
29
|
+
class VideoStream {
|
|
30
|
+
constructor(track) {
|
|
31
|
+
/** @internal */
|
|
32
|
+
this.eventQueue = [];
|
|
33
|
+
/** @internal */
|
|
34
|
+
this.queueResolve = null;
|
|
35
|
+
/** @internal */
|
|
36
|
+
this.mutex = new import_mutex.Mutex();
|
|
37
|
+
this.onEvent = (ev) => {
|
|
38
|
+
if (ev.message.case != "videoStreamEvent" || ev.message.value.streamHandle != this.ffiHandle.handle) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const streamEvent = ev.message.value.message;
|
|
42
|
+
switch (streamEvent.case) {
|
|
43
|
+
case "frameReceived":
|
|
44
|
+
const rotation = streamEvent.value.rotation;
|
|
45
|
+
const timestampUs = streamEvent.value.timestampUs;
|
|
46
|
+
const frame = import_video_frame.VideoFrame.fromOwnedInfo(streamEvent.value.buffer);
|
|
47
|
+
const value = { rotation, timestampUs, frame };
|
|
48
|
+
if (this.queueResolve) {
|
|
49
|
+
this.queueResolve({ done: false, value });
|
|
50
|
+
} else {
|
|
51
|
+
this.eventQueue.push(value);
|
|
52
|
+
}
|
|
53
|
+
break;
|
|
54
|
+
case "eos":
|
|
55
|
+
import_ffi_client.FfiClient.instance.off(import_ffi_client.FfiClientEvent.FfiEvent, this.onEvent);
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
this.track = track;
|
|
60
|
+
const req = (0, import_protobuf.create)(import_video_frame_pb.NewVideoStreamRequestSchema, {
|
|
61
|
+
type: import_video_frame_pb.VideoStreamType.VIDEO_STREAM_NATIVE,
|
|
62
|
+
trackHandle: track.ffi_handle.handle
|
|
63
|
+
});
|
|
64
|
+
const res = import_ffi_client.FfiClient.instance.request({
|
|
65
|
+
message: {
|
|
66
|
+
case: "newVideoStream",
|
|
67
|
+
value: req
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
this.info = res.stream.info;
|
|
71
|
+
this.ffiHandle = new import_ffi_client.FfiHandle(res.stream.handle.id);
|
|
72
|
+
import_ffi_client.FfiClient.instance.on(import_ffi_client.FfiClientEvent.FfiEvent, this.onEvent);
|
|
73
|
+
}
|
|
74
|
+
async next() {
|
|
75
|
+
const unlock = await this.mutex.lock();
|
|
76
|
+
if (this.eventQueue.length > 0) {
|
|
77
|
+
unlock();
|
|
78
|
+
const value = this.eventQueue.shift();
|
|
79
|
+
if (value) {
|
|
80
|
+
return { done: false, value };
|
|
81
|
+
} else {
|
|
82
|
+
return { done: true, value: void 0 };
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
const promise = new Promise(
|
|
86
|
+
(resolve) => this.queueResolve = resolve
|
|
87
|
+
);
|
|
88
|
+
unlock();
|
|
89
|
+
return promise;
|
|
90
|
+
}
|
|
91
|
+
close() {
|
|
92
|
+
this.eventQueue.push(null);
|
|
93
|
+
this.ffiHandle.dispose();
|
|
94
|
+
}
|
|
95
|
+
[Symbol.asyncIterator]() {
|
|
96
|
+
return this;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
100
|
+
0 && (module.exports = {
|
|
101
|
+
VideoStream
|
|
102
|
+
});
|
|
103
|
+
//# sourceMappingURL=video_stream.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/video_stream.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport { create } from '@bufbuild/protobuf';\nimport { Mutex } from '@livekit/mutex';\nimport type { FfiEvent } from './ffi_client.js';\nimport { FfiClient, FfiClientEvent, FfiHandle } from './ffi_client.js';\nimport type {\n NewVideoStreamResponse,\n VideoRotation,\n VideoStreamInfo,\n} from './proto/video_frame_pb.js';\nimport { NewVideoStreamRequestSchema, VideoStreamType } from './proto/video_frame_pb.js';\nimport type { Track } from './track.js';\nimport { VideoFrame } from './video_frame.js';\n\nexport type VideoFrameEvent = {\n frame: VideoFrame;\n timestampUs: bigint;\n rotation: VideoRotation;\n};\n\nexport class VideoStream implements AsyncIterableIterator<VideoFrameEvent> {\n /** @internal */\n info: VideoStreamInfo;\n /** @internal */\n ffiHandle: FfiHandle;\n /** @internal */\n eventQueue: (VideoFrameEvent | null)[] = [];\n /** @internal */\n queueResolve: ((value: IteratorResult<VideoFrameEvent>) => void) | null = null;\n /** @internal */\n mutex = new Mutex();\n\n track: Track;\n\n constructor(track: Track) {\n this.track = track;\n\n const req = create(NewVideoStreamRequestSchema, {\n type: VideoStreamType.VIDEO_STREAM_NATIVE,\n trackHandle: track.ffi_handle.handle,\n });\n\n const res = FfiClient.instance.request<NewVideoStreamResponse>({\n message: {\n case: 'newVideoStream',\n value: req,\n },\n });\n\n this.info = res.stream!.info!;\n this.ffiHandle = new FfiHandle(res.stream!.handle!.id);\n\n FfiClient.instance.on(FfiClientEvent.FfiEvent, this.onEvent);\n }\n\n private onEvent = (ev: FfiEvent) => {\n if (\n ev.message.case != 'videoStreamEvent' ||\n ev.message.value.streamHandle != this.ffiHandle.handle\n ) {\n return;\n }\n\n const streamEvent = ev.message.value.message;\n switch (streamEvent.case) {\n case 'frameReceived':\n const rotation = streamEvent.value.rotation;\n const timestampUs = streamEvent.value.timestampUs;\n const frame = VideoFrame.fromOwnedInfo(streamEvent.value.buffer!);\n const value = { rotation, timestampUs, frame };\n if (this.queueResolve) {\n this.queueResolve({ done: false, value });\n } else {\n this.eventQueue.push(value);\n }\n break;\n case 'eos':\n FfiClient.instance.off(FfiClientEvent.FfiEvent, this.onEvent);\n break;\n }\n };\n\n async next(): Promise<IteratorResult<VideoFrameEvent>> {\n const unlock = await this.mutex.lock();\n if (this.eventQueue.length > 0) {\n unlock();\n const value = this.eventQueue.shift();\n if (value) {\n return { done: false, value };\n } else {\n return { done: true, value: undefined };\n }\n }\n const promise = new Promise<IteratorResult<VideoFrameEvent>>(\n (resolve) => (this.queueResolve = resolve),\n );\n unlock();\n return promise;\n }\n\n close() {\n this.eventQueue.push(null);\n this.ffiHandle.dispose();\n }\n\n [Symbol.asyncIterator](): VideoStream {\n return this;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,sBAAuB;AACvB,mBAAsB;AAEtB,wBAAqD;AAMrD,4BAA6D;AAE7D,yBAA2B;AAQpB,MAAM,YAA8D;AAAA,EAczE,YAAY,OAAc;AAR1B;AAAA,sBAAyC,CAAC;AAE1C;AAAA,wBAA0E;AAE1E;AAAA,iBAAQ,IAAI,mBAAM;AAyBlB,SAAQ,UAAU,CAAC,OAAiB;AAClC,UACE,GAAG,QAAQ,QAAQ,sBACnB,GAAG,QAAQ,MAAM,gBAAgB,KAAK,UAAU,QAChD;AACA;AAAA,MACF;AAEA,YAAM,cAAc,GAAG,QAAQ,MAAM;AACrC,cAAQ,YAAY,MAAM;AAAA,QACxB,KAAK;AACH,gBAAM,WAAW,YAAY,MAAM;AACnC,gBAAM,cAAc,YAAY,MAAM;AACtC,gBAAM,QAAQ,8BAAW,cAAc,YAAY,MAAM,MAAO;AAChE,gBAAM,QAAQ,EAAE,UAAU,aAAa,MAAM;AAC7C,cAAI,KAAK,cAAc;AACrB,iBAAK,aAAa,EAAE,MAAM,OAAO,MAAM,CAAC;AAAA,UAC1C,OAAO;AACL,iBAAK,WAAW,KAAK,KAAK;AAAA,UAC5B;AACA;AAAA,QACF,KAAK;AACH,sCAAU,SAAS,IAAI,iCAAe,UAAU,KAAK,OAAO;AAC5D;AAAA,MACJ;AAAA,IACF;AA7CE,SAAK,QAAQ;AAEb,UAAM,UAAM,wBAAO,mDAA6B;AAAA,MAC9C,MAAM,sCAAgB;AAAA,MACtB,aAAa,MAAM,WAAW;AAAA,IAChC,CAAC;AAED,UAAM,MAAM,4BAAU,SAAS,QAAgC;AAAA,MAC7D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|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
if (value) {
|
|
62
|
-
return { done: false, value };
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
return { done: true, value: undefined };
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
const promise = new Promise((resolve) => (this.queueResolve = resolve));
|
|
69
|
-
unlock();
|
|
70
|
-
return promise;
|
|
71
|
-
}
|
|
72
|
-
close() {
|
|
73
|
-
this.eventQueue.push(null);
|
|
74
|
-
this.ffiHandle.dispose();
|
|
75
|
-
}
|
|
76
|
-
[Symbol.asyncIterator]() {
|
|
77
|
-
return this;
|
|
1
|
+
import { create } from "@bufbuild/protobuf";
|
|
2
|
+
import { Mutex } from "@livekit/mutex";
|
|
3
|
+
import { FfiClient, FfiClientEvent, FfiHandle } from "./ffi_client.js";
|
|
4
|
+
import { NewVideoStreamRequestSchema, VideoStreamType } from "./proto/video_frame_pb.js";
|
|
5
|
+
import { VideoFrame } from "./video_frame.js";
|
|
6
|
+
class VideoStream {
|
|
7
|
+
constructor(track) {
|
|
8
|
+
/** @internal */
|
|
9
|
+
this.eventQueue = [];
|
|
10
|
+
/** @internal */
|
|
11
|
+
this.queueResolve = null;
|
|
12
|
+
/** @internal */
|
|
13
|
+
this.mutex = new Mutex();
|
|
14
|
+
this.onEvent = (ev) => {
|
|
15
|
+
if (ev.message.case != "videoStreamEvent" || ev.message.value.streamHandle != this.ffiHandle.handle) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const streamEvent = ev.message.value.message;
|
|
19
|
+
switch (streamEvent.case) {
|
|
20
|
+
case "frameReceived":
|
|
21
|
+
const rotation = streamEvent.value.rotation;
|
|
22
|
+
const timestampUs = streamEvent.value.timestampUs;
|
|
23
|
+
const frame = VideoFrame.fromOwnedInfo(streamEvent.value.buffer);
|
|
24
|
+
const value = { rotation, timestampUs, frame };
|
|
25
|
+
if (this.queueResolve) {
|
|
26
|
+
this.queueResolve({ done: false, value });
|
|
27
|
+
} else {
|
|
28
|
+
this.eventQueue.push(value);
|
|
29
|
+
}
|
|
30
|
+
break;
|
|
31
|
+
case "eos":
|
|
32
|
+
FfiClient.instance.off(FfiClientEvent.FfiEvent, this.onEvent);
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
this.track = track;
|
|
37
|
+
const req = create(NewVideoStreamRequestSchema, {
|
|
38
|
+
type: VideoStreamType.VIDEO_STREAM_NATIVE,
|
|
39
|
+
trackHandle: track.ffi_handle.handle
|
|
40
|
+
});
|
|
41
|
+
const res = FfiClient.instance.request({
|
|
42
|
+
message: {
|
|
43
|
+
case: "newVideoStream",
|
|
44
|
+
value: req
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
this.info = res.stream.info;
|
|
48
|
+
this.ffiHandle = new FfiHandle(res.stream.handle.id);
|
|
49
|
+
FfiClient.instance.on(FfiClientEvent.FfiEvent, this.onEvent);
|
|
50
|
+
}
|
|
51
|
+
async next() {
|
|
52
|
+
const unlock = await this.mutex.lock();
|
|
53
|
+
if (this.eventQueue.length > 0) {
|
|
54
|
+
unlock();
|
|
55
|
+
const value = this.eventQueue.shift();
|
|
56
|
+
if (value) {
|
|
57
|
+
return { done: false, value };
|
|
58
|
+
} else {
|
|
59
|
+
return { done: true, value: void 0 };
|
|
60
|
+
}
|
|
78
61
|
}
|
|
62
|
+
const promise = new Promise(
|
|
63
|
+
(resolve) => this.queueResolve = resolve
|
|
64
|
+
);
|
|
65
|
+
unlock();
|
|
66
|
+
return promise;
|
|
67
|
+
}
|
|
68
|
+
close() {
|
|
69
|
+
this.eventQueue.push(null);
|
|
70
|
+
this.ffiHandle.dispose();
|
|
71
|
+
}
|
|
72
|
+
[Symbol.asyncIterator]() {
|
|
73
|
+
return this;
|
|
74
|
+
}
|
|
79
75
|
}
|
|
76
|
+
export {
|
|
77
|
+
VideoStream
|
|
78
|
+
};
|
|
80
79
|
//# sourceMappingURL=video_stream.js.map
|
package/dist/video_stream.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/video_stream.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport { create } from '@bufbuild/protobuf';\nimport { Mutex } from '@livekit/mutex';\nimport type { FfiEvent } from './ffi_client.js';\nimport { FfiClient, FfiClientEvent, FfiHandle } from './ffi_client.js';\nimport type {\n NewVideoStreamResponse,\n VideoRotation,\n VideoStreamInfo,\n} from './proto/video_frame_pb.js';\nimport { NewVideoStreamRequestSchema, VideoStreamType } from './proto/video_frame_pb.js';\nimport type { Track } from './track.js';\nimport { VideoFrame } from './video_frame.js';\n\nexport type VideoFrameEvent = {\n frame: VideoFrame;\n timestampUs: bigint;\n rotation: VideoRotation;\n};\n\nexport class VideoStream implements AsyncIterableIterator<VideoFrameEvent> {\n /** @internal */\n info: VideoStreamInfo;\n /** @internal */\n ffiHandle: FfiHandle;\n /** @internal */\n eventQueue: (VideoFrameEvent | null)[] = [];\n /** @internal */\n queueResolve: ((value: IteratorResult<VideoFrameEvent>) => void) | null = null;\n /** @internal */\n mutex = new Mutex();\n\n track: Track;\n\n constructor(track: Track) {\n this.track = track;\n\n const req = create(NewVideoStreamRequestSchema, {\n type: VideoStreamType.VIDEO_STREAM_NATIVE,\n trackHandle: track.ffi_handle.handle,\n });\n\n const res = FfiClient.instance.request<NewVideoStreamResponse>({\n message: {\n case: 'newVideoStream',\n value: req,\n },\n });\n\n this.info = res.stream!.info!;\n this.ffiHandle = new FfiHandle(res.stream!.handle!.id);\n\n FfiClient.instance.on(FfiClientEvent.FfiEvent, this.onEvent);\n }\n\n private onEvent = (ev: FfiEvent) => {\n if (\n ev.message.case != 'videoStreamEvent' ||\n ev.message.value.streamHandle != this.ffiHandle.handle\n ) {\n return;\n }\n\n const streamEvent = ev.message.value.message;\n switch (streamEvent.case) {\n case 'frameReceived':\n const rotation = streamEvent.value.rotation;\n const timestampUs = streamEvent.value.timestampUs;\n const frame = VideoFrame.fromOwnedInfo(streamEvent.value.buffer!);\n const value = { rotation, timestampUs, frame };\n if (this.queueResolve) {\n this.queueResolve({ done: false, value });\n } else {\n this.eventQueue.push(value);\n }\n break;\n case 'eos':\n FfiClient.instance.off(FfiClientEvent.FfiEvent, this.onEvent);\n break;\n }\n };\n\n async next(): Promise<IteratorResult<VideoFrameEvent>> {\n const unlock = await this.mutex.lock();\n if (this.eventQueue.length > 0) {\n unlock();\n const value = this.eventQueue.shift();\n if (value) {\n return { done: false, value };\n } else {\n return { done: true, value: undefined };\n }\n }\n const promise = new Promise<IteratorResult<VideoFrameEvent>>(\n (resolve) => (this.queueResolve = resolve),\n );\n unlock();\n return promise;\n }\n\n close() {\n this.eventQueue.push(null);\n this.ffiHandle.dispose();\n }\n\n [Symbol.asyncIterator](): VideoStream {\n return this;\n }\n}\n"],"mappings":"AAGA,SAAS,cAAc;AACvB,SAAS,aAAa;AAEtB,SAAS,WAAW,gBAAgB,iBAAiB;AAMrD,SAAS,6BAA6B,uBAAuB;AAE7D,SAAS,kBAAkB;AAQpB,MAAM,YAA8D;AAAA,EAczE,YAAY,OAAc;AAR1B;AAAA,sBAAyC,CAAC;AAE1C;AAAA,wBAA0E;AAE1E;AAAA,iBAAQ,IAAI,MAAM;AAyBlB,SAAQ,UAAU,CAAC,OAAiB;AAClC,UACE,GAAG,QAAQ,QAAQ,sBACnB,GAAG,QAAQ,MAAM,gBAAgB,KAAK,UAAU,QAChD;AAC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AA,IACpC;AACA,WAAO;AACP,WAAO;AAAA,EACT;AAAA,EAEA,QAAQ;AACN,SAAK,WAAW,KAAK,IAAI;AACzB,SAAK,UAAU,QAAQ;AAAA,EACzB;AAAA,EAEA,CAAC,OAAO,aAAa,IAAiB;AACpC,WAAO;AAAA,EACT;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -3,9 +3,17 @@
|
|
|
3
3
|
"description": "LiveKit RTC Node",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"author": "LiveKit",
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.12.0",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
|
+
"require": "dist/index.cjs",
|
|
8
9
|
"types": "dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"require": "./dist/index.cjs"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
9
17
|
"type": "module",
|
|
10
18
|
"repository": {
|
|
11
19
|
"type": "git",
|
|
@@ -42,23 +50,24 @@
|
|
|
42
50
|
"@napi-rs/cli": "^2.18.0",
|
|
43
51
|
"@types/node": "^20.9.2",
|
|
44
52
|
"prettier": "^3.0.3",
|
|
53
|
+
"tsup": "^8.3.5",
|
|
45
54
|
"typescript": "^5.2.2"
|
|
46
55
|
},
|
|
47
56
|
"optionalDependencies": {
|
|
48
|
-
"@livekit/rtc-node-darwin-arm64": "0.
|
|
49
|
-
"@livekit/rtc-node-darwin-x64": "0.
|
|
50
|
-
"@livekit/rtc-node-linux-arm64-gnu": "0.
|
|
51
|
-
"@livekit/rtc-node-linux-x64-gnu": "0.
|
|
52
|
-
"@livekit/rtc-node-win32-x64-msvc": "0.
|
|
57
|
+
"@livekit/rtc-node-darwin-arm64": "0.12.0",
|
|
58
|
+
"@livekit/rtc-node-darwin-x64": "0.12.0",
|
|
59
|
+
"@livekit/rtc-node-linux-arm64-gnu": "0.12.0",
|
|
60
|
+
"@livekit/rtc-node-linux-x64-gnu": "0.12.0",
|
|
61
|
+
"@livekit/rtc-node-win32-x64-msvc": "0.12.0"
|
|
53
62
|
},
|
|
54
63
|
"engines": {
|
|
55
64
|
"node": ">= 18"
|
|
56
65
|
},
|
|
57
66
|
"scripts": {
|
|
58
67
|
"prebuild": "node -p \"'export const SDK_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'\" > src/version.ts",
|
|
59
|
-
"build:
|
|
60
|
-
"build": "pnpm build:
|
|
61
|
-
"artifacts": "pnpm build:
|
|
68
|
+
"build:ts": "pnpm prebuild && tsup --onSuccess \"tsc --declaration --emitDeclarationOnly\" && cp -r src/napi dist/ && cp -r src/napi/* dist/",
|
|
69
|
+
"build": "pnpm build:ts && napi build --platform --release --dts native.d.ts --js native.cjs --pipe \"prettier -w\" src/napi",
|
|
70
|
+
"artifacts": "pnpm build:ts && napi artifacts",
|
|
62
71
|
"build:debug": "napi build --platform",
|
|
63
72
|
"lint": "eslint -f unix \"src/**/*.ts\" --ignore-pattern \"src/proto/*\"",
|
|
64
73
|
"universal": "napi universal",
|
package/src/audio_frame.ts
CHANGED
|
@@ -72,8 +72,8 @@ export const combineAudioFrames = (buffer: AudioFrame | AudioFrame[]): AudioFram
|
|
|
72
72
|
throw new Error('buffer is empty');
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
const sampleRate = buffer[0]
|
|
76
|
-
const channels = buffer[0]
|
|
75
|
+
const sampleRate = buffer[0]!.sampleRate;
|
|
76
|
+
const channels = buffer[0]!.channels;
|
|
77
77
|
|
|
78
78
|
let totalSamplesPerChannel = 0;
|
|
79
79
|
for (const frame of buffer) {
|
package/src/audio_source.ts
CHANGED
|
@@ -66,7 +66,7 @@ export class AudioSource {
|
|
|
66
66
|
|
|
67
67
|
get queuedDuration(): number {
|
|
68
68
|
return Math.max(
|
|
69
|
-
this.currentQueueSize - Number(process.hrtime.bigint() /
|
|
69
|
+
this.currentQueueSize - Number(process.hrtime.bigint() / BigInt(1000000)) + this.lastCapture,
|
|
70
70
|
0,
|
|
71
71
|
);
|
|
72
72
|
}
|
|
@@ -102,7 +102,7 @@ export class AudioSource {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
async captureFrame(frame: AudioFrame) {
|
|
105
|
-
const now = Number(process.hrtime.bigint() /
|
|
105
|
+
const now = Number(process.hrtime.bigint() / BigInt(1000000));
|
|
106
106
|
const elapsed = this.lastCapture === 0 ? 0 : now - this.lastCapture;
|
|
107
107
|
const frameDurationMs = (frame.samplesPerChannel / frame.sampleRate) * 1000;
|
|
108
108
|
this.currentQueueSize += frameDurationMs - elapsed;
|
package/src/e2ee.ts
CHANGED
|
@@ -190,7 +190,7 @@ export class KeyProvider {
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
export class FrameCryptor {
|
|
193
|
-
private roomHandle =
|
|
193
|
+
private roomHandle = BigInt(0);
|
|
194
194
|
participantIdentity: string;
|
|
195
195
|
keyIndex: number;
|
|
196
196
|
enabled: boolean;
|
|
@@ -246,7 +246,7 @@ export class FrameCryptor {
|
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
export class E2EEManager {
|
|
249
|
-
private roomHandle =
|
|
249
|
+
private roomHandle = BigInt(0);
|
|
250
250
|
private options: E2EEOptions;
|
|
251
251
|
private keyProvider?: KeyProvider;
|
|
252
252
|
|
package/src/napi/native.d.ts
CHANGED
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
|
|
4
4
|
/* auto-generated by NAPI-RS */
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export function livekitInitialize(
|
|
7
7
|
callback: (data: Uint8Array) => void,
|
|
8
8
|
captureLogs: boolean,
|
|
9
9
|
sdkVersion: string,
|
|
10
10
|
): void;
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
11
|
+
export function livekitFfiRequest(data: Uint8Array): Uint8Array;
|
|
12
|
+
export function livekitRetrievePtr(handle: Uint8Array): bigint;
|
|
13
|
+
export function livekitCopyBuffer(ptr: bigint, len: number): Uint8Array;
|
|
14
|
+
export function livekitDispose(): Promise<void>;
|
|
15
15
|
export declare class FfiHandle {
|
|
16
16
|
constructor(handle: bigint);
|
|
17
17
|
dispose(): void;
|
|
@@ -12,23 +12,23 @@
|
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
|
|
15
|
-
// @generated by protoc-gen-es v2.2.0 with parameter "target=ts"
|
|
15
|
+
// @generated by protoc-gen-es v2.2.0 with parameter "target=ts,import_extension=js"
|
|
16
16
|
// @generated from file audio_frame.proto (package livekit.proto, syntax proto2)
|
|
17
17
|
/* eslint-disable */
|
|
18
18
|
|
|
19
19
|
import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1";
|
|
20
20
|
import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1";
|
|
21
|
-
import type { FfiOwnedHandle } from "./handle_pb";
|
|
22
|
-
import { file_handle } from "./handle_pb";
|
|
23
|
-
import type { TrackSource } from "./track_pb";
|
|
24
|
-
import { file_track } from "./track_pb";
|
|
21
|
+
import type { FfiOwnedHandle } from "./handle_pb.js";
|
|
22
|
+
import { file_handle } from "./handle_pb.js";
|
|
23
|
+
import type { TrackSource } from "./track_pb.js";
|
|
24
|
+
import { file_track } from "./track_pb.js";
|
|
25
25
|
import type { Message } from "@bufbuild/protobuf";
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* Describes the file audio_frame.proto.
|
|
29
29
|
*/
|
|
30
30
|
export const file_audio_frame: GenFile = /*@__PURE__*/
|
|
31
|
-
fileDesc("
|
|
31
|
+
fileDesc("ChFhdWRpb19mcmFtZS5wcm90bxINbGl2ZWtpdC5wcm90byKGAQoVTmV3QXVkaW9TdHJlYW1SZXF1ZXN0EhQKDHRyYWNrX2hhbmRsZRgBIAIoBBIsCgR0eXBlGAIgAigOMh4ubGl2ZWtp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yHy5saXZla2l0LnByb3RvLlNveFJlc2FtcGxlckluZm8qSgoUU294UmVzYW1wbGVyRGF0YVR5cGUSGAoUU09YUl9EQVRBVFlQRV9JTlQxNkkQABIYChRTT1hSX0RBVEFUWVBFX0lOVDE2UxABKosBChBTb3hRdWFsaXR5UmVjaXBlEhYKElNPWFJfUVVBTElUWV9RVUlDSxAAEhQKEFNPWFJfUVVBTElUWV9MT1cQARIXChNTT1hSX1FVQUxJVFlfTUVESVVNEAISFQoRU09YUl9RVUFMSVRZX0hJR0gQAxIZChVTT1hSX1FVQUxJVFlfVkVSWUhJR0gQBCqXAQoLU294RmxhZ0JpdHMSFgoSU09YUl9ST0xMT0ZGX1NNQUxMEAASFwoTU09YUl9ST0xMT0ZGX01FRElVTRABEhUKEVNPWFJfUk9MTE9GRl9OT05FEAISGAoUU09YUl9ISUdIX1BSRUNfQ0xPQ0sQAxIZChVTT1hSX0RPVUJMRV9QUkVDSVNJT04QBBILCgdTT1hSX1ZSEAUqQQoPQXVkaW9TdHJlYW1UeXBlEhcKE0FVRElPX1NUUkVBTV9OQVRJVkUQABIVChFBVURJT19TVFJFQU1fSFRNTBABKioKD0F1ZGlvU291cmNlVHlwZRIXChNBVURJT19TT1VSQ0VfTkFUSVZFEABCEKoCDUxpdmVLaXQuUHJvdG8", [file_handle, file_track]);
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Create a new AudioStream
|
|
@@ -48,12 +48,12 @@ export type NewAudioStreamRequest = Message<"livekit.proto.NewAudioStreamRequest
|
|
|
48
48
|
type: AudioStreamType;
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
|
-
* @generated from field:
|
|
51
|
+
* @generated from field: optional uint32 sample_rate = 3;
|
|
52
52
|
*/
|
|
53
53
|
sampleRate: number;
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
|
-
* @generated from field:
|
|
56
|
+
* @generated from field: optional uint32 num_channels = 4;
|
|
57
57
|
*/
|
|
58
58
|
numChannels: number;
|
|
59
59
|
};
|
|
@@ -102,12 +102,12 @@ export type AudioStreamFromParticipantRequest = Message<"livekit.proto.AudioStre
|
|
|
102
102
|
trackSource: TrackSource;
|
|
103
103
|
|
|
104
104
|
/**
|
|
105
|
-
* @generated from field:
|
|
105
|
+
* @generated from field: optional uint32 sample_rate = 5;
|
|
106
106
|
*/
|
|
107
107
|
sampleRate: number;
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
|
-
* @generated from field:
|
|
110
|
+
* @generated from field: optional uint32 num_channels = 6;
|
|
111
111
|
*/
|
|
112
112
|
numChannels: number;
|
|
113
113
|
};
|
|
@@ -163,7 +163,7 @@ export type NewAudioSourceRequest = Message<"livekit.proto.NewAudioSourceRequest
|
|
|
163
163
|
numChannels: number;
|
|
164
164
|
|
|
165
165
|
/**
|
|
166
|
-
* @generated from field:
|
|
166
|
+
* @generated from field: optional uint32 queue_size_ms = 5;
|
|
167
167
|
*/
|
|
168
168
|
queueSizeMs: number;
|
|
169
169
|
};
|
|
@@ -404,7 +404,7 @@ export type NewSoxResamplerRequest = Message<"livekit.proto.NewSoxResamplerReque
|
|
|
404
404
|
qualityRecipe: SoxQualityRecipe;
|
|
405
405
|
|
|
406
406
|
/**
|
|
407
|
-
* @generated from field:
|
|
407
|
+
* @generated from field: optional uint32 flags = 7;
|
|
408
408
|
*/
|
|
409
409
|
flags: number;
|
|
410
410
|
};
|
package/src/proto/e2ee_pb.ts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
|
|
15
|
-
// @generated by protoc-gen-es v2.2.0 with parameter "target=ts"
|
|
15
|
+
// @generated by protoc-gen-es v2.2.0 with parameter "target=ts,import_extension=js"
|
|
16
16
|
// @generated from file e2ee.proto (package livekit.proto, syntax proto2)
|
|
17
17
|
/* eslint-disable */
|
|
18
18
|
|
package/src/proto/ffi_pb.ts
CHANGED
|
@@ -12,24 +12,24 @@
|
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
|
|
15
|
-
// @generated by protoc-gen-es v2.2.0 with parameter "target=ts"
|
|
15
|
+
// @generated by protoc-gen-es v2.2.0 with parameter "target=ts,import_extension=js"
|
|
16
16
|
// @generated from file ffi.proto (package livekit.proto, syntax proto2)
|
|
17
17
|
/* eslint-disable */
|
|
18
18
|
|
|
19
19
|
import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1";
|
|
20
20
|
import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1";
|
|
21
|
-
import type { E2eeRequest, E2eeResponse } from "./e2ee_pb";
|
|
22
|
-
import { file_e2ee } from "./e2ee_pb";
|
|
23
|
-
import type { CreateAudioTrackRequest, CreateAudioTrackResponse, CreateVideoTrackRequest, CreateVideoTrackResponse, EnableRemoteTrackRequest, EnableRemoteTrackResponse, GetStatsCallback, GetStatsRequest, GetStatsResponse, LocalTrackMuteRequest, LocalTrackMuteResponse, TrackEvent } from "./track_pb";
|
|
24
|
-
import { file_track } from "./track_pb";
|
|
25
|
-
import type { ConnectCallback, ConnectRequest, ConnectResponse, DisconnectCallback, DisconnectRequest, DisconnectResponse, EditChatMessageRequest, GetSessionStatsCallback, GetSessionStatsRequest, GetSessionStatsResponse, PublishDataCallback, PublishDataRequest, PublishDataResponse, PublishSipDtmfCallback, PublishSipDtmfRequest, PublishSipDtmfResponse, PublishTrackCallback, PublishTrackRequest, PublishTrackResponse, PublishTranscriptionCallback, PublishTranscriptionRequest, PublishTranscriptionResponse, RoomEvent, SendChatMessageCallback, SendChatMessageRequest, SendChatMessageResponse, SetLocalAttributesCallback, SetLocalAttributesRequest, SetLocalAttributesResponse, SetLocalMetadataCallback, SetLocalMetadataRequest, SetLocalMetadataResponse, SetLocalNameCallback, SetLocalNameRequest, SetLocalNameResponse, SetSubscribedRequest, SetSubscribedResponse, UnpublishTrackCallback, UnpublishTrackRequest, UnpublishTrackResponse } from "./room_pb";
|
|
26
|
-
import { file_room } from "./room_pb";
|
|
27
|
-
import type { CaptureVideoFrameRequest, CaptureVideoFrameResponse, NewVideoSourceRequest, NewVideoSourceResponse, NewVideoStreamRequest, NewVideoStreamResponse, VideoConvertRequest, VideoConvertResponse, VideoStreamEvent, VideoStreamFromParticipantRequest, VideoStreamFromParticipantResponse } from "./video_frame_pb";
|
|
28
|
-
import { file_video_frame } from "./video_frame_pb";
|
|
29
|
-
import type { AudioStreamEvent, AudioStreamFromParticipantRequest, AudioStreamFromParticipantResponse, CaptureAudioFrameCallback, CaptureAudioFrameRequest, CaptureAudioFrameResponse, ClearAudioBufferRequest, ClearAudioBufferResponse, FlushSoxResamplerRequest, FlushSoxResamplerResponse, NewAudioResamplerRequest, NewAudioResamplerResponse, NewAudioSourceRequest, NewAudioSourceResponse, NewAudioStreamRequest, NewAudioStreamResponse, NewSoxResamplerRequest, NewSoxResamplerResponse, PushSoxResamplerRequest, PushSoxResamplerResponse, RemixAndResampleRequest, RemixAndResampleResponse } from "./audio_frame_pb";
|
|
30
|
-
import { file_audio_frame } from "./audio_frame_pb";
|
|
31
|
-
import type { PerformRpcCallback, PerformRpcRequest, PerformRpcResponse, RegisterRpcMethodRequest, RegisterRpcMethodResponse, RpcMethodInvocationEvent, RpcMethodInvocationResponseRequest, RpcMethodInvocationResponseResponse, UnregisterRpcMethodRequest, UnregisterRpcMethodResponse } from "./rpc_pb";
|
|
32
|
-
import { file_rpc } from "./rpc_pb";
|
|
21
|
+
import type { E2eeRequest, E2eeResponse } from "./e2ee_pb.js";
|
|
22
|
+
import { file_e2ee } from "./e2ee_pb.js";
|
|
23
|
+
import type { CreateAudioTrackRequest, CreateAudioTrackResponse, CreateVideoTrackRequest, CreateVideoTrackResponse, EnableRemoteTrackRequest, EnableRemoteTrackResponse, GetStatsCallback, GetStatsRequest, GetStatsResponse, LocalTrackMuteRequest, LocalTrackMuteResponse, TrackEvent } from "./track_pb.js";
|
|
24
|
+
import { file_track } from "./track_pb.js";
|
|
25
|
+
import type { ConnectCallback, ConnectRequest, ConnectResponse, DisconnectCallback, DisconnectRequest, DisconnectResponse, EditChatMessageRequest, GetSessionStatsCallback, GetSessionStatsRequest, GetSessionStatsResponse, PublishDataCallback, PublishDataRequest, PublishDataResponse, PublishSipDtmfCallback, PublishSipDtmfRequest, PublishSipDtmfResponse, PublishTrackCallback, PublishTrackRequest, PublishTrackResponse, PublishTranscriptionCallback, PublishTranscriptionRequest, PublishTranscriptionResponse, RoomEvent, SendChatMessageCallback, SendChatMessageRequest, SendChatMessageResponse, SetLocalAttributesCallback, SetLocalAttributesRequest, SetLocalAttributesResponse, SetLocalMetadataCallback, SetLocalMetadataRequest, SetLocalMetadataResponse, SetLocalNameCallback, SetLocalNameRequest, SetLocalNameResponse, SetSubscribedRequest, SetSubscribedResponse, UnpublishTrackCallback, UnpublishTrackRequest, UnpublishTrackResponse } from "./room_pb.js";
|
|
26
|
+
import { file_room } from "./room_pb.js";
|
|
27
|
+
import type { CaptureVideoFrameRequest, CaptureVideoFrameResponse, NewVideoSourceRequest, NewVideoSourceResponse, NewVideoStreamRequest, NewVideoStreamResponse, VideoConvertRequest, VideoConvertResponse, VideoStreamEvent, VideoStreamFromParticipantRequest, VideoStreamFromParticipantResponse } from "./video_frame_pb.js";
|
|
28
|
+
import { file_video_frame } from "./video_frame_pb.js";
|
|
29
|
+
import type { AudioStreamEvent, AudioStreamFromParticipantRequest, AudioStreamFromParticipantResponse, CaptureAudioFrameCallback, CaptureAudioFrameRequest, CaptureAudioFrameResponse, ClearAudioBufferRequest, ClearAudioBufferResponse, FlushSoxResamplerRequest, FlushSoxResamplerResponse, NewAudioResamplerRequest, NewAudioResamplerResponse, NewAudioSourceRequest, NewAudioSourceResponse, NewAudioStreamRequest, NewAudioStreamResponse, NewSoxResamplerRequest, NewSoxResamplerResponse, PushSoxResamplerRequest, PushSoxResamplerResponse, RemixAndResampleRequest, RemixAndResampleResponse } from "./audio_frame_pb.js";
|
|
30
|
+
import { file_audio_frame } from "./audio_frame_pb.js";
|
|
31
|
+
import type { PerformRpcCallback, PerformRpcRequest, PerformRpcResponse, RegisterRpcMethodRequest, RegisterRpcMethodResponse, RpcMethodInvocationEvent, RpcMethodInvocationResponseRequest, RpcMethodInvocationResponseResponse, UnregisterRpcMethodRequest, UnregisterRpcMethodResponse } from "./rpc_pb.js";
|
|
32
|
+
import { file_rpc } from "./rpc_pb.js";
|
|
33
33
|
import type { Message } from "@bufbuild/protobuf";
|
|
34
34
|
|
|
35
35
|
/**
|
package/src/proto/handle_pb.ts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
|
|
15
|
-
// @generated by protoc-gen-es v2.2.0 with parameter "target=ts"
|
|
15
|
+
// @generated by protoc-gen-es v2.2.0 with parameter "target=ts,import_extension=js"
|
|
16
16
|
// @generated from file handle.proto (package livekit.proto, syntax proto2)
|
|
17
17
|
/* eslint-disable */
|
|
18
18
|
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
|
|
15
|
-
// @generated by protoc-gen-es v2.2.0 with parameter "target=ts"
|
|
15
|
+
// @generated by protoc-gen-es v2.2.0 with parameter "target=ts,import_extension=js"
|
|
16
16
|
// @generated from file participant.proto (package livekit.proto, syntax proto2)
|
|
17
17
|
/* eslint-disable */
|
|
18
18
|
|
|
19
19
|
import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1";
|
|
20
20
|
import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1";
|
|
21
|
-
import type { FfiOwnedHandle } from "./handle_pb";
|
|
22
|
-
import { file_handle } from "./handle_pb";
|
|
21
|
+
import type { FfiOwnedHandle } from "./handle_pb.js";
|
|
22
|
+
import { file_handle } from "./handle_pb.js";
|
|
23
23
|
import type { Message } from "@bufbuild/protobuf";
|
|
24
24
|
|
|
25
25
|
/**
|