@livekit/rtc-node 0.1.0 → 0.3.0-rc.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/dist/audio_stream.d.ts +4 -1
- package/dist/audio_stream.d.ts.map +1 -1
- package/dist/audio_stream.js +1 -1
- package/dist/audio_stream.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/proto/audio_frame_pb.d.ts +0 -46
- package/dist/proto/audio_frame_pb.d.ts.map +1 -1
- package/dist/proto/audio_frame_pb.js +0 -70
- package/dist/proto/audio_frame_pb.js.map +1 -1
- package/dist/proto/ffi_pb.d.ts +31 -44
- package/dist/proto/ffi_pb.d.ts.map +1 -1
- package/dist/proto/ffi_pb.js +35 -10
- package/dist/proto/ffi_pb.js.map +1 -1
- package/dist/proto/room_pb.d.ts +5 -1
- package/dist/proto/room_pb.d.ts.map +1 -1
- package/dist/proto/room_pb.js +5 -0
- package/dist/proto/room_pb.js.map +1 -1
- package/dist/proto/video_frame_pb.d.ts +124 -390
- package/dist/proto/video_frame_pb.d.ts.map +1 -1
- package/dist/proto/video_frame_pb.js +149 -486
- package/dist/proto/video_frame_pb.js.map +1 -1
- package/dist/video_frame.d.ts +8 -102
- package/dist/video_frame.d.ts.map +1 -1
- package/dist/video_frame.js +157 -321
- package/dist/video_frame.js.map +1 -1
- package/dist/video_source.d.ts +2 -2
- package/dist/video_source.d.ts.map +1 -1
- package/dist/video_source.js +5 -10
- package/dist/video_source.js.map +1 -1
- package/dist/video_stream.d.ts +7 -2
- package/dist/video_stream.d.ts.map +1 -1
- package/dist/video_stream.js +5 -5
- package/dist/video_stream.js.map +1 -1
- package/package.json +6 -6
- package/src/audio_stream.ts +6 -2
- package/src/index.ts +3 -16
- package/src/proto/audio_frame_pb.ts +1 -91
- package/src/proto/e2ee_pb.ts +1 -1
- package/src/proto/ffi_pb.ts +55 -53
- package/src/proto/handle_pb.ts +1 -1
- package/src/proto/participant_pb.ts +1 -1
- package/src/proto/room_pb.ts +7 -1
- package/src/proto/stats_pb.ts +1 -1
- package/src/proto/track_pb.ts +1 -1
- package/src/proto/video_frame_pb.ts +186 -641
- package/src/video_frame.ts +179 -576
- package/src/video_source.ts +5 -9
- package/src/video_stream.ts +13 -6
package/src/video_source.ts
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
CaptureVideoFrameResponse,
|
|
9
9
|
NewVideoSourceRequest,
|
|
10
10
|
NewVideoSourceResponse,
|
|
11
|
+
VideoRotation,
|
|
11
12
|
VideoSourceInfo,
|
|
12
13
|
VideoSourceType,
|
|
13
14
|
} from './proto/video_frame_pb.js';
|
|
@@ -45,17 +46,12 @@ export class VideoSource {
|
|
|
45
46
|
this.ffiHandle = new FfiHandle(res.source.handle.id);
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
captureFrame(frame: VideoFrame) {
|
|
49
|
+
captureFrame(frame: VideoFrame, timestampUs = 0n, rotation = VideoRotation.VIDEO_ROTATION_0) {
|
|
49
50
|
let req = new CaptureVideoFrameRequest({
|
|
50
51
|
sourceHandle: this.ffiHandle.handle,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
frame: {
|
|
56
|
-
rotation: frame.rotation,
|
|
57
|
-
timestampUs: BigInt(frame.timestampUs),
|
|
58
|
-
},
|
|
52
|
+
buffer: frame.protoInfo(),
|
|
53
|
+
rotation,
|
|
54
|
+
timestampUs,
|
|
59
55
|
});
|
|
60
56
|
|
|
61
57
|
FfiClient.instance.request<CaptureVideoFrameResponse>({
|
package/src/video_stream.ts
CHANGED
|
@@ -6,16 +6,23 @@ import { FfiClient, FfiClientEvent, FfiEvent, FfiHandle, FfiRequest } from './ff
|
|
|
6
6
|
import { Track } from './track.js';
|
|
7
7
|
import EventEmitter from 'events';
|
|
8
8
|
import TypedEmitter from 'typed-emitter';
|
|
9
|
-
import { VideoFrame
|
|
9
|
+
import { VideoFrame } from './video_frame.js';
|
|
10
10
|
import {
|
|
11
11
|
NewVideoStreamRequest,
|
|
12
12
|
NewVideoStreamResponse,
|
|
13
|
+
VideoRotation,
|
|
13
14
|
VideoStreamInfo,
|
|
14
15
|
VideoStreamType,
|
|
15
16
|
} from './proto/video_frame_pb.js';
|
|
16
17
|
|
|
18
|
+
export type VideoFrameEvent = {
|
|
19
|
+
frame: VideoFrame,
|
|
20
|
+
timestampUs: bigint,
|
|
21
|
+
rotation: VideoRotation,
|
|
22
|
+
}
|
|
23
|
+
|
|
17
24
|
export type VideoStreamCallbacks = {
|
|
18
|
-
frameReceived: (
|
|
25
|
+
frameReceived: (evt: VideoFrameEvent) => void;
|
|
19
26
|
};
|
|
20
27
|
|
|
21
28
|
export enum VideoStreamEvent {
|
|
@@ -63,10 +70,10 @@ export class VideoStream extends (EventEmitter as new () => TypedEmitter<VideoSt
|
|
|
63
70
|
let streamEvent = ev.message.value.message;
|
|
64
71
|
switch (streamEvent.case) {
|
|
65
72
|
case 'frameReceived':
|
|
66
|
-
let
|
|
67
|
-
let
|
|
68
|
-
let frame =
|
|
69
|
-
this.emit(VideoStreamEvent.FrameReceived, frame);
|
|
73
|
+
let rotation = streamEvent.value.rotation;
|
|
74
|
+
let timestampUs = streamEvent.value.timestampUs;
|
|
75
|
+
let frame = VideoFrame.fromOwnedInfo(streamEvent.value.buffer);
|
|
76
|
+
this.emit(VideoStreamEvent.FrameReceived, { frame, timestampUs, rotation });
|
|
70
77
|
break;
|
|
71
78
|
case 'eos':
|
|
72
79
|
FfiClient.instance.off(FfiClientEvent.FfiEvent, this.onEvent);
|