@livekit/rtc-node 0.0.7 → 0.1.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/build.rs +4 -0
- package/dist/audio_frame.d.ts +1 -1
- package/dist/audio_frame.d.ts.map +1 -1
- package/dist/audio_frame.js +10 -11
- package/dist/audio_frame.js.map +1 -1
- package/dist/audio_source.d.ts +3 -3
- package/dist/audio_source.d.ts.map +1 -1
- package/dist/audio_source.js +14 -15
- package/dist/audio_source.js.map +1 -1
- package/dist/audio_stream.d.ts +4 -4
- package/dist/audio_stream.d.ts.map +1 -1
- package/dist/audio_stream.js +17 -21
- package/dist/audio_stream.js.map +1 -1
- package/dist/e2ee.d.ts +1 -1
- package/dist/e2ee.d.ts.map +1 -1
- package/dist/e2ee.js +42 -45
- package/dist/e2ee.js.map +1 -1
- package/dist/ffi_client.d.ts +2 -2
- package/dist/ffi_client.d.ts.map +1 -1
- package/dist/ffi_client.js +17 -24
- package/dist/ffi_client.js.map +1 -1
- package/dist/index.d.ts +15 -15
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -70
- package/dist/index.js.map +1 -1
- package/{src/native.js → dist/napi/native.cjs} +12 -0
- package/dist/napi/native.js +15 -0
- package/dist/participant.d.ts +24 -9
- package/dist/participant.d.ts.map +1 -1
- package/dist/participant.js +45 -45
- package/dist/participant.js.map +1 -1
- package/dist/proto/audio_frame_pb.js +148 -176
- package/dist/proto/audio_frame_pb.js.map +1 -1
- package/dist/proto/e2ee_pb.js +134 -162
- package/dist/proto/e2ee_pb.js.map +1 -1
- package/dist/proto/ffi_pb.js +115 -126
- package/dist/proto/ffi_pb.js.map +1 -1
- package/dist/proto/handle_pb.js +7 -11
- package/dist/proto/handle_pb.js.map +1 -1
- package/dist/proto/participant_pb.js +13 -18
- package/dist/proto/participant_pb.js.map +1 -1
- package/dist/proto/room_pb.js +388 -454
- package/dist/proto/room_pb.js.map +1 -1
- package/dist/proto/stats_pb.js +265 -303
- package/dist/proto/stats_pb.js.map +1 -1
- package/dist/proto/track_pb.js +87 -102
- package/dist/proto/track_pb.js.map +1 -1
- package/dist/proto/video_frame_pb.js +184 -215
- package/dist/proto/video_frame_pb.js.map +1 -1
- package/dist/room.d.ts +10 -9
- package/dist/room.d.ts.map +1 -1
- package/dist/room.js +74 -76
- package/dist/room.js.map +1 -1
- package/dist/track.d.ts +4 -4
- package/dist/track.d.ts.map +1 -1
- package/dist/track.js +15 -20
- package/dist/track.js.map +1 -1
- package/dist/track_publication.d.ts +4 -4
- package/dist/track_publication.d.ts.map +1 -1
- package/dist/track_publication.js +12 -15
- package/dist/track_publication.js.map +1 -1
- package/dist/video_frame.d.ts +1 -1
- package/dist/video_frame.d.ts.map +1 -1
- package/dist/video_frame.js +57 -71
- package/dist/video_frame.js.map +1 -1
- package/dist/video_source.d.ts +3 -3
- package/dist/video_source.d.ts.map +1 -1
- package/dist/video_source.js +12 -13
- package/dist/video_source.js.map +1 -1
- package/dist/video_stream.d.ts +4 -4
- package/dist/video_stream.d.ts.map +1 -1
- package/dist/video_stream.js +18 -22
- package/dist/video_stream.js.map +1 -1
- package/package.json +14 -14
- package/src/audio_frame.ts +6 -2
- package/src/audio_source.ts +8 -4
- package/src/audio_stream.ts +9 -5
- package/src/e2ee.ts +6 -2
- package/src/ffi_client.ts +6 -2
- package/src/index.ts +19 -15
- package/src/lib.rs +4 -0
- package/src/napi/native.cjs +281 -0
- package/src/napi/native.js +15 -0
- package/src/nodejs.rs +4 -0
- package/src/participant.ts +45 -22
- package/src/room.ts +56 -48
- package/src/track.ts +8 -4
- package/src/track_publication.ts +10 -6
- package/src/video_frame.ts +6 -2
- package/src/video_source.ts +7 -3
- package/src/video_stream.ts +9 -5
- package/dist/native.d.ts.map +0 -1
- package/dist/native.js +0 -297
- package/dist/native.js.map +0 -1
- /package/dist/{native.d.ts → napi/native.d.ts} +0 -0
- /package/src/{native.d.ts → napi/native.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video_source.d.ts","sourceRoot":"","sources":["../src/video_source.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"video_source.d.ts","sourceRoot":"","sources":["../src/video_source.ts"],"names":[],"mappings":"AAIA,OAAO,EAAa,SAAS,EAAc,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAKL,eAAe,EAEhB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,qBAAa,WAAW;IACtB,gBAAgB;IAChB,IAAI,EAAE,eAAe,CAAC;IACtB,gBAAgB;IAChB,SAAS,EAAE,SAAS,CAAC;IAErB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;gBAEH,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAuBzC,YAAY,CAAC,KAAK,EAAE,UAAU;CAiB/B"}
|
package/dist/video_source.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class VideoSource {
|
|
1
|
+
// SPDX-FileCopyrightText: 2024 LiveKit, Inc.
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
import { FfiClient, FfiHandle } from './ffi_client.js';
|
|
5
|
+
import { CaptureVideoFrameRequest, NewVideoSourceRequest, VideoSourceType, } from './proto/video_frame_pb.js';
|
|
6
|
+
export class VideoSource {
|
|
7
7
|
constructor(width, height) {
|
|
8
8
|
this.width = width;
|
|
9
9
|
this.height = height;
|
|
10
|
-
let req = new
|
|
11
|
-
type:
|
|
10
|
+
let req = new NewVideoSourceRequest({
|
|
11
|
+
type: VideoSourceType.VIDEO_SOURCE_NATIVE,
|
|
12
12
|
resolution: {
|
|
13
13
|
width: width,
|
|
14
14
|
height: height,
|
|
15
15
|
},
|
|
16
16
|
});
|
|
17
|
-
let res =
|
|
17
|
+
let res = FfiClient.instance.request({
|
|
18
18
|
message: {
|
|
19
19
|
case: 'newVideoSource',
|
|
20
20
|
value: req,
|
|
21
21
|
},
|
|
22
22
|
});
|
|
23
23
|
this.info = res.source.info;
|
|
24
|
-
this.ffiHandle = new
|
|
24
|
+
this.ffiHandle = new FfiHandle(res.source.handle.id);
|
|
25
25
|
}
|
|
26
26
|
captureFrame(frame) {
|
|
27
|
-
let req = new
|
|
27
|
+
let req = new CaptureVideoFrameRequest({
|
|
28
28
|
sourceHandle: this.ffiHandle.handle,
|
|
29
29
|
from: {
|
|
30
30
|
case: 'info',
|
|
@@ -35,10 +35,9 @@ class VideoSource {
|
|
|
35
35
|
timestampUs: BigInt(frame.timestampUs),
|
|
36
36
|
},
|
|
37
37
|
});
|
|
38
|
-
|
|
38
|
+
FfiClient.instance.request({
|
|
39
39
|
message: { case: 'captureVideoFrame', value: req },
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
exports.VideoSource = VideoSource;
|
|
44
43
|
//# sourceMappingURL=video_source.js.map
|
package/dist/video_source.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video_source.js","sourceRoot":"","sources":["../src/video_source.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"video_source.js","sourceRoot":"","sources":["../src/video_source.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,EAAE;AACF,sCAAsC;AAEtC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAc,MAAM,iBAAiB,CAAC;AACnE,OAAO,EACL,wBAAwB,EAExB,qBAAqB,EAGrB,eAAe,GAChB,MAAM,2BAA2B,CAAC;AAGnC,MAAM,OAAO,WAAW;IAStB,YAAY,KAAa,EAAE,MAAc;QACvC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,IAAI,GAAG,GAAG,IAAI,qBAAqB,CAAC;YAClC,IAAI,EAAE,eAAe,CAAC,mBAAmB;YACzC,UAAU,EAAE;gBACV,KAAK,EAAE,KAAK;gBACZ,MAAM,EAAE,MAAM;aACf;SACF,CAAC,CAAC;QAEH,IAAI,GAAG,GAAG,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAyB;YAC3D,OAAO,EAAE;gBACP,IAAI,EAAE,gBAAgB;gBACtB,KAAK,EAAE,GAAG;aACX;SACF,CAAC,CAAC;QAEH,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC;QAC5B,IAAI,CAAC,SAAS,GAAG,IAAI,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACvD,CAAC;IAED,YAAY,CAAC,KAAiB;QAC5B,IAAI,GAAG,GAAG,IAAI,wBAAwB,CAAC;YACrC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM;YACnC,IAAI,EAAE;gBACJ,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS,EAAE;aAChC;YACD,KAAK,EAAE;gBACL,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,WAAW,EAAE,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC;aACvC;SACF,CAAC,CAAC;QAEH,SAAS,CAAC,QAAQ,CAAC,OAAO,CAA4B;YACpD,OAAO,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,EAAE,GAAG,EAAE;SACnD,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/dist/video_stream.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { FfiHandle } from './ffi_client';
|
|
2
|
-
import { Track } from './track';
|
|
1
|
+
import { FfiHandle } from './ffi_client.js';
|
|
2
|
+
import { Track } from './track.js';
|
|
3
3
|
import TypedEmitter from 'typed-emitter';
|
|
4
|
-
import { VideoFrame } from './video_frame';
|
|
5
|
-
import { VideoStreamInfo } from './proto/video_frame_pb';
|
|
4
|
+
import { VideoFrame } from './video_frame.js';
|
|
5
|
+
import { VideoStreamInfo } from './proto/video_frame_pb.js';
|
|
6
6
|
export type VideoStreamCallbacks = {
|
|
7
7
|
frameReceived: (frame: VideoFrame) => void;
|
|
8
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video_stream.d.ts","sourceRoot":"","sources":["../src/video_stream.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"video_stream.d.ts","sourceRoot":"","sources":["../src/video_stream.ts"],"names":[],"mappings":"AAIA,OAAO,EAAuC,SAAS,EAAc,MAAM,iBAAiB,CAAC;AAC7F,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,UAAU,EAAoB,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAGL,eAAe,EAEhB,MAAM,2BAA2B,CAAC;AAEnC,MAAM,MAAM,oBAAoB,GAAG;IACjC,aAAa,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;CAC5C,CAAC;AAEF,oBAAY,gBAAgB;IAC1B,aAAa,kBAAkB;CAChC;0CAE2D,aAAa,oBAAoB,CAAC;AAA9F,qBAAa,WAAY,SAAQ,gBAA8D;IAC7F,gBAAgB;IAChB,IAAI,EAAE,eAAe,CAAC;IACtB,gBAAgB;IAChB,SAAS,EAAE,SAAS,CAAC;IAErB,KAAK,EAAE,KAAK,CAAC;gBAED,KAAK,EAAE,KAAK;IAsBxB,OAAO,CAAC,OAAO,CAoBb;IAEF,KAAK;CAGN"}
|
package/dist/video_stream.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const video_frame_1 = require("./video_frame");
|
|
10
|
-
const video_frame_pb_1 = require("./proto/video_frame_pb");
|
|
11
|
-
var VideoStreamEvent;
|
|
1
|
+
// SPDX-FileCopyrightText: 2024 LiveKit, Inc.
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
import { FfiClient, FfiClientEvent, FfiHandle } from './ffi_client.js';
|
|
5
|
+
import EventEmitter from 'events';
|
|
6
|
+
import { VideoFrame, VideoFrameBuffer } from './video_frame.js';
|
|
7
|
+
import { NewVideoStreamRequest, VideoStreamType, } from './proto/video_frame_pb.js';
|
|
8
|
+
export var VideoStreamEvent;
|
|
12
9
|
(function (VideoStreamEvent) {
|
|
13
10
|
VideoStreamEvent["FrameReceived"] = "frameReceived";
|
|
14
|
-
})(VideoStreamEvent || (
|
|
15
|
-
class VideoStream extends
|
|
11
|
+
})(VideoStreamEvent || (VideoStreamEvent = {}));
|
|
12
|
+
export class VideoStream extends EventEmitter {
|
|
16
13
|
constructor(track) {
|
|
17
14
|
super();
|
|
18
15
|
this.onEvent = (ev) => {
|
|
@@ -24,33 +21,32 @@ class VideoStream extends events_1.default {
|
|
|
24
21
|
switch (streamEvent.case) {
|
|
25
22
|
case 'frameReceived':
|
|
26
23
|
let frameInfo = streamEvent.value.frame;
|
|
27
|
-
let buffer =
|
|
28
|
-
let frame = new
|
|
24
|
+
let buffer = VideoFrameBuffer.fromOwnedInfo(streamEvent.value.buffer);
|
|
25
|
+
let frame = new VideoFrame(Number(frameInfo.timestampUs), frameInfo.rotation, buffer);
|
|
29
26
|
this.emit(VideoStreamEvent.FrameReceived, frame);
|
|
30
27
|
break;
|
|
31
28
|
case 'eos':
|
|
32
|
-
|
|
29
|
+
FfiClient.instance.off(FfiClientEvent.FfiEvent, this.onEvent);
|
|
33
30
|
break;
|
|
34
31
|
}
|
|
35
32
|
};
|
|
36
33
|
this.track = track;
|
|
37
|
-
let req = new
|
|
38
|
-
type:
|
|
34
|
+
let req = new NewVideoStreamRequest({
|
|
35
|
+
type: VideoStreamType.VIDEO_STREAM_NATIVE,
|
|
39
36
|
trackHandle: track.ffi_handle.handle,
|
|
40
37
|
});
|
|
41
|
-
let res =
|
|
38
|
+
let res = FfiClient.instance.request({
|
|
42
39
|
message: {
|
|
43
40
|
case: 'newVideoStream',
|
|
44
41
|
value: req,
|
|
45
42
|
},
|
|
46
43
|
});
|
|
47
44
|
this.info = res.stream.info;
|
|
48
|
-
this.ffiHandle = new
|
|
49
|
-
|
|
45
|
+
this.ffiHandle = new FfiHandle(res.stream.handle.id);
|
|
46
|
+
FfiClient.instance.on(FfiClientEvent.FfiEvent, this.onEvent);
|
|
50
47
|
}
|
|
51
48
|
close() {
|
|
52
49
|
this.ffiHandle.dispose();
|
|
53
50
|
}
|
|
54
51
|
}
|
|
55
|
-
exports.VideoStream = VideoStream;
|
|
56
52
|
//# sourceMappingURL=video_stream.js.map
|
package/dist/video_stream.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video_stream.js","sourceRoot":"","sources":["../src/video_stream.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"video_stream.js","sourceRoot":"","sources":["../src/video_stream.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,EAAE;AACF,sCAAsC;AAEtC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAY,SAAS,EAAc,MAAM,iBAAiB,CAAC;AAE7F,OAAO,YAAY,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EACL,qBAAqB,EAGrB,eAAe,GAChB,MAAM,2BAA2B,CAAC;AAMnC,MAAM,CAAN,IAAY,gBAEX;AAFD,WAAY,gBAAgB;IAC1B,mDAA+B,CAAA;AACjC,CAAC,EAFW,gBAAgB,KAAhB,gBAAgB,QAE3B;AAED,MAAM,OAAO,WAAY,SAAS,YAA6D;IAQ7F,YAAY,KAAY;QACtB,KAAK,EAAE,CAAC;QAqBF,YAAO,GAAG,CAAC,EAAY,EAAE,EAAE;YACjC,IACE,EAAE,CAAC,OAAO,CAAC,IAAI,IAAI,kBAAkB;gBACrC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,YAAY,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,EACtD,CAAC;gBACD,OAAO;YACT,CAAC;YAED,IAAI,WAAW,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC;YAC3C,QAAQ,WAAW,CAAC,IAAI,EAAE,CAAC;gBACzB,KAAK,eAAe;oBAClB,IAAI,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC;oBACxC,IAAI,MAAM,GAAG,gBAAgB,CAAC,aAAa,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;oBACtE,IAAI,KAAK,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;oBACtF,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;oBACjD,MAAM;gBACR,KAAK,KAAK;oBACR,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;oBAC9D,MAAM;YACV,CAAC;QACH,CAAC,CAAC;QAxCA,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAEnB,IAAI,GAAG,GAAG,IAAI,qBAAqB,CAAC;YAClC,IAAI,EAAE,eAAe,CAAC,mBAAmB;YACzC,WAAW,EAAE,KAAK,CAAC,UAAU,CAAC,MAAM;SACrC,CAAC,CAAC;QAEH,IAAI,GAAG,GAAG,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAyB;YAC3D,OAAO,EAAE;gBACP,IAAI,EAAE,gBAAgB;gBACtB,KAAK,EAAE,GAAG;aACX;SACF,CAAC,CAAC;QAEH,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC;QAC5B,IAAI,CAAC,SAAS,GAAG,IAAI,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAErD,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/D,CAAC;IAwBD,KAAK;QACH,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
"name": "@livekit/rtc-node",
|
|
3
3
|
"description": "LiveKit RTC Node",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
|
-
"version": "0.0
|
|
5
|
+
"version": "0.1.0",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
|
+
"type": "module",
|
|
8
9
|
"files": [
|
|
9
10
|
"dist",
|
|
10
11
|
"src",
|
|
@@ -30,28 +31,27 @@
|
|
|
30
31
|
"typed-emitter": "^2.1.0"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|
|
33
|
-
"@napi-rs/cli": "^2.
|
|
34
|
+
"@napi-rs/cli": "^2.18.0",
|
|
34
35
|
"@types/node": "^20.9.2",
|
|
35
36
|
"typescript": "^5.2.2",
|
|
36
37
|
"prettier": "^3.0.3"
|
|
37
38
|
},
|
|
38
39
|
"engines": {
|
|
39
|
-
"node": ">=
|
|
40
|
+
"node": ">= 18"
|
|
41
|
+
},
|
|
42
|
+
"optionalDependencies": {
|
|
43
|
+
"@livekit/rtc-node-darwin-arm64": "0.1.0",
|
|
44
|
+
"@livekit/rtc-node-darwin-x64": "0.1.0",
|
|
45
|
+
"@livekit/rtc-node-linux-arm64-gnu": "0.1.0",
|
|
46
|
+
"@livekit/rtc-node-linux-x64-gnu": "0.1.0",
|
|
47
|
+
"@livekit/rtc-node-win32-x64-msvc": "0.1.0"
|
|
40
48
|
},
|
|
41
49
|
"scripts": {
|
|
42
|
-
"build:tsc": "tsc && cp src/
|
|
43
|
-
"build": "
|
|
44
|
-
"artifacts": "
|
|
50
|
+
"build:tsc": "tsc && cp -r src/napi dist/napi",
|
|
51
|
+
"build": "pnpm build:tsc && napi build --platform --release --dts native.d.ts --js native.cjs --pipe \"prettier -w\" src/napi",
|
|
52
|
+
"artifacts": "pnpm build:tsc && napi artifacts",
|
|
45
53
|
"build:debug": "napi build --platform",
|
|
46
|
-
"prepublishOnly": "napi prepublish -t npm",
|
|
47
54
|
"universal": "napi universal",
|
|
48
55
|
"version": "napi version"
|
|
49
|
-
},
|
|
50
|
-
"optionalDependencies": {
|
|
51
|
-
"@livekit/rtc-node-darwin-arm64": "0.0.7",
|
|
52
|
-
"@livekit/rtc-node-darwin-x64": "0.0.7",
|
|
53
|
-
"@livekit/rtc-node-linux-arm64-gnu": "0.0.7",
|
|
54
|
-
"@livekit/rtc-node-linux-x64-gnu": "0.0.7",
|
|
55
|
-
"@livekit/rtc-node-win32-x64-msvc": "0.0.7"
|
|
56
56
|
}
|
|
57
57
|
}
|
package/src/audio_frame.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// SPDX-FileCopyrightText: 2024 LiveKit, Inc.
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
import { FfiClient, FfiHandle } from './ffi_client.js';
|
|
6
|
+
import { AudioFrameBufferInfo, OwnedAudioFrameBuffer } from './proto/audio_frame_pb.js';
|
|
3
7
|
|
|
4
8
|
export class AudioFrame {
|
|
5
9
|
data: Uint16Array;
|
package/src/audio_source.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2024 LiveKit, Inc.
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
1
5
|
import EventEmitter from 'events';
|
|
2
6
|
import TypedEmitter from 'typed-emitter';
|
|
3
|
-
import { FfiHandle } from './native';
|
|
4
|
-
import { AudioFrame } from './audio_frame';
|
|
7
|
+
import { FfiHandle } from './napi/native.js';
|
|
8
|
+
import { AudioFrame } from './audio_frame.js';
|
|
5
9
|
import {
|
|
6
10
|
AudioSourceInfo,
|
|
7
11
|
AudioSourceType,
|
|
@@ -10,8 +14,8 @@ import {
|
|
|
10
14
|
CaptureAudioFrameResponse,
|
|
11
15
|
NewAudioSourceRequest,
|
|
12
16
|
NewAudioSourceResponse,
|
|
13
|
-
} from './proto/audio_frame_pb';
|
|
14
|
-
import { FfiClient, FfiRequest } from './ffi_client';
|
|
17
|
+
} from './proto/audio_frame_pb.js';
|
|
18
|
+
import { FfiClient, FfiRequest } from './ffi_client.js';
|
|
15
19
|
|
|
16
20
|
export class AudioSource {
|
|
17
21
|
/** @internal */
|
package/src/audio_stream.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// SPDX-FileCopyrightText: 2024 LiveKit, Inc.
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
import { AudioFrame } from './audio_frame.js';
|
|
6
|
+
import { FfiClient, FfiClientEvent, FfiEvent, FfiHandle, FfiRequest } from './ffi_client.js';
|
|
3
7
|
import {
|
|
4
8
|
AudioStreamInfo,
|
|
5
9
|
AudioStreamType,
|
|
6
10
|
NewAudioStreamRequest,
|
|
7
11
|
NewAudioStreamResponse,
|
|
8
|
-
} from './proto/audio_frame_pb';
|
|
9
|
-
import { Track } from './track';
|
|
12
|
+
} from './proto/audio_frame_pb.js';
|
|
13
|
+
import { Track } from './track.js';
|
|
10
14
|
import EventEmitter from 'events';
|
|
11
15
|
import TypedEmitter from 'typed-emitter';
|
|
12
16
|
|
|
@@ -66,7 +70,7 @@ export class AudioStream extends (EventEmitter as new () => TypedEmitter<AudioSt
|
|
|
66
70
|
FfiClient.instance.off(FfiClientEvent.FfiEvent, this.onEvent);
|
|
67
71
|
break;
|
|
68
72
|
}
|
|
69
|
-
}
|
|
73
|
+
};
|
|
70
74
|
|
|
71
75
|
close() {
|
|
72
76
|
this.ffiHandle.dispose();
|
package/src/e2ee.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
// SPDX-FileCopyrightText: 2024 LiveKit, Inc.
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
import { FfiClient, FfiRequest } from './ffi_client.js';
|
|
2
6
|
import {
|
|
3
7
|
E2eeManagerGetFrameCryptorsResponse,
|
|
4
8
|
E2eeManagerSetEnabledRequest,
|
|
@@ -17,7 +21,7 @@ import {
|
|
|
17
21
|
RatchetSharedKeyResponse,
|
|
18
22
|
SetKeyRequest,
|
|
19
23
|
SetSharedKeyRequest,
|
|
20
|
-
} from './proto/e2ee_pb';
|
|
24
|
+
} from './proto/e2ee_pb.js';
|
|
21
25
|
|
|
22
26
|
const DEFAULT_RATCHET_SALT = new TextEncoder().encode('LKFrameEncryptionKey');
|
|
23
27
|
const DEFAULT_RATCHET_WINDOW_SIZE = 16;
|
package/src/ffi_client.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
// SPDX-FileCopyrightText: 2024 LiveKit, Inc.
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
import { FfiRequest, FfiResponse, FfiEvent } from './proto/ffi_pb.js';
|
|
2
6
|
import EventEmitter from 'events';
|
|
3
7
|
import TypedEmitter from 'typed-emitter';
|
|
4
8
|
import {
|
|
@@ -7,7 +11,7 @@ import {
|
|
|
7
11
|
livekitInitialize,
|
|
8
12
|
livekitCopyBuffer,
|
|
9
13
|
livekitRetrievePtr,
|
|
10
|
-
} from './native';
|
|
14
|
+
} from './napi/native.js';
|
|
11
15
|
import { PartialMessage } from '@bufbuild/protobuf';
|
|
12
16
|
|
|
13
17
|
export { FfiHandle, FfiEvent, FfiResponse, FfiRequest };
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// SPDX-FileCopyrightText: 2024 LiveKit, Inc.
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
export { Room, RoomEvent, ConnectError, RoomOptions, RtcConfiguration } from './room.js';
|
|
6
|
+
export { Participant, RemoteParticipant, LocalParticipant } from './participant.js';
|
|
3
7
|
export {
|
|
4
8
|
Track,
|
|
5
9
|
LocalTrack,
|
|
@@ -10,7 +14,7 @@ export {
|
|
|
10
14
|
RemoteAudioTrack,
|
|
11
15
|
RemoteVideoTrack,
|
|
12
16
|
AudioTrack,
|
|
13
|
-
} from './track';
|
|
17
|
+
} from './track.js';
|
|
14
18
|
export {
|
|
15
19
|
VideoFrame,
|
|
16
20
|
VideoFrameBuffer,
|
|
@@ -26,18 +30,18 @@ export {
|
|
|
26
30
|
PlanarYuv16Buffer,
|
|
27
31
|
ArgbFrame,
|
|
28
32
|
BiplanarYuv8Buffer,
|
|
29
|
-
} from './video_frame';
|
|
30
|
-
export { AudioFrame } from './audio_frame';
|
|
31
|
-
export { AudioStream } from './audio_stream';
|
|
32
|
-
export { VideoStream } from './video_stream';
|
|
33
|
-
export { AudioSource } from './audio_source';
|
|
34
|
-
export { VideoSource } from './video_source';
|
|
33
|
+
} from './video_frame.js';
|
|
34
|
+
export { AudioFrame } from './audio_frame.js';
|
|
35
|
+
export { AudioStream } from './audio_stream.js';
|
|
36
|
+
export { VideoStream } from './video_stream.js';
|
|
37
|
+
export { AudioSource } from './audio_source.js';
|
|
38
|
+
export { VideoSource } from './video_source.js';
|
|
35
39
|
export {
|
|
36
40
|
TrackPublication,
|
|
37
41
|
RemoteTrackPublication,
|
|
38
42
|
LocalTrackPublication,
|
|
39
|
-
} from './track_publication';
|
|
40
|
-
export { E2EEManager, E2EEOptions, KeyProviderOptions, KeyProvider, FrameCryptor } from './e2ee';
|
|
43
|
+
} from './track_publication.js';
|
|
44
|
+
export { E2EEManager, E2EEOptions, KeyProviderOptions, KeyProvider, FrameCryptor } from './e2ee.js';
|
|
41
45
|
export {
|
|
42
46
|
ConnectionQuality,
|
|
43
47
|
IceServer,
|
|
@@ -46,7 +50,7 @@ export {
|
|
|
46
50
|
ContinualGatheringPolicy,
|
|
47
51
|
TrackPublishOptions,
|
|
48
52
|
ConnectionState,
|
|
49
|
-
} from './proto/room_pb';
|
|
50
|
-
export { EncryptionType, EncryptionState } from './proto/e2ee_pb';
|
|
51
|
-
export { StreamState, TrackKind, TrackSource } from './proto/track_pb';
|
|
52
|
-
export { VideoFormatType, VideoFrameBufferType, VideoRotation } from './proto/video_frame_pb';
|
|
53
|
+
} from './proto/room_pb.js';
|
|
54
|
+
export { EncryptionType, EncryptionState } from './proto/e2ee_pb.js';
|
|
55
|
+
export { StreamState, TrackKind, TrackSource } from './proto/track_pb.js';
|
|
56
|
+
export { VideoFormatType, VideoFrameBufferType, VideoRotation } from './proto/video_frame_pb.js';
|