@livedigital/client 3.61.0-encoded-screenshare.1 → 3.61.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/engine/media/encodedVideo/EncodedVideoSender.d.ts +1 -0
- package/dist/engine/media/encodedVideo/encodedVideoFraming.d.ts +7 -25
- package/dist/engine/media/encodedVideo/types.d.ts +1 -0
- package/dist/index.es.js +2 -2
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/types/common.d.ts +7 -6
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ import type { EncodedVideoSenderParams, EncodedVideoStatsSnapshot } from './type
|
|
|
8
8
|
export declare class EncodedVideoSender {
|
|
9
9
|
#private;
|
|
10
10
|
constructor(params: EncodedVideoSenderParams);
|
|
11
|
+
get frameId(): number;
|
|
11
12
|
start(): void;
|
|
12
13
|
requestKeyFrame(): void;
|
|
13
14
|
stop(): void;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Encoded-screenshare wire format (FROZEN v1).
|
|
2
|
+
* Encoded-screenshare wire format (FROZEN v1) — producer (packing) half.
|
|
3
3
|
*
|
|
4
4
|
* One encoded video frame (compressed codec bitstream, e.g. a VP8 frame from WebCodecs) is split
|
|
5
5
|
* into one or more SCTP messages. Each message carries a 14-byte big-endian header + a payload slice.
|
|
6
|
-
* Source of truth: docs/encoded-screenshare-design.md §5.1 (in livedigital-sdk).
|
|
7
|
-
* duplicated VERBATIM across livedigital-sdk and livedigital-server (no shared TS package);
|
|
8
|
-
* keep both copies byte-identical and in sync with the design doc.
|
|
6
|
+
* Source of truth for the format: docs/encoded-screenshare-design.md §5.1 (in livedigital-sdk).
|
|
9
7
|
*
|
|
10
|
-
*
|
|
11
|
-
* the
|
|
8
|
+
* The SDK only produces frames, so this file keeps just `packFrame`. The reassembly (consumer) half
|
|
9
|
+
* lives on the server (livedigital-server: FrameReassembler); the two sides share no TS package, so the
|
|
10
|
+
* header layout below is the contract — keep it in sync with the server's parser and the design doc.
|
|
11
|
+
*
|
|
12
|
+
* Implementation uses Uint8Array + DataView only (no Node Buffer API).
|
|
12
13
|
*
|
|
13
14
|
* Header layout (big-endian):
|
|
14
15
|
* 0 u8 version = 1
|
|
@@ -34,27 +35,8 @@ export interface PackFrameInput {
|
|
|
34
35
|
/** Compressed codec bitstream for a single frame. */
|
|
35
36
|
data: Uint8Array;
|
|
36
37
|
}
|
|
37
|
-
export interface CompleteFrame {
|
|
38
|
-
frameId: number;
|
|
39
|
-
rtpTimestamp90k: number;
|
|
40
|
-
keyFrame: boolean;
|
|
41
|
-
data: Uint8Array;
|
|
42
|
-
}
|
|
43
38
|
/**
|
|
44
39
|
* Split one encoded frame into wire messages. Returns >= 1 Uint8Array messages, each ready to be sent
|
|
45
40
|
* over a DataProducer.
|
|
46
41
|
*/
|
|
47
42
|
export declare function packFrame(input: PackFrameInput, maxMessageBytes?: number): Uint8Array[];
|
|
48
|
-
/**
|
|
49
|
-
* Reassembles wire messages back into complete encoded frames. Stateful (buffers multi-fragment
|
|
50
|
-
* frames). `push()` returns a CompleteFrame once all fragments of a frame have arrived, else null.
|
|
51
|
-
*
|
|
52
|
-
* Single-fragment frames are returned immediately (zero-copy: `data` aliases the input message's
|
|
53
|
-
* payload). Multi-fragment payloads are copied. `maxPending` bounds memory against never-completing
|
|
54
|
-
* frames (a lost fragment on an unreliable channel); on reliable-ordered SCTP it should stay ~1.
|
|
55
|
-
*/
|
|
56
|
-
export declare class FrameReassembler {
|
|
57
|
-
#private;
|
|
58
|
-
constructor(maxPending?: number);
|
|
59
|
-
push(message: Uint8Array): CompleteFrame | null;
|
|
60
|
-
}
|