@livekit/rtc-node 0.0.1 → 0.0.3
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.d.ts +13 -0
- package/dist/audio_frame.js +36 -0
- package/dist/audio_frame.js.map +1 -0
- package/dist/audio_source.d.ts +13 -0
- package/dist/audio_source.js +42 -0
- package/dist/audio_source.js.map +1 -0
- package/dist/audio_stream.d.ts +23 -0
- package/dist/audio_stream.js +54 -0
- package/dist/audio_stream.js.map +1 -0
- package/dist/e2ee.d.ts +43 -0
- package/dist/e2ee.js +232 -0
- package/dist/e2ee.js.map +1 -0
- package/dist/ffi_client.d.ts +22 -0
- package/dist/ffi_client.js +57 -0
- package/dist/ffi_client.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +71 -0
- package/dist/index.js.map +1 -0
- package/dist/native.d.ts +5 -0
- package/dist/native.js +297 -0
- package/dist/native.js.map +1 -0
- package/dist/participant.d.ts +29 -0
- package/dist/participant.js +120 -0
- package/dist/participant.js.map +1 -0
- package/dist/proto/audio_frame_pb.d.ts +555 -0
- package/dist/proto/audio_frame_pb.js +861 -0
- package/dist/proto/audio_frame_pb.js.map +1 -0
- package/dist/proto/e2ee_pb.d.ts +651 -0
- package/dist/proto/e2ee_pb.js +906 -0
- package/dist/proto/e2ee_pb.js.map +1 -0
- package/dist/proto/ffi_pb.d.ts +671 -0
- package/dist/proto/ffi_pb.js +459 -0
- package/dist/proto/ffi_pb.js.map +1 -0
- package/dist/proto/handle_pb.d.ts +29 -0
- package/dist/proto/handle_pb.js +59 -0
- package/dist/proto/handle_pb.js.map +1 -0
- package/dist/proto/participant_pb.d.ts +53 -0
- package/dist/proto/participant_pb.js +93 -0
- package/dist/proto/participant_pb.js.map +1 -0
- package/dist/proto/room_pb.d.ts +1479 -0
- package/dist/proto/room_pb.js +2172 -0
- package/dist/proto/room_pb.js.map +1 -0
- package/dist/proto/stats_pb.d.ts +1712 -0
- package/dist/proto/stats_pb.js +2238 -0
- package/dist/proto/stats_pb.js.map +1 -0
- package/dist/proto/track_pb.d.ts +352 -0
- package/dist/proto/track_pb.js +550 -0
- package/dist/proto/track_pb.js.map +1 -0
- package/dist/proto/video_frame_pb.d.ts +854 -0
- package/dist/proto/video_frame_pb.js +1214 -0
- package/dist/proto/video_frame_pb.js.map +1 -0
- package/dist/room.d.ts +94 -0
- package/dist/room.js +285 -0
- package/dist/room.js.map +1 -0
- package/dist/track.d.ts +34 -0
- package/dist/track.js +72 -0
- package/dist/track.js.map +1 -0
- package/dist/track_publication.d.ts +30 -0
- package/dist/track_publication.js +66 -0
- package/dist/track_publication.js.map +1 -0
- package/dist/video_frame.d.ts +110 -0
- package/dist/video_frame.js +364 -0
- package/dist/video_frame.js.map +1 -0
- package/dist/video_source.d.ts +13 -0
- package/dist/video_source.js +44 -0
- package/dist/video_source.js.map +1 -0
- package/dist/video_stream.d.ts +23 -0
- package/dist/video_stream.js +56 -0
- package/dist/video_stream.js.map +1 -0
- package/package.json +18 -10
- package/src/native.js +25 -0
- package/.prettierrc +0 -7
- package/generate_proto.sh +0 -34
- package/tsconfig.json +0 -14
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RemoteTrackPublication = exports.LocalTrackPublication = exports.TrackPublication = void 0;
|
|
4
|
+
const ffi_client_1 = require("./ffi_client");
|
|
5
|
+
const native_1 = require("./native");
|
|
6
|
+
const room_pb_1 = require("./proto/room_pb");
|
|
7
|
+
class TrackPublication {
|
|
8
|
+
constructor(ownedInfo) {
|
|
9
|
+
this.info = ownedInfo.info;
|
|
10
|
+
this.ffiHandle = new native_1.FfiHandle(ownedInfo.handle.id);
|
|
11
|
+
}
|
|
12
|
+
get sid() {
|
|
13
|
+
return this.info.sid;
|
|
14
|
+
}
|
|
15
|
+
get name() {
|
|
16
|
+
return this.info.name;
|
|
17
|
+
}
|
|
18
|
+
get kind() {
|
|
19
|
+
return this.info.kind;
|
|
20
|
+
}
|
|
21
|
+
get source() {
|
|
22
|
+
return this.info.source;
|
|
23
|
+
}
|
|
24
|
+
get simulcasted() {
|
|
25
|
+
return this.info.simulcasted;
|
|
26
|
+
}
|
|
27
|
+
get width() {
|
|
28
|
+
return this.info.width;
|
|
29
|
+
}
|
|
30
|
+
get height() {
|
|
31
|
+
return this.info.height;
|
|
32
|
+
}
|
|
33
|
+
get mimeType() {
|
|
34
|
+
return this.info.mimeType;
|
|
35
|
+
}
|
|
36
|
+
get muted() {
|
|
37
|
+
return this.info.muted;
|
|
38
|
+
}
|
|
39
|
+
get encryptionType() {
|
|
40
|
+
return this.info.encryptionType;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.TrackPublication = TrackPublication;
|
|
44
|
+
class LocalTrackPublication extends TrackPublication {
|
|
45
|
+
constructor(ownedInfo) {
|
|
46
|
+
super(ownedInfo);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.LocalTrackPublication = LocalTrackPublication;
|
|
50
|
+
class RemoteTrackPublication extends TrackPublication {
|
|
51
|
+
constructor(ownedInfo) {
|
|
52
|
+
super(ownedInfo);
|
|
53
|
+
this.subscribed = false;
|
|
54
|
+
}
|
|
55
|
+
setSubscribed(subscribed) {
|
|
56
|
+
let req = new room_pb_1.SetSubscribedRequest({
|
|
57
|
+
subscribe: subscribed,
|
|
58
|
+
publicationHandle: this.ffiHandle.handle,
|
|
59
|
+
});
|
|
60
|
+
ffi_client_1.FfiClient.instance.request({
|
|
61
|
+
message: { case: 'setSubscribed', value: req },
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.RemoteTrackPublication = RemoteTrackPublication;
|
|
66
|
+
//# sourceMappingURL=track_publication.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"track_publication.js","sourceRoot":"","sources":["../src/track_publication.ts"],"names":[],"mappings":";;;AAAA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AC,CAAC;QAHnB,eAAU,GAAY,KAAK,CAAC;IAI5B,CAAC;IAED,aAAa,CAAC,UAAmB;QAC/B,IAAI,GAAG,GAAG,IAAI,8BAAoB,CAAC;YACjC,SAAS,EAAE,UAAU;YACrB,iBAAiB,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM;SACzC,CAAC,CAAC;QAEH,sBAAS,CAAC,QAAQ,CAAC,OAAO,CAAwB;YAChD,OAAO,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,GAAG,EAAE;SAC/C,CAAC,CAAC;IACL,CAAC;CACF;AAjBD,wDAiBC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { OwnedVideoFrameBuffer, VideoFormatType, VideoFrameBufferInfo, VideoFrameBufferType, VideoRotation } from './proto/video_frame_pb';
|
|
2
|
+
export declare class VideoFrame {
|
|
3
|
+
timestampUs: number;
|
|
4
|
+
rotation: VideoRotation;
|
|
5
|
+
buffer: VideoFrameBuffer;
|
|
6
|
+
constructor(timestampUs: number, rotation: VideoRotation, buffer: VideoFrameBuffer);
|
|
7
|
+
}
|
|
8
|
+
export declare abstract class VideoFrameBuffer {
|
|
9
|
+
data: Uint8Array;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
bufferType: VideoFrameBufferType;
|
|
13
|
+
constructor(data: Uint8Array, width: number, height: number, bufferType: VideoFrameBufferType);
|
|
14
|
+
/** @internal */
|
|
15
|
+
abstract protoInfo(): VideoFrameBufferInfo;
|
|
16
|
+
/** @internal */
|
|
17
|
+
static fromOwnedInfo(owned: OwnedVideoFrameBuffer): VideoFrameBuffer;
|
|
18
|
+
}
|
|
19
|
+
export declare class NativeBuffer extends VideoFrameBuffer {
|
|
20
|
+
private info;
|
|
21
|
+
constructor(ownedInfo: OwnedVideoFrameBuffer);
|
|
22
|
+
/** @internal */
|
|
23
|
+
protoInfo(): VideoFrameBufferInfo;
|
|
24
|
+
}
|
|
25
|
+
export declare abstract class PlanarYuvBuffer extends VideoFrameBuffer {
|
|
26
|
+
strideY: number;
|
|
27
|
+
strideU: number;
|
|
28
|
+
strideV: number;
|
|
29
|
+
chromaWidth: number;
|
|
30
|
+
chromaHeight: number;
|
|
31
|
+
constructor(data: Uint8Array, width: number, height: number, bufferType: VideoFrameBufferType, strideY: number, strideU: number, strideV: number, chromaWidth: number, chromaHeight: number);
|
|
32
|
+
/** @internal */
|
|
33
|
+
protoInfo(): VideoFrameBufferInfo;
|
|
34
|
+
}
|
|
35
|
+
export declare abstract class PlanarYuv8Buffer extends PlanarYuvBuffer {
|
|
36
|
+
constructor(data: Uint8Array, width: number, height: number, bufferType: VideoFrameBufferType, strideY: number, strideU: number, strideV: number, chromaWidth: number, chromaHeight: number);
|
|
37
|
+
/** @internal */
|
|
38
|
+
protoInfo(): VideoFrameBufferInfo;
|
|
39
|
+
dataY(): Uint8Array;
|
|
40
|
+
dataU(): Uint8Array;
|
|
41
|
+
dataV(): Uint8Array;
|
|
42
|
+
}
|
|
43
|
+
export declare abstract class PlanarYuv16Buffer extends PlanarYuvBuffer {
|
|
44
|
+
constructor(data: Uint16Array, width: number, height: number, bufferType: VideoFrameBufferType, strideY: number, strideU: number, strideV: number, chromaWidth: number, chromaHeight: number);
|
|
45
|
+
/** @internal */
|
|
46
|
+
protoInfo(): VideoFrameBufferInfo;
|
|
47
|
+
dataY(): Uint16Array;
|
|
48
|
+
dataU(): Uint16Array;
|
|
49
|
+
dataV(): Uint16Array;
|
|
50
|
+
}
|
|
51
|
+
export declare abstract class BiplanarYuv8Buffer extends VideoFrameBuffer {
|
|
52
|
+
strideY: number;
|
|
53
|
+
strideUV: number;
|
|
54
|
+
chromaWidth: number;
|
|
55
|
+
chromaHeight: number;
|
|
56
|
+
constructor(data: Uint8Array, width: number, height: number, bufferType: VideoFrameBufferType, strideY: number, strideUV: number, chromaWidth: number, chromaHeight: number);
|
|
57
|
+
/** @internal */
|
|
58
|
+
protoInfo(): VideoFrameBufferInfo;
|
|
59
|
+
dataY(): Uint8Array;
|
|
60
|
+
dataUV(): Uint8Array;
|
|
61
|
+
}
|
|
62
|
+
export declare class I420Buffer extends PlanarYuv8Buffer {
|
|
63
|
+
constructor(data: Uint8Array, width: number, height: number, strideY: number, strideU: number, strideV: number);
|
|
64
|
+
/** @internal */
|
|
65
|
+
static fromOwnedInfo(owned: OwnedVideoFrameBuffer): I420Buffer;
|
|
66
|
+
static calcDataSize(height: number, strideY: number, strideU: number, strideV: number): number;
|
|
67
|
+
static create(width: number, height: number): I420Buffer;
|
|
68
|
+
}
|
|
69
|
+
export declare class I420ABuffer extends PlanarYuv8Buffer {
|
|
70
|
+
strideA: number;
|
|
71
|
+
constructor(data: Uint8Array, width: number, height: number, strideY: number, strideU: number, strideV: number, strideA: number);
|
|
72
|
+
/** @internal */
|
|
73
|
+
static fromOwnedInfo(owned: OwnedVideoFrameBuffer): I420ABuffer;
|
|
74
|
+
static calcDataSize(height: number, strideY: number, strideU: number, strideV: number, strideA: number): number;
|
|
75
|
+
dataA(): Uint8Array;
|
|
76
|
+
}
|
|
77
|
+
export declare class I422Buffer extends PlanarYuv8Buffer {
|
|
78
|
+
constructor(data: Uint8Array, width: number, height: number, strideY: number, strideU: number, strideV: number);
|
|
79
|
+
/** @internal */
|
|
80
|
+
static fromOwnedInfo(owned: OwnedVideoFrameBuffer): I422Buffer;
|
|
81
|
+
static calcDataSize(height: number, strideY: number, strideU: number, strideV: number): number;
|
|
82
|
+
}
|
|
83
|
+
export declare class I444Buffer extends PlanarYuv8Buffer {
|
|
84
|
+
constructor(data: Uint8Array, width: number, height: number, strideY: number, strideU: number, strideV: number);
|
|
85
|
+
/** @internal */
|
|
86
|
+
static fromOwnedInfo(owned: OwnedVideoFrameBuffer): I444Buffer;
|
|
87
|
+
static calcDataSize(height: number, strideY: number, strideU: number, strideV: number): number;
|
|
88
|
+
}
|
|
89
|
+
export declare class I010Buffer extends PlanarYuv16Buffer {
|
|
90
|
+
constructor(data: Uint16Array, width: number, height: number, strideY: number, strideU: number, strideV: number);
|
|
91
|
+
/** @internal */
|
|
92
|
+
static fromOwnedInfo(owned: OwnedVideoFrameBuffer): I010Buffer;
|
|
93
|
+
static calcDataSize(height: number, strideY: number, strideU: number, strideV: number): number;
|
|
94
|
+
}
|
|
95
|
+
export declare class NV12Buffer extends BiplanarYuv8Buffer {
|
|
96
|
+
constructor(data: Uint8Array, width: number, height: number, strideY: number, strideUV: number);
|
|
97
|
+
/** @internal */
|
|
98
|
+
static fromOwnedInfo(owned: OwnedVideoFrameBuffer): NV12Buffer;
|
|
99
|
+
static calcDataSize(height: number, strideY: number, strideUV: number): number;
|
|
100
|
+
}
|
|
101
|
+
export declare class ArgbFrame {
|
|
102
|
+
data: Uint8Array;
|
|
103
|
+
format: VideoFormatType;
|
|
104
|
+
width: number;
|
|
105
|
+
height: number;
|
|
106
|
+
stride: number;
|
|
107
|
+
constructor(data: Uint8Array, format: VideoFormatType, width: number, height: number, stride?: number);
|
|
108
|
+
static create(format: VideoFormatType, width: number, height: number): ArgbFrame;
|
|
109
|
+
toI420(): I420Buffer;
|
|
110
|
+
}
|
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArgbFrame = exports.NV12Buffer = exports.I010Buffer = exports.I444Buffer = exports.I422Buffer = exports.I420ABuffer = exports.I420Buffer = exports.BiplanarYuv8Buffer = exports.PlanarYuv16Buffer = exports.PlanarYuv8Buffer = exports.PlanarYuvBuffer = exports.NativeBuffer = exports.VideoFrameBuffer = exports.VideoFrame = void 0;
|
|
4
|
+
const ffi_client_1 = require("./ffi_client");
|
|
5
|
+
const video_frame_pb_1 = require("./proto/video_frame_pb");
|
|
6
|
+
class VideoFrame {
|
|
7
|
+
constructor(timestampUs, rotation, buffer) {
|
|
8
|
+
this.timestampUs = timestampUs;
|
|
9
|
+
this.rotation = rotation;
|
|
10
|
+
this.buffer = buffer;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.VideoFrame = VideoFrame;
|
|
14
|
+
class VideoFrameBuffer {
|
|
15
|
+
constructor(data, width, height, bufferType) {
|
|
16
|
+
this.data = data;
|
|
17
|
+
this.width = width;
|
|
18
|
+
this.height = height;
|
|
19
|
+
this.bufferType = bufferType;
|
|
20
|
+
}
|
|
21
|
+
/** @internal */
|
|
22
|
+
static fromOwnedInfo(owned) {
|
|
23
|
+
let info = owned.info;
|
|
24
|
+
switch (info.bufferType) {
|
|
25
|
+
case video_frame_pb_1.VideoFrameBufferType.NATIVE:
|
|
26
|
+
return NativeBuffer.fromOwnedInfo(owned);
|
|
27
|
+
case video_frame_pb_1.VideoFrameBufferType.I420:
|
|
28
|
+
return I420Buffer.fromOwnedInfo(owned);
|
|
29
|
+
case video_frame_pb_1.VideoFrameBufferType.I420A:
|
|
30
|
+
return I420ABuffer.fromOwnedInfo(owned);
|
|
31
|
+
case video_frame_pb_1.VideoFrameBufferType.I422:
|
|
32
|
+
return I422Buffer.fromOwnedInfo(owned);
|
|
33
|
+
case video_frame_pb_1.VideoFrameBufferType.I444:
|
|
34
|
+
return I444Buffer.fromOwnedInfo(owned);
|
|
35
|
+
case video_frame_pb_1.VideoFrameBufferType.I010:
|
|
36
|
+
return I010Buffer.fromOwnedInfo(owned);
|
|
37
|
+
case video_frame_pb_1.VideoFrameBufferType.NV12:
|
|
38
|
+
return NV12Buffer.fromOwnedInfo(owned);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.VideoFrameBuffer = VideoFrameBuffer;
|
|
43
|
+
class NativeBuffer extends VideoFrameBuffer {
|
|
44
|
+
constructor(ownedInfo) {
|
|
45
|
+
super(new Uint8Array(), ownedInfo.info.width, ownedInfo.info.height, ownedInfo.info.bufferType);
|
|
46
|
+
this.info = ownedInfo.info;
|
|
47
|
+
}
|
|
48
|
+
/** @internal */
|
|
49
|
+
protoInfo() {
|
|
50
|
+
return this.info;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.NativeBuffer = NativeBuffer;
|
|
54
|
+
class PlanarYuvBuffer extends VideoFrameBuffer {
|
|
55
|
+
constructor(data, width, height, bufferType, strideY, strideU, strideV, chromaWidth, chromaHeight) {
|
|
56
|
+
super(data, width, height, bufferType);
|
|
57
|
+
this.strideY = strideY;
|
|
58
|
+
this.strideU = strideU;
|
|
59
|
+
this.strideV = strideV;
|
|
60
|
+
this.chromaWidth = chromaWidth;
|
|
61
|
+
this.chromaHeight = chromaHeight;
|
|
62
|
+
}
|
|
63
|
+
/** @internal */
|
|
64
|
+
protoInfo() {
|
|
65
|
+
let info = new video_frame_pb_1.VideoFrameBufferInfo({
|
|
66
|
+
width: this.width,
|
|
67
|
+
height: this.height,
|
|
68
|
+
bufferType: this.bufferType,
|
|
69
|
+
buffer: {
|
|
70
|
+
case: 'yuv',
|
|
71
|
+
value: new video_frame_pb_1.PlanarYuvBufferInfo({
|
|
72
|
+
strideY: this.strideY,
|
|
73
|
+
strideU: this.strideU,
|
|
74
|
+
strideV: this.strideV,
|
|
75
|
+
chromaWidth: this.chromaWidth,
|
|
76
|
+
chromaHeight: this.chromaHeight,
|
|
77
|
+
}),
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
return info;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
exports.PlanarYuvBuffer = PlanarYuvBuffer;
|
|
84
|
+
class PlanarYuv8Buffer extends PlanarYuvBuffer {
|
|
85
|
+
constructor(data, width, height, bufferType, strideY, strideU, strideV, chromaWidth, chromaHeight) {
|
|
86
|
+
super(data, width, height, bufferType, strideY, strideU, strideV, chromaWidth, chromaHeight);
|
|
87
|
+
}
|
|
88
|
+
/** @internal */
|
|
89
|
+
protoInfo() {
|
|
90
|
+
let info = super.protoInfo();
|
|
91
|
+
let yuv = info.buffer.value;
|
|
92
|
+
yuv.dataYPtr = ffi_client_1.FfiClient.instance.retrievePtr(this.dataY());
|
|
93
|
+
yuv.dataUPtr = ffi_client_1.FfiClient.instance.retrievePtr(this.dataU());
|
|
94
|
+
yuv.dataVPtr = ffi_client_1.FfiClient.instance.retrievePtr(this.dataV());
|
|
95
|
+
return info;
|
|
96
|
+
}
|
|
97
|
+
dataY() {
|
|
98
|
+
return this.data.subarray(0, this.strideY * this.height);
|
|
99
|
+
}
|
|
100
|
+
dataU() {
|
|
101
|
+
return this.data.subarray(this.strideY * this.height, this.strideY * this.height + this.strideU * this.chromaHeight);
|
|
102
|
+
}
|
|
103
|
+
dataV() {
|
|
104
|
+
return this.data.subarray(this.strideY * this.height + this.strideU * this.chromaHeight, this.strideY * this.height +
|
|
105
|
+
this.strideU * this.chromaHeight +
|
|
106
|
+
this.strideV * this.chromaHeight);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
exports.PlanarYuv8Buffer = PlanarYuv8Buffer;
|
|
110
|
+
class PlanarYuv16Buffer extends PlanarYuvBuffer {
|
|
111
|
+
constructor(data, width, height, bufferType, strideY, strideU, strideV, chromaWidth, chromaHeight) {
|
|
112
|
+
super(new Uint8Array(data), width, height, bufferType, strideY, strideU, strideV, chromaWidth, chromaHeight);
|
|
113
|
+
}
|
|
114
|
+
/** @internal */
|
|
115
|
+
protoInfo() {
|
|
116
|
+
let info = super.protoInfo();
|
|
117
|
+
let yuv = info.buffer.value;
|
|
118
|
+
yuv.dataYPtr = ffi_client_1.FfiClient.instance.retrievePtr(new Uint8Array(this.dataY()));
|
|
119
|
+
yuv.dataUPtr = ffi_client_1.FfiClient.instance.retrievePtr(new Uint8Array(this.dataU()));
|
|
120
|
+
yuv.dataVPtr = ffi_client_1.FfiClient.instance.retrievePtr(new Uint8Array(this.dataV()));
|
|
121
|
+
return info;
|
|
122
|
+
}
|
|
123
|
+
dataY() {
|
|
124
|
+
return new Uint16Array(this.data.subarray(0, this.strideY * this.height));
|
|
125
|
+
}
|
|
126
|
+
dataU() {
|
|
127
|
+
return new Uint16Array(this.data.subarray(this.strideY * this.height, this.strideY * this.height + this.strideU * this.chromaHeight));
|
|
128
|
+
}
|
|
129
|
+
dataV() {
|
|
130
|
+
return new Uint16Array(this.data.subarray(this.strideY * this.height + this.strideU * this.chromaHeight, this.strideY * this.height +
|
|
131
|
+
this.strideU * this.chromaHeight +
|
|
132
|
+
this.strideV * this.chromaHeight));
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
exports.PlanarYuv16Buffer = PlanarYuv16Buffer;
|
|
136
|
+
class BiplanarYuv8Buffer extends VideoFrameBuffer {
|
|
137
|
+
constructor(data, width, height, bufferType, strideY, strideUV, chromaWidth, chromaHeight) {
|
|
138
|
+
super(data, width, height, bufferType);
|
|
139
|
+
this.strideY = strideY;
|
|
140
|
+
this.strideUV = strideUV;
|
|
141
|
+
this.chromaWidth = chromaWidth;
|
|
142
|
+
this.chromaHeight = chromaHeight;
|
|
143
|
+
}
|
|
144
|
+
/** @internal */
|
|
145
|
+
protoInfo() {
|
|
146
|
+
let info = new video_frame_pb_1.VideoFrameBufferInfo({
|
|
147
|
+
width: this.width,
|
|
148
|
+
height: this.height,
|
|
149
|
+
bufferType: this.bufferType,
|
|
150
|
+
buffer: {
|
|
151
|
+
case: 'biYuv',
|
|
152
|
+
value: new video_frame_pb_1.BiplanarYuvBufferInfo({
|
|
153
|
+
strideY: this.strideY,
|
|
154
|
+
strideUv: this.strideUV,
|
|
155
|
+
chromaWidth: this.chromaWidth,
|
|
156
|
+
chromaHeight: this.chromaHeight,
|
|
157
|
+
}),
|
|
158
|
+
},
|
|
159
|
+
});
|
|
160
|
+
return info;
|
|
161
|
+
}
|
|
162
|
+
dataY() {
|
|
163
|
+
return this.data.subarray(0, this.strideY * this.height);
|
|
164
|
+
}
|
|
165
|
+
dataUV() {
|
|
166
|
+
return this.data.subarray(this.strideY * this.height, this.strideY * this.height + this.strideUV * this.chromaHeight);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
exports.BiplanarYuv8Buffer = BiplanarYuv8Buffer;
|
|
170
|
+
class I420Buffer extends PlanarYuv8Buffer {
|
|
171
|
+
constructor(data, width, height, strideY, strideU, strideV) {
|
|
172
|
+
let chromaWidth = ~~((width + 1) / 2);
|
|
173
|
+
let chromaHeight = ~~((height + 1) / 2);
|
|
174
|
+
super(data, width, height, video_frame_pb_1.VideoFrameBufferType.I420, strideY, strideU, strideV, chromaWidth, chromaHeight);
|
|
175
|
+
}
|
|
176
|
+
/** @internal */
|
|
177
|
+
static fromOwnedInfo(owned) {
|
|
178
|
+
let info = owned.info;
|
|
179
|
+
let yuv = info.buffer.value;
|
|
180
|
+
let strideY = yuv.strideY;
|
|
181
|
+
let strideU = yuv.strideU;
|
|
182
|
+
let strideV = yuv.strideV;
|
|
183
|
+
let nbytes = I420Buffer.calcDataSize(info.height, strideY, strideU, strideV);
|
|
184
|
+
let data = ffi_client_1.FfiClient.instance.copyBuffer(yuv.dataYPtr, nbytes);
|
|
185
|
+
new ffi_client_1.FfiHandle(owned.handle.id).dispose();
|
|
186
|
+
return new I420Buffer(data, info.width, info.height, strideY, strideU, strideV);
|
|
187
|
+
}
|
|
188
|
+
static calcDataSize(height, strideY, strideU, strideV) {
|
|
189
|
+
let chromaHeight = ~~((height + 1) / 2);
|
|
190
|
+
return strideY * height + strideU * chromaHeight + strideV * chromaHeight;
|
|
191
|
+
}
|
|
192
|
+
static create(width, height) {
|
|
193
|
+
let strideY = width;
|
|
194
|
+
let strideU = ~~((width + 1) / 2);
|
|
195
|
+
let strideV = ~~((width + 1) / 2);
|
|
196
|
+
let dataSize = I420Buffer.calcDataSize(height, strideY, strideU, strideV);
|
|
197
|
+
let data = new Uint8Array(dataSize);
|
|
198
|
+
return new I420Buffer(data, width, height, strideY, strideU, strideV);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
exports.I420Buffer = I420Buffer;
|
|
202
|
+
class I420ABuffer extends PlanarYuv8Buffer {
|
|
203
|
+
constructor(data, width, height, strideY, strideU, strideV, strideA) {
|
|
204
|
+
let chromaWidth = ~~((width + 1) / 2);
|
|
205
|
+
let chromaHeight = ~~((height + 1) / 2);
|
|
206
|
+
super(data, width, height, video_frame_pb_1.VideoFrameBufferType.I420A, strideY, strideU, strideV, chromaWidth, chromaHeight);
|
|
207
|
+
this.strideA = strideA;
|
|
208
|
+
}
|
|
209
|
+
/** @internal */
|
|
210
|
+
static fromOwnedInfo(owned) {
|
|
211
|
+
let info = owned.info;
|
|
212
|
+
let yuv = info.buffer.value;
|
|
213
|
+
let strideY = yuv.strideY;
|
|
214
|
+
let strideU = yuv.strideU;
|
|
215
|
+
let strideV = yuv.strideV;
|
|
216
|
+
let strideA = yuv.strideA;
|
|
217
|
+
let nbytes = I420ABuffer.calcDataSize(info.height, strideY, strideU, strideV, strideA);
|
|
218
|
+
let data = ffi_client_1.FfiClient.instance.copyBuffer(yuv.dataYPtr, nbytes);
|
|
219
|
+
new ffi_client_1.FfiHandle(owned.handle.id).dispose();
|
|
220
|
+
return new I420ABuffer(data, info.width, info.height, strideY, strideU, strideV, strideA);
|
|
221
|
+
}
|
|
222
|
+
static calcDataSize(height, strideY, strideU, strideV, strideA) {
|
|
223
|
+
let chromaHeight = ~~((height + 1) / 2);
|
|
224
|
+
return strideY * height + strideU * chromaHeight + strideV * chromaHeight + strideA * height;
|
|
225
|
+
}
|
|
226
|
+
dataA() {
|
|
227
|
+
return this.data.subarray(this.strideY * this.height +
|
|
228
|
+
this.strideU * this.chromaHeight +
|
|
229
|
+
this.strideV * this.chromaHeight, this.strideY * this.height +
|
|
230
|
+
this.strideU * this.chromaHeight +
|
|
231
|
+
this.strideV * this.chromaHeight +
|
|
232
|
+
this.strideA * this.height);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
exports.I420ABuffer = I420ABuffer;
|
|
236
|
+
class I422Buffer extends PlanarYuv8Buffer {
|
|
237
|
+
constructor(data, width, height, strideY, strideU, strideV) {
|
|
238
|
+
let chromaWidth = ~~((width + 1) / 2);
|
|
239
|
+
let chromaHeight = height;
|
|
240
|
+
super(data, width, height, video_frame_pb_1.VideoFrameBufferType.I422, strideY, strideU, strideV, chromaWidth, chromaHeight);
|
|
241
|
+
}
|
|
242
|
+
/** @internal */
|
|
243
|
+
static fromOwnedInfo(owned) {
|
|
244
|
+
let info = owned.info;
|
|
245
|
+
let yuv = info.buffer.value;
|
|
246
|
+
let strideY = yuv.strideY;
|
|
247
|
+
let strideU = yuv.strideU;
|
|
248
|
+
let strideV = yuv.strideV;
|
|
249
|
+
let nbytes = I422Buffer.calcDataSize(info.height, strideY, strideU, strideV);
|
|
250
|
+
let data = ffi_client_1.FfiClient.instance.copyBuffer(yuv.dataYPtr, nbytes);
|
|
251
|
+
new ffi_client_1.FfiHandle(owned.handle.id).dispose();
|
|
252
|
+
return new I422Buffer(data, info.width, info.height, strideY, strideU, strideV);
|
|
253
|
+
}
|
|
254
|
+
static calcDataSize(height, strideY, strideU, strideV) {
|
|
255
|
+
return strideY * height + strideU * height + strideV * height;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
exports.I422Buffer = I422Buffer;
|
|
259
|
+
class I444Buffer extends PlanarYuv8Buffer {
|
|
260
|
+
constructor(data, width, height, strideY, strideU, strideV) {
|
|
261
|
+
let chromaWidth = width;
|
|
262
|
+
let chromaHeight = height;
|
|
263
|
+
super(data, width, height, video_frame_pb_1.VideoFrameBufferType.I444, strideY, strideU, strideV, chromaWidth, chromaHeight);
|
|
264
|
+
}
|
|
265
|
+
/** @internal */
|
|
266
|
+
static fromOwnedInfo(owned) {
|
|
267
|
+
let info = owned.info;
|
|
268
|
+
let yuv = info.buffer.value;
|
|
269
|
+
let strideY = yuv.strideY;
|
|
270
|
+
let strideU = yuv.strideU;
|
|
271
|
+
let strideV = yuv.strideV;
|
|
272
|
+
let nbytes = I444Buffer.calcDataSize(info.height, strideY, strideU, strideV);
|
|
273
|
+
let data = ffi_client_1.FfiClient.instance.copyBuffer(yuv.dataYPtr, nbytes);
|
|
274
|
+
new ffi_client_1.FfiHandle(owned.handle.id).dispose();
|
|
275
|
+
return new I444Buffer(data, info.width, info.height, strideY, strideU, strideV);
|
|
276
|
+
}
|
|
277
|
+
static calcDataSize(height, strideY, strideU, strideV) {
|
|
278
|
+
return strideY * height + strideU * height + strideV * height;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
exports.I444Buffer = I444Buffer;
|
|
282
|
+
class I010Buffer extends PlanarYuv16Buffer {
|
|
283
|
+
constructor(data, width, height, strideY, strideU, strideV) {
|
|
284
|
+
let chromaWidth = ~~((width + 1) / 2);
|
|
285
|
+
let chromaHeight = ~~((height + 1) / 2);
|
|
286
|
+
super(data, width, height, video_frame_pb_1.VideoFrameBufferType.I010, strideY, strideU, strideV, chromaWidth, chromaHeight);
|
|
287
|
+
}
|
|
288
|
+
/** @internal */
|
|
289
|
+
static fromOwnedInfo(owned) {
|
|
290
|
+
let info = owned.info;
|
|
291
|
+
let yuv = info.buffer.value;
|
|
292
|
+
let strideY = yuv.strideY;
|
|
293
|
+
let strideU = yuv.strideU;
|
|
294
|
+
let strideV = yuv.strideV;
|
|
295
|
+
let nbytes = I010Buffer.calcDataSize(info.height, strideY, strideU, strideV);
|
|
296
|
+
let data = ffi_client_1.FfiClient.instance.copyBuffer(yuv.dataYPtr, nbytes);
|
|
297
|
+
new ffi_client_1.FfiHandle(owned.handle.id).dispose();
|
|
298
|
+
return new I010Buffer(new Uint16Array(data), info.width, info.height, strideY, strideU, strideV);
|
|
299
|
+
}
|
|
300
|
+
static calcDataSize(height, strideY, strideU, strideV) {
|
|
301
|
+
let chromaHeight = ~~((height + 1) / 2);
|
|
302
|
+
return (strideY * height + strideU * chromaHeight + strideV * chromaHeight) * 2;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
exports.I010Buffer = I010Buffer;
|
|
306
|
+
class NV12Buffer extends BiplanarYuv8Buffer {
|
|
307
|
+
constructor(data, width, height, strideY, strideUV) {
|
|
308
|
+
let chromaWidth = ~~((width + 1) / 2);
|
|
309
|
+
let chromaHeight = ~~((height + 1) / 2);
|
|
310
|
+
super(data, width, height, video_frame_pb_1.VideoFrameBufferType.NV12, strideY, strideUV, chromaWidth, chromaHeight);
|
|
311
|
+
}
|
|
312
|
+
/** @internal */
|
|
313
|
+
static fromOwnedInfo(owned) {
|
|
314
|
+
let info = owned.info;
|
|
315
|
+
let yuv = info.buffer.value;
|
|
316
|
+
let strideY = yuv.strideY;
|
|
317
|
+
let strideUV = yuv.strideUv;
|
|
318
|
+
let nbytes = NV12Buffer.calcDataSize(info.height, strideY, strideUV);
|
|
319
|
+
let data = ffi_client_1.FfiClient.instance.copyBuffer(yuv.dataYPtr, nbytes);
|
|
320
|
+
new ffi_client_1.FfiHandle(owned.handle.id).dispose();
|
|
321
|
+
return new NV12Buffer(data, info.width, info.height, strideY, strideUV);
|
|
322
|
+
}
|
|
323
|
+
static calcDataSize(height, strideY, strideUV) {
|
|
324
|
+
let chromaHeight = ~~((height + 1) / 2);
|
|
325
|
+
return strideY * height + strideUV * chromaHeight;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
exports.NV12Buffer = NV12Buffer;
|
|
329
|
+
class ArgbFrame {
|
|
330
|
+
constructor(data, format, width, height, stride = width * 4) {
|
|
331
|
+
this.data = data;
|
|
332
|
+
this.format = format;
|
|
333
|
+
this.width = width;
|
|
334
|
+
this.height = height;
|
|
335
|
+
this.stride = stride;
|
|
336
|
+
}
|
|
337
|
+
static create(format, width, height) {
|
|
338
|
+
let data = new Uint8Array(width * height * 4);
|
|
339
|
+
return new ArgbFrame(data, format, width, height);
|
|
340
|
+
}
|
|
341
|
+
toI420() {
|
|
342
|
+
let req = new video_frame_pb_1.ToI420Request({
|
|
343
|
+
from: {
|
|
344
|
+
case: 'argb',
|
|
345
|
+
value: {
|
|
346
|
+
format: this.format,
|
|
347
|
+
width: this.width,
|
|
348
|
+
height: this.height,
|
|
349
|
+
stride: this.stride,
|
|
350
|
+
ptr: ffi_client_1.FfiClient.instance.retrievePtr(this.data),
|
|
351
|
+
},
|
|
352
|
+
},
|
|
353
|
+
});
|
|
354
|
+
let resp = ffi_client_1.FfiClient.instance.request({
|
|
355
|
+
message: {
|
|
356
|
+
case: 'toI420',
|
|
357
|
+
value: req,
|
|
358
|
+
},
|
|
359
|
+
});
|
|
360
|
+
return I420Buffer.fromOwnedInfo(resp.buffer);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
exports.ArgbFrame = ArgbFrame;
|
|
364
|
+
//# sourceMappingURL=video_frame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video_frame.js","sourceRoot":"","sources":["../src/video_frame.ts"],"names":[],"mappings":";;;AAAA,6CAAoD;AACpD,2DAUgC;AAEhC,MAAa,UAAU;IAKrB,YAAY,WAAmB,EAAE,QAAuB,EAAE,MAAwB;QAChF,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF;AAVD,gCAUC;AAED,MAAsB,gBAAgB;IAMpC,YAAY,IAAgB,EAAE,KAAa,EAAE,MAAc,EAAE,UAAgC;QAC3F,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAKD,gBAAgB;IAChB,MAAM,CAAC,aAAa,CAAC,KAA4B;QAC/C,IAAI,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QACtB,QAAQ,IAAI,CAAC,UAAU,EAAE,CAAC;YACxB,KAAK,qCAAoB,CAAC,MAAM;gBAC9B,OAAO,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YAC3C,KAAK,qCAAoB,CAAC,IAAI;gBAC5B,OAAO,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC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AAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,MAAuB,EAAE,KAAa,EAAE,MAAc;QAClE,IAAI,IAAI,GAAG,IAAI,UAAU,CAAC,KAAK,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC;QAC9C,OAAO,IAAI,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IACpD,CAAC;IAED,MAAM;QACJ,IAAI,GAAG,GAAG,IAAI,8BAAa,CAAC;YAC1B,IAAI,EAAE;gBACJ,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE;oBACL,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,KAAK,EAAE,IAAI,CAAC,KAAK;oBACjB,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,GAAG,EAAE,sBAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;iBAC/C;aACF;SACF,CAAC,CAAC;QAEH,IAAI,IAAI,GAAG,sBAAS,CAAC,QAAQ,CAAC,OAAO,CAAiB;YACpD,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,GAAG;aACX;SACF,CAAC,CAAC;QACH,OAAO,UAAU,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC/C,CAAC;CACF;AAhDD,8BAgDC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FfiHandle } from './ffi_client';
|
|
2
|
+
import { VideoSourceInfo } from './proto/video_frame_pb';
|
|
3
|
+
import { VideoFrame } from './video_frame';
|
|
4
|
+
export declare class VideoSource {
|
|
5
|
+
/** @internal */
|
|
6
|
+
info: VideoSourceInfo;
|
|
7
|
+
/** @internal */
|
|
8
|
+
ffiHandle: FfiHandle;
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
constructor(width: number, height: number);
|
|
12
|
+
captureFrame(frame: VideoFrame): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VideoSource = void 0;
|
|
4
|
+
const ffi_client_1 = require("./ffi_client");
|
|
5
|
+
const video_frame_pb_1 = require("./proto/video_frame_pb");
|
|
6
|
+
class VideoSource {
|
|
7
|
+
constructor(width, height) {
|
|
8
|
+
this.width = width;
|
|
9
|
+
this.height = height;
|
|
10
|
+
let req = new video_frame_pb_1.NewVideoSourceRequest({
|
|
11
|
+
type: video_frame_pb_1.VideoSourceType.VIDEO_SOURCE_NATIVE,
|
|
12
|
+
resolution: {
|
|
13
|
+
width: width,
|
|
14
|
+
height: height,
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
let res = ffi_client_1.FfiClient.instance.request({
|
|
18
|
+
message: {
|
|
19
|
+
case: 'newVideoSource',
|
|
20
|
+
value: req,
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
this.info = res.source.info;
|
|
24
|
+
this.ffiHandle = new ffi_client_1.FfiHandle(res.source.handle.id);
|
|
25
|
+
}
|
|
26
|
+
captureFrame(frame) {
|
|
27
|
+
let req = new video_frame_pb_1.CaptureVideoFrameRequest({
|
|
28
|
+
sourceHandle: this.ffiHandle.handle,
|
|
29
|
+
from: {
|
|
30
|
+
case: 'info',
|
|
31
|
+
value: frame.buffer.protoInfo(),
|
|
32
|
+
},
|
|
33
|
+
frame: {
|
|
34
|
+
rotation: frame.rotation,
|
|
35
|
+
timestampUs: BigInt(frame.timestampUs),
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
ffi_client_1.FfiClient.instance.request({
|
|
39
|
+
message: { case: 'captureVideoFrame', value: req },
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.VideoSource = VideoSource;
|
|
44
|
+
//# sourceMappingURL=video_source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video_source.js","sourceRoot":"","sources":["../src/video_source.ts"],"names":[],"mappings":";;;AAAA,6CAAgE;AAChE,2DAOgC;AAGhC,MAAa,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,sCAAqB,CAAC;YAClC,IAAI,EAAE,gCAAe,CAAC,mBAAmB;YACzC,UAAU,EAAE;gBACV,KAAK,EAAE,KAAK;gBACZ,MAAM,EAAE,MAAM;aACf;SACF,CAAC,CAAC;QAEH,IAAI,GAAG,GAAG,sBAAS,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,sBAAS,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACvD,CAAC;IAED,YAAY,CAAC,KAAiB;QAC5B,IAAI,GAAG,GAAG,IAAI,yCAAwB,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,sBAAS,CAAC,QAAQ,CAAC,OAAO,CAA4B;YACpD,OAAO,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,EAAE,GAAG,EAAE;SACnD,CAAC,CAAC;IACL,CAAC;CACF;AAjDD,kCAiDC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FfiHandle } from './ffi_client';
|
|
2
|
+
import { Track } from './track';
|
|
3
|
+
import TypedEmitter from 'typed-emitter';
|
|
4
|
+
import { VideoFrame } from './video_frame';
|
|
5
|
+
import { VideoStreamInfo } from './proto/video_frame_pb';
|
|
6
|
+
export type VideoStreamCallbacks = {
|
|
7
|
+
frameReceived: (frame: VideoFrame) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare enum VideoStreamEvent {
|
|
10
|
+
FrameReceived = "frameReceived"
|
|
11
|
+
}
|
|
12
|
+
declare const VideoStream_base: new () => TypedEmitter<VideoStreamCallbacks>;
|
|
13
|
+
export declare class VideoStream extends VideoStream_base {
|
|
14
|
+
/** @internal */
|
|
15
|
+
info: VideoStreamInfo;
|
|
16
|
+
/** @internal */
|
|
17
|
+
ffiHandle: FfiHandle;
|
|
18
|
+
track: Track;
|
|
19
|
+
constructor(track: Track);
|
|
20
|
+
private onEvent;
|
|
21
|
+
close(): void;
|
|
22
|
+
}
|
|
23
|
+
export {};
|