mediasoup 3.18.1 → 3.19.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/node/lib/Router.d.ts +1 -3
- package/node/lib/Router.d.ts.map +1 -1
- package/node/lib/Router.js +7 -4
- package/node/lib/RouterTypes.d.ts +9 -0
- package/node/lib/RouterTypes.d.ts.map +1 -1
- package/node/lib/Worker.d.ts +0 -2
- package/node/lib/Worker.d.ts.map +1 -1
- package/node/lib/Worker.js +29 -9
- package/node/lib/fbs/consumer/degrade-request.d.ts +30 -0
- package/node/lib/fbs/consumer/degrade-request.d.ts.map +1 -0
- package/node/lib/fbs/consumer/degrade-request.js +91 -0
- package/node/lib/fbs/consumer/enable-delay-and-loss-request.d.ts +24 -0
- package/node/lib/fbs/consumer/enable-delay-and-loss-request.d.ts.map +1 -0
- package/node/lib/fbs/consumer/enable-delay-and-loss-request.js +69 -0
- package/node/lib/fbs/producer/degrade-request.d.ts +30 -0
- package/node/lib/fbs/producer/degrade-request.d.ts.map +1 -0
- package/node/lib/fbs/producer/degrade-request.js +91 -0
- package/node/lib/fbs/worker/close-request.d.ts +18 -0
- package/node/lib/fbs/worker/close-request.d.ts.map +1 -0
- package/node/lib/fbs/worker/close-request.js +45 -0
- package/node/lib/test/test-PipeTransport.js +41 -10
- package/package.json +4 -4
- package/worker/include/RTC/RtpRetransmissionBuffer.hpp +2 -0
- package/worker/src/RTC/RtpRetransmissionBuffer.cpp +1 -0
- package/worker/src/RTC/RtpStreamSend.cpp +3 -0
- package/worker/src/RTC/SvcConsumer.cpp +1 -4
- package/worker/test/src/RTC/TestRtpStreamSend.cpp +19 -16
package/node/lib/Router.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ import type { ActiveSpeakerObserver, ActiveSpeakerObserverOptions } from './Acti
|
|
|
10
10
|
import type { AudioLevelObserver, AudioLevelObserverOptions } from './AudioLevelObserverTypes';
|
|
11
11
|
import type { RtpCapabilities, RouterRtpCodecCapability } from './rtpParametersTypes';
|
|
12
12
|
import type { AppData } from './types';
|
|
13
|
-
import * as FbsRouter from './fbs/router';
|
|
14
13
|
export type RouterInternal = {
|
|
15
14
|
routerId: string;
|
|
16
15
|
};
|
|
@@ -44,7 +43,7 @@ export declare class RouterImpl<RouterAppData extends AppData = AppData> extends
|
|
|
44
43
|
createPlainTransport<PlainTransportAppData extends AppData = AppData>({ listenInfo, rtcpListenInfo, listenIp, port, rtcpMux, comedia, enableSctp, numSctpStreams, maxSctpMessageSize, sctpSendBufferSize, enableSrtp, srtpCryptoSuite, appData, }: PlainTransportOptions<PlainTransportAppData>): Promise<PlainTransport<PlainTransportAppData>>;
|
|
45
44
|
createPipeTransport<PipeTransportAppData extends AppData = AppData>({ listenInfo, listenIp, port, enableSctp, numSctpStreams, maxSctpMessageSize, sctpSendBufferSize, enableRtx, enableSrtp, appData, }: PipeTransportOptions<PipeTransportAppData>): Promise<PipeTransport<PipeTransportAppData>>;
|
|
46
45
|
createDirectTransport<DirectTransportAppData extends AppData = AppData>({ maxMessageSize, appData, }?: DirectTransportOptions<DirectTransportAppData>): Promise<DirectTransport<DirectTransportAppData>>;
|
|
47
|
-
pipeToRouter({ producerId, dataProducerId, router, listenInfo, listenIp, enableSctp, numSctpStreams, enableRtx, enableSrtp, }: PipeToRouterOptions): Promise<PipeToRouterResult>;
|
|
46
|
+
pipeToRouter({ producerId, dataProducerId, router, keepId, listenInfo, listenIp, enableSctp, numSctpStreams, enableRtx, enableSrtp, }: PipeToRouterOptions): Promise<PipeToRouterResult>;
|
|
48
47
|
addPipeTransportPair(pipeTransportPairKey: string, pipeTransportPairPromise: Promise<PipeTransportPair>): void;
|
|
49
48
|
createActiveSpeakerObserver<ActiveSpeakerObserverAppData extends AppData = AppData>({ interval, appData, }?: ActiveSpeakerObserverOptions<ActiveSpeakerObserverAppData>): Promise<ActiveSpeakerObserver<ActiveSpeakerObserverAppData>>;
|
|
50
49
|
createAudioLevelObserver<AudioLevelObserverAppData extends AppData = AppData>({ maxEntries, threshold, interval, appData, }?: AudioLevelObserverOptions<AudioLevelObserverAppData>): Promise<AudioLevelObserver<AudioLevelObserverAppData>>;
|
|
@@ -55,6 +54,5 @@ export declare class RouterImpl<RouterAppData extends AppData = AppData> extends
|
|
|
55
54
|
updateMediaCodecs(mediaCodecs: RouterRtpCodecCapability[]): void;
|
|
56
55
|
private handleListenerError;
|
|
57
56
|
}
|
|
58
|
-
export declare function parseRouterDumpResponse(binary: FbsRouter.DumpResponse): RouterDump;
|
|
59
57
|
export {};
|
|
60
58
|
//# sourceMappingURL=Router.d.ts.map
|
package/node/lib/Router.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Router.d.ts","sourceRoot":"","sources":["../src/Router.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAGxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EACX,MAAM,EACN,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,cAAc,EAEd,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACX,SAAS,EAGT,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EACX,eAAe,EACf,sBAAsB,EACtB,MAAM,wBAAwB,CAAC;AAKhC,OAAO,KAAK,EACX,cAAc,EACd,qBAAqB,EACrB,MAAM,uBAAuB,CAAC;AAK/B,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAKhF,OAAO,KAAK,EACX,eAAe,EACf,sBAAsB,EACtB,MAAM,wBAAwB,CAAC;AAUhC,OAAO,KAAK,EACX,qBAAqB,EACrB,4BAA4B,EAC5B,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EACX,kBAAkB,EAClB,yBAAyB,EACzB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,E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AAU,EACV,eAAe,GACf,EAAE;QACF,UAAU,EAAE,MAAM,CAAC;QACnB,eAAe,EAAE,eAAe,CAAC;KACjC,GAAG,OAAO;IAwBX,iBAAiB,CAAC,WAAW,EAAE,wBAAwB,EAAE,GAAG,IAAI;IAehE,OAAO,CAAC,mBAAmB;CAQ3B"}
|
package/node/lib/Router.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RouterImpl = void 0;
|
|
4
|
-
exports.parseRouterDumpResponse = parseRouterDumpResponse;
|
|
5
4
|
const Logger_1 = require("./Logger");
|
|
6
5
|
const enhancedEvents_1 = require("./enhancedEvents");
|
|
7
6
|
const ortc = require("./ortc");
|
|
@@ -440,7 +439,7 @@ class RouterImpl extends enhancedEvents_1.EnhancedEventEmitter {
|
|
|
440
439
|
this.#observer.safeEmit('newtransport', transport);
|
|
441
440
|
return transport;
|
|
442
441
|
}
|
|
443
|
-
async pipeToRouter({ producerId, dataProducerId, router, listenInfo, listenIp, enableSctp = true, numSctpStreams = { OS: 1024, MIS: 1024 }, enableRtx = false, enableSrtp = false, }) {
|
|
442
|
+
async pipeToRouter({ producerId, dataProducerId, router, keepId = true, listenInfo, listenIp, enableSctp = true, numSctpStreams = { OS: 1024, MIS: 1024 }, enableRtx = false, enableSrtp = false, }) {
|
|
444
443
|
logger.debug('pipeToRouter()');
|
|
445
444
|
if (!listenInfo && !listenIp) {
|
|
446
445
|
listenInfo = {
|
|
@@ -572,7 +571,8 @@ class RouterImpl extends enhancedEvents_1.EnhancedEventEmitter {
|
|
|
572
571
|
producerId: producerId,
|
|
573
572
|
});
|
|
574
573
|
pipeProducer = await remotePipeTransport.produce({
|
|
575
|
-
id
|
|
574
|
+
// If requested, generate a new id for the pipeProducer.
|
|
575
|
+
id: keepId ? producer.id : utils.generateUUIDv4(),
|
|
576
576
|
kind: pipeConsumer.kind,
|
|
577
577
|
rtpParameters: pipeConsumer.rtpParameters,
|
|
578
578
|
paused: pipeConsumer.producerPaused,
|
|
@@ -619,7 +619,8 @@ class RouterImpl extends enhancedEvents_1.EnhancedEventEmitter {
|
|
|
619
619
|
dataProducerId: dataProducerId,
|
|
620
620
|
});
|
|
621
621
|
pipeDataProducer = await remotePipeTransport.produceData({
|
|
622
|
-
id
|
|
622
|
+
// If requested, generate a new id for the pipeDataProducer.
|
|
623
|
+
id: keepId ? dataProducer.id : utils.generateUUIDv4(),
|
|
623
624
|
sctpStreamParameters: pipeDataConsumer.sctpStreamParameters,
|
|
624
625
|
label: pipeDataConsumer.label,
|
|
625
626
|
protocol: pipeDataConsumer.protocol,
|
|
@@ -643,6 +644,8 @@ class RouterImpl extends enhancedEvents_1.EnhancedEventEmitter {
|
|
|
643
644
|
}
|
|
644
645
|
}
|
|
645
646
|
else {
|
|
647
|
+
// NOTE: This cannot happen since it's guaranteed that producer or
|
|
648
|
+
// dataProducer exists, but TypeScript is not that smart.
|
|
646
649
|
throw new Error('internal error');
|
|
647
650
|
}
|
|
648
651
|
}
|
|
@@ -37,6 +37,15 @@ export type PipeToRouterOptions = {
|
|
|
37
37
|
* Target Router instance.
|
|
38
38
|
*/
|
|
39
39
|
router: Router;
|
|
40
|
+
/**
|
|
41
|
+
* Whether the `id` of the returned Producer or DataProducer should be the
|
|
42
|
+
* same than the `id` of the original Producer or DataProducer. Default true.
|
|
43
|
+
*
|
|
44
|
+
* @remarks
|
|
45
|
+
* - If set to true, then the origin router and target router cannot be in the
|
|
46
|
+
* same worker (if so, `pipeToRouter()` with throw).
|
|
47
|
+
*/
|
|
48
|
+
keepId?: boolean;
|
|
40
49
|
/**
|
|
41
50
|
* Create a SCTP association. Default true.
|
|
42
51
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RouterTypes.d.ts","sourceRoot":"","sources":["../src/RouterTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kB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AO,GAAG,OAAO,EACrE,OAAO,CAAC,EAAE,sBAAsB,CAAC,sBAAsB,CAAC,GACtD,OAAO,CAAC,eAAe,CAAC,sBAAsB,CAAC,CAAC,CAAC;IAEpD;;OAEG;IACH,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAExE;;OAEG;IACH,oBAAoB,CACnB,oBAAoB,EAAE,MAAM,EAC5B,wBAAwB,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAClD,IAAI,CAAC;IAER;;OAEG;IACH,2BAA2B,CAC1B,4BAA4B,SAAS,OAAO,GAAG,OAAO,EAEtD,OAAO,CAAC,EAAE,4BAA4B,CAAC,4BAA4B,CAAC,GAClE,OAAO,CAAC,qBAAqB,CAAC,4BAA4B,CAAC,CAAC,CAAC;IAEhE;;OAEG;IACH,wBAAwB,CAAC,yBAAyB,SAAS,OAAO,GAAG,OAAO,EAC3E,OAAO,CAAC,EAAE,yBAAyB,CAAC,yBAAyB,CAAC,GAC5D,OAAO,CAAC,kBAAkB,CAAC,yBAAyB,CAAC,CAAC,CAAC;IAE1D;;OAEG;IACH,UAAU,CAAC,EACV,UAAU,EACV,eAAe,GACf,EAAE;QACF,UAAU,EAAE,MAAM,CAAC;QACnB,eAAe,EAAE,eAAe,CAAC;KACjC,GAAG,OAAO,CAAC;IAEZ;;;OAGG;IACH,iBAAiB,CAAC,WAAW,EAAE,wBAAwB,EAAE,GAAG,IAAI,CAAC;CACjE"}
|
package/node/lib/Worker.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import type { Worker, WorkerSettings, WorkerUpdateableSettings, WorkerResourceUs
|
|
|
3
3
|
import type { WebRtcServer, WebRtcServerOptions } from './WebRtcServerTypes';
|
|
4
4
|
import type { Router, RouterOptions } from './RouterTypes';
|
|
5
5
|
import type { AppData } from './types';
|
|
6
|
-
import * as FbsWorker from './fbs/worker';
|
|
7
6
|
export declare const workerBin: string;
|
|
8
7
|
export declare class WorkerImpl<WorkerAppData extends AppData = AppData> extends EnhancedEventEmitter<WorkerEvents> implements Worker {
|
|
9
8
|
#private;
|
|
@@ -32,5 +31,4 @@ export declare class WorkerImpl<WorkerAppData extends AppData = AppData> extends
|
|
|
32
31
|
private workerDied;
|
|
33
32
|
private handleListenerError;
|
|
34
33
|
}
|
|
35
|
-
export declare function parseWorkerDumpResponse(binary: FbsWorker.DumpResponse): WorkerDump;
|
|
36
34
|
//# sourceMappingURL=Worker.d.ts.map
|
package/node/lib/Worker.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Worker.d.ts","sourceRoot":"","sources":["../src/Worker.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,KAAK,EACX,MAAM,EACN,cAAc,EACd,wBAAwB,EACxB,mBAAmB,EACnB,UAAU,EACV,YAAY,EACZ,cAAc,EAEd,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE7E,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAM3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Worker.d.ts","sourceRoot":"","sources":["../src/Worker.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,KAAK,EACX,MAAM,EACN,cAAc,EACd,wBAAwB,EACxB,mBAAmB,EACnB,UAAU,EACV,YAAY,EACZ,cAAc,EAEd,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE7E,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAM3D,OAAO,KAAK,EAAE,OAAO,EA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,CAAC,aAAa,CAAM,GAAG,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IAgDrE,OAAO,CAAC,UAAU;IAmClB,OAAO,CAAC,mBAAmB;CAQ3B"}
|
package/node/lib/Worker.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WorkerImpl = exports.workerBin = void 0;
|
|
4
|
-
exports.parseWorkerDumpResponse = parseWorkerDumpResponse;
|
|
5
4
|
const process = require("node:process");
|
|
6
5
|
const path = require("node:path");
|
|
7
6
|
const node_child_process_1 = require("node:child_process");
|
|
@@ -20,16 +19,9 @@ const FbsRequest = require("./fbs/request");
|
|
|
20
19
|
const FbsWorker = require("./fbs/worker");
|
|
21
20
|
const FbsTransport = require("./fbs/transport");
|
|
22
21
|
const protocol_1 = require("./fbs/transport/protocol");
|
|
23
|
-
// If env MEDIASOUP_WORKER_BIN is given, use it as worker binary.
|
|
24
|
-
// Otherwise if env MEDIASOUP_BUILDTYPE is 'Debug' use the Debug binary.
|
|
25
|
-
// Otherwise use the Release binary.
|
|
26
|
-
exports.workerBin = process.env['MEDIASOUP_WORKER_BIN']
|
|
27
|
-
? process.env['MEDIASOUP_WORKER_BIN']
|
|
28
|
-
: process.env['MEDIASOUP_BUILDTYPE'] === 'Debug'
|
|
29
|
-
? path.join(__dirname, '..', '..', 'worker', 'out', 'Debug', 'mediasoup-worker')
|
|
30
|
-
: path.join(__dirname, '..', '..', 'worker', 'out', 'Release', 'mediasoup-worker');
|
|
31
22
|
const logger = new Logger_1.Logger('Worker');
|
|
32
23
|
const workerLogger = new Logger_1.Logger('Worker');
|
|
24
|
+
exports.workerBin = getWorkerBin();
|
|
33
25
|
class WorkerImpl extends enhancedEvents_1.EnhancedEventEmitter {
|
|
34
26
|
// mediasoup-worker child process.
|
|
35
27
|
#child;
|
|
@@ -405,3 +397,31 @@ function parseWorkerDumpResponse(binary) {
|
|
|
405
397
|
}
|
|
406
398
|
return dump;
|
|
407
399
|
}
|
|
400
|
+
function getWorkerBin() {
|
|
401
|
+
// If MEDIASOUP_WORKER_BIN env is given, use it as worker binary.
|
|
402
|
+
if (process.env['MEDIASOUP_WORKER_BIN']) {
|
|
403
|
+
logger.debug(`getWorkerBin() | using MEDIASOUP_WORKER_BIN environment variable: ${process.env['MEDIASOUP_WORKER_BIN']}`);
|
|
404
|
+
return process.env['MEDIASOUP_WORKER_BIN'];
|
|
405
|
+
}
|
|
406
|
+
// Obtain the path of the mediasoup module.
|
|
407
|
+
let mediasoupModulePath;
|
|
408
|
+
try {
|
|
409
|
+
// NOTE: This will throw `MODULE_NOT_FOUND` if mediasoup is installed
|
|
410
|
+
// globally.
|
|
411
|
+
mediasoupModulePath = require.resolve('mediasoup');
|
|
412
|
+
// NOTE: Returned path will include 'node/lib/index.js' since that's the
|
|
413
|
+
// main entry point in package.json, so remove it.
|
|
414
|
+
mediasoupModulePath = path.join(path.dirname(mediasoupModulePath), '..', '..');
|
|
415
|
+
}
|
|
416
|
+
catch (error) {
|
|
417
|
+
logger.warn(`getWorkerBin() | require.resolve('mediasoup') failed, using __dirname: ${error}`);
|
|
418
|
+
// mediasoup module path is two folders above this file.
|
|
419
|
+
mediasoupModulePath = path.join(__dirname, '..', '..');
|
|
420
|
+
}
|
|
421
|
+
// If env MEDIASOUP_BUILDTYPE is 'Debug' use the Debug binary. Otherwise use
|
|
422
|
+
// the Release binary.
|
|
423
|
+
const buildType = process.env['MEDIASOUP_BUILDTYPE'] === 'Debug' ? 'Debug' : 'Release';
|
|
424
|
+
const workerBinPath = path.join(mediasoupModulePath, 'worker', 'out', buildType, 'mediasoup-worker');
|
|
425
|
+
logger.debug(`getWorkerBin() | detected worker binary path: ${workerBinPath}`);
|
|
426
|
+
return workerBinPath;
|
|
427
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as flatbuffers from 'flatbuffers';
|
|
2
|
+
export declare class DegradeRequest implements flatbuffers.IUnpackableObject<DegradeRequestT> {
|
|
3
|
+
bb: flatbuffers.ByteBuffer | null;
|
|
4
|
+
bb_pos: number;
|
|
5
|
+
__init(i: number, bb: flatbuffers.ByteBuffer): DegradeRequest;
|
|
6
|
+
static getRootAsDegradeRequest(bb: flatbuffers.ByteBuffer, obj?: DegradeRequest): DegradeRequest;
|
|
7
|
+
static getSizePrefixedRootAsDegradeRequest(bb: flatbuffers.ByteBuffer, obj?: DegradeRequest): DegradeRequest;
|
|
8
|
+
durationMs(): number;
|
|
9
|
+
maxDelayMs(): number;
|
|
10
|
+
delayPercent(): number;
|
|
11
|
+
lossPercent(): number;
|
|
12
|
+
static startDegradeRequest(builder: flatbuffers.Builder): void;
|
|
13
|
+
static addDurationMs(builder: flatbuffers.Builder, durationMs: number): void;
|
|
14
|
+
static addMaxDelayMs(builder: flatbuffers.Builder, maxDelayMs: number): void;
|
|
15
|
+
static addDelayPercent(builder: flatbuffers.Builder, delayPercent: number): void;
|
|
16
|
+
static addLossPercent(builder: flatbuffers.Builder, lossPercent: number): void;
|
|
17
|
+
static endDegradeRequest(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
18
|
+
static createDegradeRequest(builder: flatbuffers.Builder, durationMs: number, maxDelayMs: number, delayPercent: number, lossPercent: number): flatbuffers.Offset;
|
|
19
|
+
unpack(): DegradeRequestT;
|
|
20
|
+
unpackTo(_o: DegradeRequestT): void;
|
|
21
|
+
}
|
|
22
|
+
export declare class DegradeRequestT implements flatbuffers.IGeneratedObject {
|
|
23
|
+
durationMs: number;
|
|
24
|
+
maxDelayMs: number;
|
|
25
|
+
delayPercent: number;
|
|
26
|
+
lossPercent: number;
|
|
27
|
+
constructor(durationMs?: number, maxDelayMs?: number, delayPercent?: number, lossPercent?: number);
|
|
28
|
+
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=degrade-request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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AAC,MAAM,EAAE,UAAU,EAAC,MAAM,EAAE,YAAY,EAAC,MAAM,EAAE,WAAW,EAAC,MAAM,GAAE,WAAW,CAAC,MAAM;IAS1J,MAAM,IAAI,eAAe;IAUzB,QAAQ,CAAC,EAAE,EAAE,eAAe,GAAG,IAAI;CAMlC;AAED,qBAAa,eAAgB,YAAW,WAAW,CAAC,gBAAgB;IAE3D,UAAU,EAAE,MAAM;IAClB,UAAU,EAAE,MAAM;IAClB,YAAY,EAAE,MAAM;IACpB,WAAW,EAAE,MAAM;gBAHnB,UAAU,GAAE,MAAU,EACtB,UAAU,GAAE,MAAU,EACtB,YAAY,GAAE,MAAU,EACxB,WAAW,GAAE,MAAU;IAIhC,IAAI,CAAC,OAAO,EAAC,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,MAAM;CAQpD"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// automatically generated by the FlatBuffers compiler, do not modify
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.DegradeRequestT = exports.DegradeRequest = void 0;
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
|
6
|
+
const flatbuffers = require("flatbuffers");
|
|
7
|
+
class DegradeRequest {
|
|
8
|
+
bb = null;
|
|
9
|
+
bb_pos = 0;
|
|
10
|
+
__init(i, bb) {
|
|
11
|
+
this.bb_pos = i;
|
|
12
|
+
this.bb = bb;
|
|
13
|
+
return this;
|
|
14
|
+
}
|
|
15
|
+
static getRootAsDegradeRequest(bb, obj) {
|
|
16
|
+
return (obj || new DegradeRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
17
|
+
}
|
|
18
|
+
static getSizePrefixedRootAsDegradeRequest(bb, obj) {
|
|
19
|
+
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
|
20
|
+
return (obj || new DegradeRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
21
|
+
}
|
|
22
|
+
durationMs() {
|
|
23
|
+
const offset = this.bb.__offset(this.bb_pos, 4);
|
|
24
|
+
return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
|
|
25
|
+
}
|
|
26
|
+
maxDelayMs() {
|
|
27
|
+
const offset = this.bb.__offset(this.bb_pos, 6);
|
|
28
|
+
return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
|
|
29
|
+
}
|
|
30
|
+
delayPercent() {
|
|
31
|
+
const offset = this.bb.__offset(this.bb_pos, 8);
|
|
32
|
+
return offset ? this.bb.readUint8(this.bb_pos + offset) : 0;
|
|
33
|
+
}
|
|
34
|
+
lossPercent() {
|
|
35
|
+
const offset = this.bb.__offset(this.bb_pos, 10);
|
|
36
|
+
return offset ? this.bb.readUint8(this.bb_pos + offset) : 0;
|
|
37
|
+
}
|
|
38
|
+
static startDegradeRequest(builder) {
|
|
39
|
+
builder.startObject(4);
|
|
40
|
+
}
|
|
41
|
+
static addDurationMs(builder, durationMs) {
|
|
42
|
+
builder.addFieldInt32(0, durationMs, 0);
|
|
43
|
+
}
|
|
44
|
+
static addMaxDelayMs(builder, maxDelayMs) {
|
|
45
|
+
builder.addFieldInt16(1, maxDelayMs, 0);
|
|
46
|
+
}
|
|
47
|
+
static addDelayPercent(builder, delayPercent) {
|
|
48
|
+
builder.addFieldInt8(2, delayPercent, 0);
|
|
49
|
+
}
|
|
50
|
+
static addLossPercent(builder, lossPercent) {
|
|
51
|
+
builder.addFieldInt8(3, lossPercent, 0);
|
|
52
|
+
}
|
|
53
|
+
static endDegradeRequest(builder) {
|
|
54
|
+
const offset = builder.endObject();
|
|
55
|
+
return offset;
|
|
56
|
+
}
|
|
57
|
+
static createDegradeRequest(builder, durationMs, maxDelayMs, delayPercent, lossPercent) {
|
|
58
|
+
DegradeRequest.startDegradeRequest(builder);
|
|
59
|
+
DegradeRequest.addDurationMs(builder, durationMs);
|
|
60
|
+
DegradeRequest.addMaxDelayMs(builder, maxDelayMs);
|
|
61
|
+
DegradeRequest.addDelayPercent(builder, delayPercent);
|
|
62
|
+
DegradeRequest.addLossPercent(builder, lossPercent);
|
|
63
|
+
return DegradeRequest.endDegradeRequest(builder);
|
|
64
|
+
}
|
|
65
|
+
unpack() {
|
|
66
|
+
return new DegradeRequestT(this.durationMs(), this.maxDelayMs(), this.delayPercent(), this.lossPercent());
|
|
67
|
+
}
|
|
68
|
+
unpackTo(_o) {
|
|
69
|
+
_o.durationMs = this.durationMs();
|
|
70
|
+
_o.maxDelayMs = this.maxDelayMs();
|
|
71
|
+
_o.delayPercent = this.delayPercent();
|
|
72
|
+
_o.lossPercent = this.lossPercent();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
exports.DegradeRequest = DegradeRequest;
|
|
76
|
+
class DegradeRequestT {
|
|
77
|
+
durationMs;
|
|
78
|
+
maxDelayMs;
|
|
79
|
+
delayPercent;
|
|
80
|
+
lossPercent;
|
|
81
|
+
constructor(durationMs = 0, maxDelayMs = 0, delayPercent = 0, lossPercent = 0) {
|
|
82
|
+
this.durationMs = durationMs;
|
|
83
|
+
this.maxDelayMs = maxDelayMs;
|
|
84
|
+
this.delayPercent = delayPercent;
|
|
85
|
+
this.lossPercent = lossPercent;
|
|
86
|
+
}
|
|
87
|
+
pack(builder) {
|
|
88
|
+
return DegradeRequest.createDegradeRequest(builder, this.durationMs, this.maxDelayMs, this.delayPercent, this.lossPercent);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
exports.DegradeRequestT = DegradeRequestT;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as flatbuffers from 'flatbuffers';
|
|
2
|
+
export declare class EnableDelayAndLossRequest implements flatbuffers.IUnpackableObject<EnableDelayAndLossRequestT> {
|
|
3
|
+
bb: flatbuffers.ByteBuffer | null;
|
|
4
|
+
bb_pos: number;
|
|
5
|
+
__init(i: number, bb: flatbuffers.ByteBuffer): EnableDelayAndLossRequest;
|
|
6
|
+
static getRootAsEnableDelayAndLossRequest(bb: flatbuffers.ByteBuffer, obj?: EnableDelayAndLossRequest): EnableDelayAndLossRequest;
|
|
7
|
+
static getSizePrefixedRootAsEnableDelayAndLossRequest(bb: flatbuffers.ByteBuffer, obj?: EnableDelayAndLossRequest): EnableDelayAndLossRequest;
|
|
8
|
+
delay(): boolean;
|
|
9
|
+
loss(): boolean;
|
|
10
|
+
static startEnableDelayAndLossRequest(builder: flatbuffers.Builder): void;
|
|
11
|
+
static addDelay(builder: flatbuffers.Builder, delay: boolean): void;
|
|
12
|
+
static addLoss(builder: flatbuffers.Builder, loss: boolean): void;
|
|
13
|
+
static endEnableDelayAndLossRequest(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
14
|
+
static createEnableDelayAndLossRequest(builder: flatbuffers.Builder, delay: boolean, loss: boolean): flatbuffers.Offset;
|
|
15
|
+
unpack(): EnableDelayAndLossRequestT;
|
|
16
|
+
unpackTo(_o: EnableDelayAndLossRequestT): void;
|
|
17
|
+
}
|
|
18
|
+
export declare class EnableDelayAndLossRequestT implements flatbuffers.IGeneratedObject {
|
|
19
|
+
delay: boolean;
|
|
20
|
+
loss: boolean;
|
|
21
|
+
constructor(delay?: boolean, loss?: boolean);
|
|
22
|
+
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=enable-delay-and-loss-request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enable-delay-and-loss-request.d.ts","sourceRoot":"","sources":["../../../src/fbs/consumer/enable-delay-and-loss-request.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,WAAW,MAAM,aAAa,CAAC;AAI3C,qBAAa,yBAA0B,YAAW,WAAW,CAAC,iBAAiB,CAAC,0BAA0B,CAAC;IACzG,EAAE,EAAE,WAAW,CAAC,UAAU,GAAC,IAAI,CAAQ;IACvC,MAAM,SAAK;IACX,MAAM,CAAC,CAAC,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
|
|
4
|
+
exports.EnableDelayAndLossRequestT = exports.EnableDelayAndLossRequest = void 0;
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
|
6
|
+
const flatbuffers = require("flatbuffers");
|
|
7
|
+
class EnableDelayAndLossRequest {
|
|
8
|
+
bb = null;
|
|
9
|
+
bb_pos = 0;
|
|
10
|
+
__init(i, bb) {
|
|
11
|
+
this.bb_pos = i;
|
|
12
|
+
this.bb = bb;
|
|
13
|
+
return this;
|
|
14
|
+
}
|
|
15
|
+
static getRootAsEnableDelayAndLossRequest(bb, obj) {
|
|
16
|
+
return (obj || new EnableDelayAndLossRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
17
|
+
}
|
|
18
|
+
static getSizePrefixedRootAsEnableDelayAndLossRequest(bb, obj) {
|
|
19
|
+
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
|
20
|
+
return (obj || new EnableDelayAndLossRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
21
|
+
}
|
|
22
|
+
delay() {
|
|
23
|
+
const offset = this.bb.__offset(this.bb_pos, 4);
|
|
24
|
+
return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
|
|
25
|
+
}
|
|
26
|
+
loss() {
|
|
27
|
+
const offset = this.bb.__offset(this.bb_pos, 6);
|
|
28
|
+
return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
|
|
29
|
+
}
|
|
30
|
+
static startEnableDelayAndLossRequest(builder) {
|
|
31
|
+
builder.startObject(2);
|
|
32
|
+
}
|
|
33
|
+
static addDelay(builder, delay) {
|
|
34
|
+
builder.addFieldInt8(0, +delay, +false);
|
|
35
|
+
}
|
|
36
|
+
static addLoss(builder, loss) {
|
|
37
|
+
builder.addFieldInt8(1, +loss, +false);
|
|
38
|
+
}
|
|
39
|
+
static endEnableDelayAndLossRequest(builder) {
|
|
40
|
+
const offset = builder.endObject();
|
|
41
|
+
return offset;
|
|
42
|
+
}
|
|
43
|
+
static createEnableDelayAndLossRequest(builder, delay, loss) {
|
|
44
|
+
EnableDelayAndLossRequest.startEnableDelayAndLossRequest(builder);
|
|
45
|
+
EnableDelayAndLossRequest.addDelay(builder, delay);
|
|
46
|
+
EnableDelayAndLossRequest.addLoss(builder, loss);
|
|
47
|
+
return EnableDelayAndLossRequest.endEnableDelayAndLossRequest(builder);
|
|
48
|
+
}
|
|
49
|
+
unpack() {
|
|
50
|
+
return new EnableDelayAndLossRequestT(this.delay(), this.loss());
|
|
51
|
+
}
|
|
52
|
+
unpackTo(_o) {
|
|
53
|
+
_o.delay = this.delay();
|
|
54
|
+
_o.loss = this.loss();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.EnableDelayAndLossRequest = EnableDelayAndLossRequest;
|
|
58
|
+
class EnableDelayAndLossRequestT {
|
|
59
|
+
delay;
|
|
60
|
+
loss;
|
|
61
|
+
constructor(delay = false, loss = false) {
|
|
62
|
+
this.delay = delay;
|
|
63
|
+
this.loss = loss;
|
|
64
|
+
}
|
|
65
|
+
pack(builder) {
|
|
66
|
+
return EnableDelayAndLossRequest.createEnableDelayAndLossRequest(builder, this.delay, this.loss);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.EnableDelayAndLossRequestT = EnableDelayAndLossRequestT;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as flatbuffers from 'flatbuffers';
|
|
2
|
+
export declare class DegradeRequest implements flatbuffers.IUnpackableObject<DegradeRequestT> {
|
|
3
|
+
bb: flatbuffers.ByteBuffer | null;
|
|
4
|
+
bb_pos: number;
|
|
5
|
+
__init(i: number, bb: flatbuffers.ByteBuffer): DegradeRequest;
|
|
6
|
+
static getRootAsDegradeRequest(bb: flatbuffers.ByteBuffer, obj?: DegradeRequest): DegradeRequest;
|
|
7
|
+
static getSizePrefixedRootAsDegradeRequest(bb: flatbuffers.ByteBuffer, obj?: DegradeRequest): DegradeRequest;
|
|
8
|
+
durationMs(): number;
|
|
9
|
+
maxDelayMs(): number;
|
|
10
|
+
delayPercent(): number;
|
|
11
|
+
lossPercent(): number;
|
|
12
|
+
static startDegradeRequest(builder: flatbuffers.Builder): void;
|
|
13
|
+
static addDurationMs(builder: flatbuffers.Builder, durationMs: number): void;
|
|
14
|
+
static addMaxDelayMs(builder: flatbuffers.Builder, maxDelayMs: number): void;
|
|
15
|
+
static addDelayPercent(builder: flatbuffers.Builder, delayPercent: number): void;
|
|
16
|
+
static addLossPercent(builder: flatbuffers.Builder, lossPercent: number): void;
|
|
17
|
+
static endDegradeRequest(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
18
|
+
static createDegradeRequest(builder: flatbuffers.Builder, durationMs: number, maxDelayMs: number, delayPercent: number, lossPercent: number): flatbuffers.Offset;
|
|
19
|
+
unpack(): DegradeRequestT;
|
|
20
|
+
unpackTo(_o: DegradeRequestT): void;
|
|
21
|
+
}
|
|
22
|
+
export declare class DegradeRequestT implements flatbuffers.IGeneratedObject {
|
|
23
|
+
durationMs: number;
|
|
24
|
+
maxDelayMs: number;
|
|
25
|
+
delayPercent: number;
|
|
26
|
+
lossPercent: number;
|
|
27
|
+
constructor(durationMs?: number, maxDelayMs?: number, delayPercent?: number, lossPercent?: number);
|
|
28
|
+
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=degrade-request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"degrade-request.d.ts","sourceRoot":"","sources":["../../../src/fbs/producer/degrade-request.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,WAAW,MAAM,aAAa,CAAC;AAI3C,qBAAa,cAAe,YAAW,WAAW,CAAC,iBAAiB,CAAC,eAAe,CAAC;IACnF,EAAE,EAAE,WAAW,CAAC,UAAU,GAAC,IAAI,CAAQ;IACvC,MAAM,SAAK;IACX,MAAM,CAAC,CAAC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YAAY,EAAE,MAAM;IACpB,WAAW,EAAE,MAAM;gBAHnB,UAAU,GAAE,MAAU,EACtB,UAAU,GAAE,MAAU,EACtB,YAAY,GAAE,MAAU,EACxB,WAAW,GAAE,MAAU;IAIhC,IAAI,CAAC,OAAO,EAAC,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,MAAM;CAQpD"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// automatically generated by the FlatBuffers compiler, do not modify
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.DegradeRequestT = exports.DegradeRequest = void 0;
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
|
6
|
+
const flatbuffers = require("flatbuffers");
|
|
7
|
+
class DegradeRequest {
|
|
8
|
+
bb = null;
|
|
9
|
+
bb_pos = 0;
|
|
10
|
+
__init(i, bb) {
|
|
11
|
+
this.bb_pos = i;
|
|
12
|
+
this.bb = bb;
|
|
13
|
+
return this;
|
|
14
|
+
}
|
|
15
|
+
static getRootAsDegradeRequest(bb, obj) {
|
|
16
|
+
return (obj || new DegradeRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
17
|
+
}
|
|
18
|
+
static getSizePrefixedRootAsDegradeRequest(bb, obj) {
|
|
19
|
+
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
|
20
|
+
return (obj || new DegradeRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
21
|
+
}
|
|
22
|
+
durationMs() {
|
|
23
|
+
const offset = this.bb.__offset(this.bb_pos, 4);
|
|
24
|
+
return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
|
|
25
|
+
}
|
|
26
|
+
maxDelayMs() {
|
|
27
|
+
const offset = this.bb.__offset(this.bb_pos, 6);
|
|
28
|
+
return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
|
|
29
|
+
}
|
|
30
|
+
delayPercent() {
|
|
31
|
+
const offset = this.bb.__offset(this.bb_pos, 8);
|
|
32
|
+
return offset ? this.bb.readUint8(this.bb_pos + offset) : 0;
|
|
33
|
+
}
|
|
34
|
+
lossPercent() {
|
|
35
|
+
const offset = this.bb.__offset(this.bb_pos, 10);
|
|
36
|
+
return offset ? this.bb.readUint8(this.bb_pos + offset) : 0;
|
|
37
|
+
}
|
|
38
|
+
static startDegradeRequest(builder) {
|
|
39
|
+
builder.startObject(4);
|
|
40
|
+
}
|
|
41
|
+
static addDurationMs(builder, durationMs) {
|
|
42
|
+
builder.addFieldInt32(0, durationMs, 0);
|
|
43
|
+
}
|
|
44
|
+
static addMaxDelayMs(builder, maxDelayMs) {
|
|
45
|
+
builder.addFieldInt16(1, maxDelayMs, 0);
|
|
46
|
+
}
|
|
47
|
+
static addDelayPercent(builder, delayPercent) {
|
|
48
|
+
builder.addFieldInt8(2, delayPercent, 0);
|
|
49
|
+
}
|
|
50
|
+
static addLossPercent(builder, lossPercent) {
|
|
51
|
+
builder.addFieldInt8(3, lossPercent, 0);
|
|
52
|
+
}
|
|
53
|
+
static endDegradeRequest(builder) {
|
|
54
|
+
const offset = builder.endObject();
|
|
55
|
+
return offset;
|
|
56
|
+
}
|
|
57
|
+
static createDegradeRequest(builder, durationMs, maxDelayMs, delayPercent, lossPercent) {
|
|
58
|
+
DegradeRequest.startDegradeRequest(builder);
|
|
59
|
+
DegradeRequest.addDurationMs(builder, durationMs);
|
|
60
|
+
DegradeRequest.addMaxDelayMs(builder, maxDelayMs);
|
|
61
|
+
DegradeRequest.addDelayPercent(builder, delayPercent);
|
|
62
|
+
DegradeRequest.addLossPercent(builder, lossPercent);
|
|
63
|
+
return DegradeRequest.endDegradeRequest(builder);
|
|
64
|
+
}
|
|
65
|
+
unpack() {
|
|
66
|
+
return new DegradeRequestT(this.durationMs(), this.maxDelayMs(), this.delayPercent(), this.lossPercent());
|
|
67
|
+
}
|
|
68
|
+
unpackTo(_o) {
|
|
69
|
+
_o.durationMs = this.durationMs();
|
|
70
|
+
_o.maxDelayMs = this.maxDelayMs();
|
|
71
|
+
_o.delayPercent = this.delayPercent();
|
|
72
|
+
_o.lossPercent = this.lossPercent();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
exports.DegradeRequest = DegradeRequest;
|
|
76
|
+
class DegradeRequestT {
|
|
77
|
+
durationMs;
|
|
78
|
+
maxDelayMs;
|
|
79
|
+
delayPercent;
|
|
80
|
+
lossPercent;
|
|
81
|
+
constructor(durationMs = 0, maxDelayMs = 0, delayPercent = 0, lossPercent = 0) {
|
|
82
|
+
this.durationMs = durationMs;
|
|
83
|
+
this.maxDelayMs = maxDelayMs;
|
|
84
|
+
this.delayPercent = delayPercent;
|
|
85
|
+
this.lossPercent = lossPercent;
|
|
86
|
+
}
|
|
87
|
+
pack(builder) {
|
|
88
|
+
return DegradeRequest.createDegradeRequest(builder, this.durationMs, this.maxDelayMs, this.delayPercent, this.lossPercent);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
exports.DegradeRequestT = DegradeRequestT;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as flatbuffers from 'flatbuffers';
|
|
2
|
+
export declare class CloseRequest implements flatbuffers.IUnpackableObject<CloseRequestT> {
|
|
3
|
+
bb: flatbuffers.ByteBuffer | null;
|
|
4
|
+
bb_pos: number;
|
|
5
|
+
__init(i: number, bb: flatbuffers.ByteBuffer): CloseRequest;
|
|
6
|
+
static getRootAsCloseRequest(bb: flatbuffers.ByteBuffer, obj?: CloseRequest): CloseRequest;
|
|
7
|
+
static getSizePrefixedRootAsCloseRequest(bb: flatbuffers.ByteBuffer, obj?: CloseRequest): CloseRequest;
|
|
8
|
+
static startCloseRequest(builder: flatbuffers.Builder): void;
|
|
9
|
+
static endCloseRequest(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
10
|
+
static createCloseRequest(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
11
|
+
unpack(): CloseRequestT;
|
|
12
|
+
unpackTo(_o: CloseRequestT): void;
|
|
13
|
+
}
|
|
14
|
+
export declare class CloseRequestT implements flatbuffers.IGeneratedObject {
|
|
15
|
+
constructor();
|
|
16
|
+
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=close-request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"close-request.d.ts","sourceRoot":"","sources":["../../../src/fbs/worker/close-request.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,WAAW,MAAM,aAAa,CAAC;AAI3C,qBAAa,YAAa,YAAW,WAAW,CAAC,iBAAiB,CAAC,aAAa,CAAC;IAC/E,EAAE,EAAE,WAAW,CAAC,UAAU,GAAC,IAAI,CAAQ;IACvC,MAAM,SAAK;IACX,MAAM,CAAC,CAAC,EAAC,MAAM,EAAE,EAAE,EAAC,WAAW,CAAC,UAAU,GAAE,YAAY;IAM1D,MAAM,CAAC,qBAAqB,CAAC,EAAE,EAAC,WAAW,CAAC,UAAU,EAAE,GAAG,CAAC,EAAC,YAAY,GAAE,YAAY;IAIvF,MAAM,CAAC,iCAAiC,CAAC,EAAE,EAAC,WAAW,CAAC,UAAU,EAAE,GAAG,CAAC,EAAC,YAAY,GAAE,YAAY;IAKnG,MAAM,CAAC,iBAAiB,CAAC,OAAO,EAAC,WAAW,CAAC,OAAO;IAIpD,MAAM,CAAC,eAAe,CAAC,OAAO,EAAC,WAAW,CAAC,OAAO,GAAE,WAAW,CAAC,MAAM;IAKtE,MAAM,CAAC,kBAAkB,CAAC,OAAO,EAAC,WAAW,CAAC,OAAO,GAAE,WAAW,CAAC,MAAM;IAKzE,MAAM,IAAI,aAAa;IAKvB,QAAQ,CAAC,EAAE,EAAE,aAAa,GAAG,IAAI;CAChC;AAED,qBAAa,aAAc,YAAW,WAAW,CAAC,gBAAgB;;IAIlE,IAAI,CAAC,OAAO,EAAC,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,MAAM;CAGpD"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// automatically generated by the FlatBuffers compiler, do not modify
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.CloseRequestT = exports.CloseRequest = void 0;
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
|
6
|
+
const flatbuffers = require("flatbuffers");
|
|
7
|
+
class CloseRequest {
|
|
8
|
+
bb = null;
|
|
9
|
+
bb_pos = 0;
|
|
10
|
+
__init(i, bb) {
|
|
11
|
+
this.bb_pos = i;
|
|
12
|
+
this.bb = bb;
|
|
13
|
+
return this;
|
|
14
|
+
}
|
|
15
|
+
static getRootAsCloseRequest(bb, obj) {
|
|
16
|
+
return (obj || new CloseRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
17
|
+
}
|
|
18
|
+
static getSizePrefixedRootAsCloseRequest(bb, obj) {
|
|
19
|
+
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
|
20
|
+
return (obj || new CloseRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
21
|
+
}
|
|
22
|
+
static startCloseRequest(builder) {
|
|
23
|
+
builder.startObject(0);
|
|
24
|
+
}
|
|
25
|
+
static endCloseRequest(builder) {
|
|
26
|
+
const offset = builder.endObject();
|
|
27
|
+
return offset;
|
|
28
|
+
}
|
|
29
|
+
static createCloseRequest(builder) {
|
|
30
|
+
CloseRequest.startCloseRequest(builder);
|
|
31
|
+
return CloseRequest.endCloseRequest(builder);
|
|
32
|
+
}
|
|
33
|
+
unpack() {
|
|
34
|
+
return new CloseRequestT();
|
|
35
|
+
}
|
|
36
|
+
unpackTo(_o) { }
|
|
37
|
+
}
|
|
38
|
+
exports.CloseRequest = CloseRequest;
|
|
39
|
+
class CloseRequestT {
|
|
40
|
+
constructor() { }
|
|
41
|
+
pack(builder) {
|
|
42
|
+
return CloseRequest.createCloseRequest(builder);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.CloseRequestT = CloseRequestT;
|
|
@@ -635,12 +635,12 @@ test('router.createPipeTransport() with fixed port succeeds', async () => {
|
|
|
635
635
|
expect(pipeTransport.tuple.localPort).toEqual(port);
|
|
636
636
|
}, 2000);
|
|
637
637
|
test('transport.consume() for a pipe Producer succeeds', async () => {
|
|
638
|
-
await ctx.router1.pipeToRouter({
|
|
638
|
+
const { pipeProducer } = await ctx.router1.pipeToRouter({
|
|
639
639
|
producerId: ctx.videoProducer.id,
|
|
640
640
|
router: ctx.router2,
|
|
641
641
|
});
|
|
642
642
|
const videoConsumer = await ctx.webRtcTransport2.consume({
|
|
643
|
-
producerId:
|
|
643
|
+
producerId: pipeProducer.id,
|
|
644
644
|
rtpCapabilities: ctx.consumerDeviceCapabilities,
|
|
645
645
|
});
|
|
646
646
|
expect(typeof videoConsumer.id).toBe('string');
|
|
@@ -710,7 +710,7 @@ test('producer.pause() and producer.resume() are transmitted to pipe Consumer',
|
|
|
710
710
|
router: ctx.router2,
|
|
711
711
|
});
|
|
712
712
|
const videoConsumer = await ctx.webRtcTransport2.consume({
|
|
713
|
-
producerId:
|
|
713
|
+
producerId: pipeVideoProducer.id,
|
|
714
714
|
rtpCapabilities: ctx.consumerDeviceCapabilities,
|
|
715
715
|
});
|
|
716
716
|
expect(ctx.videoProducer.paused).toBe(true);
|
|
@@ -734,12 +734,12 @@ test('producer.pause() and producer.resume() are transmitted to pipe Consumer',
|
|
|
734
734
|
expect(pipeVideoProducer.paused).toBe(true);
|
|
735
735
|
}, 2000);
|
|
736
736
|
test('producer.close() is transmitted to pipe Consumer', async () => {
|
|
737
|
-
await ctx.router1.pipeToRouter({
|
|
737
|
+
const { pipeProducer } = await ctx.router1.pipeToRouter({
|
|
738
738
|
producerId: ctx.videoProducer.id,
|
|
739
739
|
router: ctx.router2,
|
|
740
740
|
});
|
|
741
741
|
const videoConsumer = await ctx.webRtcTransport2.consume({
|
|
742
|
-
producerId:
|
|
742
|
+
producerId: pipeProducer.id,
|
|
743
743
|
rtpCapabilities: ctx.consumerDeviceCapabilities,
|
|
744
744
|
});
|
|
745
745
|
ctx.videoProducer.close();
|
|
@@ -749,15 +749,28 @@ test('producer.close() is transmitted to pipe Consumer', async () => {
|
|
|
749
749
|
}
|
|
750
750
|
expect(videoConsumer.closed).toBe(true);
|
|
751
751
|
}, 2000);
|
|
752
|
-
test('router.pipeToRouter() fails if both Routers belong to the same Worker', async () => {
|
|
752
|
+
test('router.pipeToRouter() with keepId: true fails if both Routers belong to the same Worker', async () => {
|
|
753
753
|
const router1bis = await ctx.worker1.createRouter({
|
|
754
754
|
mediaCodecs: ctx.mediaCodecs,
|
|
755
755
|
});
|
|
756
756
|
await expect(ctx.router1.pipeToRouter({
|
|
757
757
|
producerId: ctx.videoProducer.id,
|
|
758
758
|
router: router1bis,
|
|
759
|
+
// Default value is true.
|
|
760
|
+
keepId: true,
|
|
759
761
|
})).rejects.toThrow(Error);
|
|
760
762
|
}, 2000);
|
|
763
|
+
test('router.pipeToRouter() with keepId: false does not fail if both Routers belong to the same Worker', async () => {
|
|
764
|
+
const router1bis = await ctx.worker1.createRouter({
|
|
765
|
+
mediaCodecs: ctx.mediaCodecs,
|
|
766
|
+
});
|
|
767
|
+
const { pipeProducer } = await ctx.router1.pipeToRouter({
|
|
768
|
+
producerId: ctx.videoProducer.id,
|
|
769
|
+
router: router1bis,
|
|
770
|
+
keepId: false,
|
|
771
|
+
});
|
|
772
|
+
expect(pipeProducer.id).not.toBe(ctx.videoProducer.id);
|
|
773
|
+
}, 2000);
|
|
761
774
|
test('router.pipeToRouter() succeeds with data', async () => {
|
|
762
775
|
const { pipeDataConsumer, pipeDataProducer } = (await ctx.router1.pipeToRouter({
|
|
763
776
|
dataProducerId: ctx.dataProducer.id,
|
|
@@ -795,12 +808,12 @@ test('router.pipeToRouter() succeeds with data', async () => {
|
|
|
795
808
|
expect(pipeDataProducer.protocol).toBe('bar');
|
|
796
809
|
}, 2000);
|
|
797
810
|
test('transport.dataConsume() for a pipe DataProducer succeeds', async () => {
|
|
798
|
-
await ctx.router1.pipeToRouter({
|
|
811
|
+
const { pipeDataProducer } = await ctx.router1.pipeToRouter({
|
|
799
812
|
dataProducerId: ctx.dataProducer.id,
|
|
800
813
|
router: ctx.router2,
|
|
801
814
|
});
|
|
802
815
|
const dataConsumer = await ctx.webRtcTransport2.consumeData({
|
|
803
|
-
dataProducerId:
|
|
816
|
+
dataProducerId: pipeDataProducer.id,
|
|
804
817
|
});
|
|
805
818
|
expect(typeof dataConsumer.id).toBe('string');
|
|
806
819
|
expect(dataConsumer.closed).toBe(false);
|
|
@@ -814,12 +827,12 @@ test('transport.dataConsume() for a pipe DataProducer succeeds', async () => {
|
|
|
814
827
|
expect(dataConsumer.protocol).toBe('bar');
|
|
815
828
|
}, 2000);
|
|
816
829
|
test('dataProducer.close() is transmitted to pipe DataConsumer', async () => {
|
|
817
|
-
await ctx.router1.pipeToRouter({
|
|
830
|
+
const { pipeDataProducer } = await ctx.router1.pipeToRouter({
|
|
818
831
|
dataProducerId: ctx.dataProducer.id,
|
|
819
832
|
router: ctx.router2,
|
|
820
833
|
});
|
|
821
834
|
const dataConsumer = await ctx.webRtcTransport2.consumeData({
|
|
822
|
-
dataProducerId:
|
|
835
|
+
dataProducerId: pipeDataProducer.id,
|
|
823
836
|
});
|
|
824
837
|
ctx.dataProducer.close();
|
|
825
838
|
expect(ctx.dataProducer.closed).toBe(true);
|
|
@@ -916,3 +929,21 @@ test('router.pipeToRouter() called in two Routers passing one to each other as a
|
|
|
916
929
|
expect(pipeTransportsA.size).toBe(0);
|
|
917
930
|
expect(pipeTransportsB.size).toBe(0);
|
|
918
931
|
}, 2000);
|
|
932
|
+
test('router.pipeToRouter() with neither producerId nor dataProducerId fails', async () => {
|
|
933
|
+
const router1bis = await ctx.worker1.createRouter({
|
|
934
|
+
mediaCodecs: ctx.mediaCodecs,
|
|
935
|
+
});
|
|
936
|
+
await expect(ctx.router1.pipeToRouter({
|
|
937
|
+
router: router1bis,
|
|
938
|
+
})).rejects.toThrow(Error);
|
|
939
|
+
}, 2000);
|
|
940
|
+
test('router.pipeToRouter() with both producerId and dataProducerId fails', async () => {
|
|
941
|
+
const router1bis = await ctx.worker1.createRouter({
|
|
942
|
+
mediaCodecs: ctx.mediaCodecs,
|
|
943
|
+
});
|
|
944
|
+
await expect(ctx.router1.pipeToRouter({
|
|
945
|
+
producerId: '1234',
|
|
946
|
+
dataProducerId: '5678',
|
|
947
|
+
router: router1bis,
|
|
948
|
+
})).rejects.toThrow(Error);
|
|
949
|
+
}, 2000);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mediasoup",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.19.1",
|
|
4
4
|
"description": "Cutting Edge WebRTC Video Conferencing",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Iñaki Baz Castillo <ibc@aliax.net> (https://inakibaz.me)",
|
|
@@ -110,14 +110,14 @@
|
|
|
110
110
|
"eslint-plugin-jest": "^29.0.1",
|
|
111
111
|
"eslint-plugin-prettier": "^5.5.4",
|
|
112
112
|
"globals": "^16.3.0",
|
|
113
|
-
"jest": "^30.
|
|
114
|
-
"marked": "^16.2.
|
|
113
|
+
"jest": "^30.1.3",
|
|
114
|
+
"marked": "^16.2.1",
|
|
115
115
|
"open-cli": "^8.0.0",
|
|
116
116
|
"pick-port": "^2.1.2",
|
|
117
117
|
"prettier": "^3.6.2",
|
|
118
118
|
"sctp": "^1.0.0",
|
|
119
119
|
"ts-jest": "^29.4.1",
|
|
120
120
|
"typescript": "^5.9.2",
|
|
121
|
-
"typescript-eslint": "^8.
|
|
121
|
+
"typescript-eslint": "^8.42.0"
|
|
122
122
|
}
|
|
123
123
|
}
|
|
@@ -30,6 +30,8 @@ namespace RTC
|
|
|
30
30
|
uint16_t sequenceNumber{ 0u };
|
|
31
31
|
// Correct timestamp since original packet may not have the same.
|
|
32
32
|
uint32_t timestamp{ 0u };
|
|
33
|
+
// Correct marker bit since original packet may not have the same.
|
|
34
|
+
bool marker{ false };
|
|
33
35
|
// Last time this packet was resent.
|
|
34
36
|
uint64_t resentAtMs{ 0u };
|
|
35
37
|
// Number of times this packet was resent.
|
|
@@ -173,12 +173,14 @@ namespace RTC
|
|
|
173
173
|
auto origSsrc = packet->GetSsrc();
|
|
174
174
|
auto origSeq = packet->GetSequenceNumber();
|
|
175
175
|
auto origTimestamp = packet->GetTimestamp();
|
|
176
|
+
auto origMarker = packet->HasMarker();
|
|
176
177
|
std::string origMid;
|
|
177
178
|
|
|
178
179
|
// Put correct info into the packet.
|
|
179
180
|
packet->SetSsrc(item->ssrc);
|
|
180
181
|
packet->SetSequenceNumber(item->sequenceNumber);
|
|
181
182
|
packet->SetTimestamp(item->timestamp);
|
|
183
|
+
packet->SetMarker(item->marker);
|
|
182
184
|
|
|
183
185
|
if (item->encoder != nullptr)
|
|
184
186
|
{
|
|
@@ -237,6 +239,7 @@ namespace RTC
|
|
|
237
239
|
packet->SetSsrc(origSsrc);
|
|
238
240
|
packet->SetSequenceNumber(origSeq);
|
|
239
241
|
packet->SetTimestamp(origTimestamp);
|
|
242
|
+
packet->SetMarker(origMarker);
|
|
240
243
|
}
|
|
241
244
|
}
|
|
242
245
|
|
|
@@ -44,11 +44,12 @@ static void SendRtpPacket(std::vector<std::pair<RtpStreamSend*, uint32_t>> strea
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
static void CheckRtxPacket(RtpPacket*
|
|
47
|
+
static void CheckRtxPacket(RtpPacket* rtxPacket, RtpPacket* origPacket)
|
|
48
48
|
{
|
|
49
|
-
REQUIRE(
|
|
50
|
-
REQUIRE(
|
|
51
|
-
REQUIRE(
|
|
49
|
+
REQUIRE(rtxPacket);
|
|
50
|
+
REQUIRE(rtxPacket->GetSequenceNumber() == origPacket->GetSequenceNumber());
|
|
51
|
+
REQUIRE(rtxPacket->GetTimestamp() == origPacket->GetTimestamp());
|
|
52
|
+
REQUIRE(rtxPacket->HasMarker() == origPacket->HasMarker());
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
SCENARIO("NACK and RTP packets retransmission", "[rtp][rtcp][nack]")
|
|
@@ -94,12 +95,14 @@ SCENARIO("NACK and RTP packets retransmission", "[rtp][rtcp][nack]")
|
|
|
94
95
|
auto packet1(CreateRtpPacket(rtpBuffer1, sizeof(rtpBuffer1), 21006, 1533790901));
|
|
95
96
|
// packet2 [pt:123, seq:21007, timestamp:1533790901]
|
|
96
97
|
auto packet2(CreateRtpPacket(rtpBuffer2, sizeof(rtpBuffer2), 21007, 1533790901));
|
|
98
|
+
packet2->SetMarker(true);
|
|
97
99
|
// packet3 [pt:123, seq:21008, timestamp:1533793871]
|
|
98
100
|
auto packet3(CreateRtpPacket(rtpBuffer3, sizeof(rtpBuffer3), 21008, 1533793871));
|
|
99
101
|
// packet4 [pt:123, seq:21009, timestamp:1533793871]
|
|
100
102
|
auto packet4(CreateRtpPacket(rtpBuffer4, sizeof(rtpBuffer4), 21009, 1533793871));
|
|
101
103
|
// packet5 [pt:123, seq:21010, timestamp:1533796931]
|
|
102
104
|
auto packet5(CreateRtpPacket(rtpBuffer5, sizeof(rtpBuffer5), 21010, 1533796931));
|
|
105
|
+
packet5->SetMarker(true);
|
|
103
106
|
|
|
104
107
|
// Create a RtpStreamSend instance.
|
|
105
108
|
TestRtpStreamListener testRtpStreamListener;
|
|
@@ -144,11 +147,11 @@ SCENARIO("NACK and RTP packets retransmission", "[rtp][rtcp][nack]")
|
|
|
144
147
|
|
|
145
148
|
testRtpStreamListener.retransmittedPackets.clear();
|
|
146
149
|
|
|
147
|
-
CheckRtxPacket(rtxPacket1, packet1
|
|
148
|
-
CheckRtxPacket(rtxPacket2, packet2
|
|
149
|
-
CheckRtxPacket(rtxPacket3, packet3
|
|
150
|
-
CheckRtxPacket(rtxPacket4, packet4
|
|
151
|
-
CheckRtxPacket(rtxPacket5, packet5
|
|
150
|
+
CheckRtxPacket(rtxPacket1, packet1.get());
|
|
151
|
+
CheckRtxPacket(rtxPacket2, packet2.get());
|
|
152
|
+
CheckRtxPacket(rtxPacket3, packet3.get());
|
|
153
|
+
CheckRtxPacket(rtxPacket4, packet4.get());
|
|
154
|
+
CheckRtxPacket(rtxPacket5, packet5.get());
|
|
152
155
|
}
|
|
153
156
|
|
|
154
157
|
SECTION("receive NACK and get zero retransmitted packets if useNack is not set")
|
|
@@ -306,8 +309,8 @@ SCENARIO("NACK and RTP packets retransmission", "[rtp][rtcp][nack]")
|
|
|
306
309
|
|
|
307
310
|
testRtpStreamListener1.retransmittedPackets.clear();
|
|
308
311
|
|
|
309
|
-
CheckRtxPacket(rtxPacket1, packet1
|
|
310
|
-
CheckRtxPacket(rtxPacket2, packet2
|
|
312
|
+
CheckRtxPacket(rtxPacket1, packet1.get());
|
|
313
|
+
CheckRtxPacket(rtxPacket2, packet2.get());
|
|
311
314
|
|
|
312
315
|
// Process the NACK packet on stream2.
|
|
313
316
|
stream2->ReceiveNack(&nackPacket);
|
|
@@ -319,8 +322,8 @@ SCENARIO("NACK and RTP packets retransmission", "[rtp][rtcp][nack]")
|
|
|
319
322
|
|
|
320
323
|
testRtpStreamListener2.retransmittedPackets.clear();
|
|
321
324
|
|
|
322
|
-
CheckRtxPacket(rtxPacket1, packet1
|
|
323
|
-
CheckRtxPacket(rtxPacket2, packet2
|
|
325
|
+
CheckRtxPacket(rtxPacket1, packet1.get());
|
|
326
|
+
CheckRtxPacket(rtxPacket2, packet2.get());
|
|
324
327
|
}
|
|
325
328
|
|
|
326
329
|
SECTION("retransmitted packets are correctly encoded")
|
|
@@ -531,8 +534,8 @@ SCENARIO("NACK and RTP packets retransmission", "[rtp][rtcp][nack]")
|
|
|
531
534
|
|
|
532
535
|
testRtpStreamListener.retransmittedPackets.clear();
|
|
533
536
|
|
|
534
|
-
CheckRtxPacket(rtxPacket1, packet1
|
|
535
|
-
CheckRtxPacket(rtxPacket2, packet2
|
|
537
|
+
CheckRtxPacket(rtxPacket1, packet1.get());
|
|
538
|
+
CheckRtxPacket(rtxPacket2, packet2.get());
|
|
536
539
|
}
|
|
537
540
|
|
|
538
541
|
SECTION("packets don't get retransmitted if MaxRetransmissionDelayForVideoMs is exceeded")
|
|
@@ -585,7 +588,7 @@ SCENARIO("NACK and RTP packets retransmission", "[rtp][rtcp][nack]")
|
|
|
585
588
|
|
|
586
589
|
testRtpStreamListener.retransmittedPackets.clear();
|
|
587
590
|
|
|
588
|
-
CheckRtxPacket(rtxPacket2, packet2
|
|
591
|
+
CheckRtxPacket(rtxPacket2, packet2.get());
|
|
589
592
|
}
|
|
590
593
|
|
|
591
594
|
SECTION("packets get removed from the retransmission buffer if seq number of the stream is reset")
|