Ver código fonte

feat(red) Add missing type defs for RFC2198Encoder.

dev1
Jaya Allamsetty 2 anos atrás
pai
commit
4283a8a7ad
1 arquivos alterados com 31 adições e 0 exclusões
  1. 31
    0
      types/auto/modules/red/red.d.ts

+ 31
- 0
types/auto/modules/red/red.d.ts Ver arquivo

@@ -0,0 +1,31 @@
1
+/**
2
+ * An encoder for RFC 2198 redundancy using WebRTC Insertable Streams.
3
+ */
4
+export class RFC2198Encoder {
5
+    /**
6
+     * @param {Number} targetRedundancy the desired amount of redundancy.
7
+     */
8
+    constructor(targetRedundancy?: number);
9
+    targetRedundancy: number;
10
+    frameBuffer: any[];
11
+    payloadType: number;
12
+    /**
13
+     * Set the desired level of redudancy. 4 means "four redundant frames plus current frame.
14
+     * It is possible to reduce this to 0 to minimize the overhead to one byte.
15
+     * @param {Number} targetRedundancy the desired amount of redundancy.
16
+     */
17
+    setRedundancy(targetRedundancy: number): void;
18
+    /**
19
+     * Set the "inner opus payload type". This is typically our RED payload type that we tell
20
+     * the other side as our opus payload type. Can be queried from the sender using getParameters()
21
+     * after setting the answer.
22
+     * @param {Number} payloadType the payload type to use for opus.
23
+     */
24
+    setPayloadType(payloadType: number): void;
25
+    /**
26
+     * This is the actual transform to add redundancy to a raw opus frame.
27
+     * @param {RTCEncodedAudioFrame} encodedFrame - Encoded audio frame.
28
+     * @param {TransformStreamDefaultController} controller - TransportStreamController.
29
+     */
30
+    addRedundancy(encodedFrame: any, controller: TransformStreamDefaultController): void;
31
+}

Carregando…
Cancelar
Salvar