From f23eceadc524c223b7bc4661cb8736e28f779820 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20Baz=20Castillo?= Date: Wed, 29 Jun 2022 23:57:29 +0200 Subject: [PATCH] Channel: move some ids from internal object to data object (#847) --- node/lib/Consumer.js | 2 +- node/lib/DataConsumer.js | 2 +- node/lib/PipeTransport.d.ts.map | 2 +- node/lib/PipeTransport.js | 10 ++++-- node/lib/Router.d.ts.map | 2 +- node/lib/Router.js | 4 +-- node/lib/Transport.d.ts.map | 2 +- node/lib/Transport.js | 7 ++-- node/src/Consumer.ts | 4 +-- node/src/DataConsumer.ts | 4 +-- node/src/PipeTransport.ts | 11 ++++-- node/src/Router.ts | 9 ++--- node/src/Transport.ts | 7 ++-- rust/src/messages.rs | 6 ++-- rust/src/router/consumer.rs | 2 -- rust/src/router/data_consumer.rs | 3 -- rust/src/router/transport.rs | 4 +-- worker/src/RTC/Router.cpp | 32 ++++++++++++----- worker/src/RTC/Transport.cpp | 60 +++++++++++++++++++++++--------- 19 files changed, 114 insertions(+), 59 deletions(-) diff --git a/node/lib/Consumer.js b/node/lib/Consumer.js index 54bb545028..1731a87816 100644 --- a/node/lib/Consumer.js +++ b/node/lib/Consumer.js @@ -58,7 +58,7 @@ class Consumer extends EnhancedEventEmitter_1.EnhancedEventEmitter { * Associated Producer id. */ get producerId() { - return this.#internal.producerId; + return this.#data.producerId; } /** * Whether the Consumer is closed. diff --git a/node/lib/DataConsumer.js b/node/lib/DataConsumer.js index 939e6200f8..17bb008bcd 100644 --- a/node/lib/DataConsumer.js +++ b/node/lib/DataConsumer.js @@ -42,7 +42,7 @@ class DataConsumer extends EnhancedEventEmitter_1.EnhancedEventEmitter { * Associated DataProducer id. */ get dataProducerId() { - return this.#internal.dataProducerId; + return this.#data.dataProducerId; } /** * Whether the DataConsumer is closed. diff --git a/node/lib/PipeTransport.d.ts.map b/node/lib/PipeTransport.d.ts.map index 83f896db95..ab271979b9 100644 --- a/node/lib/PipeTransport.d.ts.map +++ b/node/lib/PipeTransport.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"PipeTransport.d.ts","sourceRoot":"","sources":["../src/PipeTransport.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,SAAS,EACT,iBAAiB,EACjB,cAAc,EAEd,eAAe,EACf,uBAAuB,EACvB,SAAS,EACT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,oBAAY,oBAAoB,GAChC;IACC;;OAEG;IACH,QAAQ,EAAE,iBAAiB,GAAG,MAAM,CAAC;IAErC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,CAAA;AAED,oBAAY,iBAAiB,GAC7B;IAEC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB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OAAO,CAAC,iBAAiB,EAAE,CAAC;IAO9C;;;;OAIG;IACG,OAAO,CACZ,EACC,EAAE,EACF,IAAI,EACJ,cAAc,EACd,EACD;QACC,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,cAAc,CAAC,EAAE,cAAc,CAAC;KAChC,GACC,OAAO,CAAC,IAAI,CAAC;IAahB;;;;OAIG;IACG,OAAO,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,mBAAmB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAqD9E,OAAO,CAAC,yBAAyB;CAuCjC"} \ No newline at end of file +{"version":3,"file":"PipeTransport.d.ts","sourceRoot":"","sources":["../src/PipeTransport.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,SAAS,EACT,iBAAiB,EACjB,cAAc,EAEd,eAAe,EACf,uBAAuB,EACvB,SAAS,EACT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,oBAAY,oBAAoB,GAChC;IACC;;OAEG;IACH,QAAQ,EAAE,iBAAiB,GAAG,MAAM,CAAC;IAErC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,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G;IAoBvB;;OAEG;IACH,IAAI,KAAK,IAAI,cAAc,CAG1B;IAED;;OAEG;IACH,IAAI,cAAc,IAAI,cAAc,GAAG,SAAS,CAG/C;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,SAAS,GAAG,SAAS,CAGrC;IAED;;OAEG;IACH,IAAI,cAAc,IAAI,cAAc,GAAG,SAAS,CAG/C;IAED;;;;OAIG;IACH,KAAK,IAAI,IAAI;IAWb;;;;;OAKG;IACH,YAAY,IAAI,IAAI;IAWpB;;;;OAIG;IACG,QAAQ,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAO9C;;;;OAIG;IACG,OAAO,CACZ,EACC,EAAE,EACF,IAAI,EACJ,cAAc,EACd,EACD;QACC,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,cAAc,CAAC,EAAE,cAAc,CAAC;KAChC,GACC,OAAO,CAAC,IAAI,CAAC;IAahB;;;;OAIG;IACG,OAAO,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,mBAAmB,GAAG,OAAO,CAAC,QAAQ,CAAC;IA4D9E,OAAO,CAAC,yBAAyB;CAuCjC"} \ No newline at end of file diff --git a/node/lib/PipeTransport.js b/node/lib/PipeTransport.js index 5e7552cc65..38b194d752 100644 --- a/node/lib/PipeTransport.js +++ b/node/lib/PipeTransport.js @@ -113,15 +113,21 @@ class PipeTransport extends Transport_1.Transport { throw Error(`Producer with id "${producerId}" not found`); // This may throw. const rtpParameters = ortc.getPipeConsumerRtpParameters(producer.consumableRtpParameters, this.#data.rtx); - const internal = { ...this.internal, consumerId: (0, uuid_1.v4)(), producerId }; + const internal = { ...this.internal, consumerId: (0, uuid_1.v4)() }; const reqData = { + producerId, kind: producer.kind, rtpParameters, type: 'pipe', consumableRtpEncodings: producer.consumableRtpParameters.encodings }; const status = await this.channel.request('transport.consume', internal, reqData); - const data = { kind: producer.kind, rtpParameters, type: 'pipe' }; + const data = { + producerId, + kind: producer.kind, + rtpParameters, + type: 'pipe' + }; const consumer = new Consumer_1.Consumer({ internal, data, diff --git a/node/lib/Router.d.ts.map b/node/lib/Router.d.ts.map index a2a6b961d7..8bfe29039d 100644 --- a/node/lib/Router.d.ts.map +++ b/node/lib/Router.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Router.d.ts","sourceRoot":"","sources":["../src/Router.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAC9F,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD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,cAAwC,EACxC,kBAA2B,EAC3B,kBAA2B,EAC3B,UAAkB,EAClB,eAA2C,EAC3C,OAAO,EACP,EAAE,qBAAqB,GACtB,OAAO,CAAC,cAAc,CAAC;IA8E1B;;OAEG;IACG,mBAAmB,CACxB,EACC,QAAQ,EACR,IAAI,EACJ,UAAkB,EAClB,cAAwC,EACxC,kBAA8B,EAC9B,kBAA8B,EAC9B,SAAiB,EACjB,UAAkB,EAClB,OAAO,EACP,EAAE,oBAAoB,GACrB,OAAO,CAAC,aAAa,CAAC;IA4EzB;;OAEG;IACG,qBAAqB,CAC1B,EACC,cAAuB,EACvB,OAAO,EACP,GAAE,sBAGF,GACC,OAAO,CAAC,eAAe,CAAC;IA4C3B;;OAEG;IACG,YAAY,CACjB,EACC,UAAU,EACV,cAAc,EACd,MAAM,EACN,QAAsB,EACtB,UAAiB,EACjB,cAAwC,EACxC,SAAiB,EACjB,UAAkB,EAClB,EAAE,mBAAmB,GACpB,OAAO,CAAC,kBAAkB,CAAC;IA8O9B;;OAEG;IACH,oBAAoB,CACnB,oBAAoB,EAAE,MAAM,EAC5B,wBAAwB,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAClD,IAAI;IA+BP;;OAEG;IACG,2BAA2B,CAChC,EACC,QAAc,EACd,OAAO,EACP,GAAE,4BAAiC,GAClC,OAAO,CAAC,qBAAqB,CAAC;IAmCjC;;OAEG;IACG,wBAAwB,CAC7B,EACC,UAAc,EACd,SAAe,EACf,QAAe,EACf,OAAO,EACP,GAAE,yBAA8B,GAC/B,OAAO,CAAC,kBAAkB,CAAC;IAmC9B;;OAEG;IACH,UAAU,CACT,EACC,UAAU,EACV,eAAe,EACf,EACD;QACC,UAAU,EAAE,MAAM,CAAC;QACnB,eAAe,EAAE,eAAe,CAAC;KACjC,GACC,OAAO;CAuBV"} \ No newline at end of file +{"version":3,"file":"Router.d.ts","sourceRoot":"","sources":["../src/Router.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,M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AO,EACP,EAAE,oBAAoB,GACrB,OAAO,CAAC,aAAa,CAAC;IA4EzB;;OAEG;IACG,qBAAqB,CAC1B,EACC,cAAuB,EACvB,OAAO,EACP,GAAE,sBAGF,GACC,OAAO,CAAC,eAAe,CAAC;IA4C3B;;OAEG;IACG,YAAY,CACjB,EACC,UAAU,EACV,cAAc,EACd,MAAM,EACN,QAAsB,EACtB,UAAiB,EACjB,cAAwC,EACxC,SAAiB,EACjB,UAAkB,EAClB,EAAE,mBAAmB,GACpB,OAAO,CAAC,kBAAkB,CAAC;IA8O9B;;OAEG;IACH,oBAAoB,CACnB,oBAAoB,EAAE,MAAM,EAC5B,wBAAwB,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAClD,IAAI;IA+BP;;OAEG;IACG,2BAA2B,CAChC,EACC,QAAc,EACd,OAAO,EACP,GAAE,4BAAiC,GAClC,OAAO,CAAC,qBAAqB,CAAC;IAmCjC;;OAEG;IACG,wBAAwB,CAC7B,EACC,UAAc,EACd,SAAe,EACf,QAAe,EACf,OAAO,EACP,GAAE,yBAA8B,GAC/B,OAAO,CAAC,kBAAkB,CAAC;IAmC9B;;OAEG;IACH,UAAU,CACT,EACC,UAAU,EACV,eAAe,EACf,EACD;QACC,UAAU,EAAE,MAAM,CAAC;QACnB,eAAe,EAAE,eAAe,CAAC;KACjC,GACC,OAAO;CAuBV"} \ No newline at end of file diff --git a/node/lib/Router.js b/node/lib/Router.js index 95fbfe0c60..2d203290e7 100644 --- a/node/lib/Router.js +++ b/node/lib/Router.js @@ -188,10 +188,10 @@ class Router extends EnhancedEventEmitter_1.EnhancedEventEmitter { } const internal = { ...this.#internal, - transportId: (0, uuid_1.v4)(), - webRtcServerId: webRtcServer ? webRtcServer.id : undefined + transportId: (0, uuid_1.v4)() }; const reqData = { + webRtcServerId: webRtcServer ? webRtcServer.id : undefined, listenIps, port, enableUdp, diff --git a/node/lib/Transport.d.ts.map b/node/lib/Transport.d.ts.map index bd7d986c5d..37982ccad6 100644 --- a/node/lib/Transport.d.ts.map +++ b/node/lib/Transport.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Transport.d.ts","sourceRoot":"","sources":["../src/Transport.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EACN,YAAY,EACZ,mBAAmB,EAEnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,YAAY,EACZ,mBAAmB,EAEnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGlD,MAAM,WAAW,iBAAiB;IAEjC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,oBAAY,iBAAiB,GAAG,KAAK,GAAG,KAAK,CAAC;AAE9C,MAAM,WAAW,cAAc;IAE9B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,iBAAiB,CAAC;CAC5B;AAED;;GAEG;AACH,oBAAY,uBAAuB,GAAG,WAAW,GAAG,KAAK,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,uBAAuB;IAEvC;;OAEG;IACH,IAAI,EAAE,uBAAuB,CAAC;IAE9B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,IAAI,GAAG,KAAK,CAAC;IAExB;;OAEG;IACH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AAY,IAAI,IAAI;IAqDpB;;;;;OAKG;IACH,kBAAkB,IAAI,IAAI;IA0D1B;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC;IAO1B;;;;OAIG;IACG,QAAQ,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IAMhC;;;;OAIG;IAEG,OAAO,CAAC,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAMzC;;OAEG;IACG,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAU3D;;OAEG;IACG,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAU3D;;OAEG;IACG,OAAO,CACZ,EACC,EAAc,EACd,IAAI,EACJ,aAAa,EACb,MAAc,EACd,oBAAoB,EACpB,OAAO,EACP,EAAE,eAAe,GAChB,OAAO,CAAC,QAAQ,CAAC;IA+FpB;;;;OAIG;IACG,OAAO,CACZ,EACC,UAAU,EACV,eAAe,EACf,MAAc,EACd,GAAG,EACH,eAAe,EACf,SAAiB,EACjB,IAAY,EACZ,OAAO,EACP,EAAE,eAAe,GAChB,OAAO,CAAC,QAAQ,CAAC;IA4FpB;;OAEG;IACG,WAAW,CAChB,EACC,EAAc,EACd,oBAAoB,EACpB,KAAU,EACV,QAAa,EACb,OAAO,EACP,GAAE,mBAAwB,GACzB,OAAO,CAAC,YAAY,CAAC;IAmExB;;OAEG;IACG,WAAW,CAChB,EACC,cAAc,EACd,OAAO,EACP,iBAAiB,EACjB,cAAc,EACd,OAAO,EACP,EAAE,mBAAmB,GACpB,OAAO,CAAC,YAAY,CAAC;IAwGxB;;OAEG;IACG,gBAAgB,CAAC,KAAK,GAAE,uBAAuB,EAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAU5E,OAAO,CAAC,mBAAmB;CA+B3B"} \ No newline at end of file diff --git a/node/lib/Transport.js b/node/lib/Transport.js index 07dd92a46d..1e53f16d88 100644 --- a/node/lib/Transport.js +++ b/node/lib/Transport.js @@ -374,8 +374,9 @@ class Transport extends EnhancedEventEmitter_1.EnhancedEventEmitter { } } } - const internal = { ...this.internal, consumerId: (0, uuid_1.v4)(), producerId }; + const internal = { ...this.internal, consumerId: (0, uuid_1.v4)() }; const reqData = { + producerId, kind: producer.kind, rtpParameters, type: pipe ? 'pipe' : producer.type, @@ -386,6 +387,7 @@ class Transport extends EnhancedEventEmitter_1.EnhancedEventEmitter { }; const status = await this.channel.request('transport.consume', internal, reqData); const data = { + producerId, kind: producer.kind, rtpParameters, type: pipe ? 'pipe' : producer.type @@ -499,8 +501,9 @@ class Transport extends EnhancedEventEmitter_1.EnhancedEventEmitter { } } const { label, protocol } = dataProducer; - const internal = { ...this.internal, dataConsumerId: (0, uuid_1.v4)(), dataProducerId }; + const internal = { ...this.internal, dataConsumerId: (0, uuid_1.v4)() }; const reqData = { + dataProducerId, type, sctpStreamParameters, label, diff --git a/node/src/Consumer.ts b/node/src/Consumer.ts index 6853deb0e1..18d5697946 100644 --- a/node/src/Consumer.ts +++ b/node/src/Consumer.ts @@ -195,12 +195,12 @@ export class Consumer extends EnhancedEventEmitter routerId: string; transportId: string; consumerId: string; - producerId: string; }; // Consumer data. readonly #data: { + producerId: string; kind: MediaKind; rtpParameters: RtpParameters; type: ConsumerType; @@ -296,7 +296,7 @@ export class Consumer extends EnhancedEventEmitter */ get producerId(): string { - return this.#internal.producerId; + return this.#data.producerId; } /** diff --git a/node/src/DataConsumer.ts b/node/src/DataConsumer.ts index 150975ac80..6ca60c9282 100644 --- a/node/src/DataConsumer.ts +++ b/node/src/DataConsumer.ts @@ -83,13 +83,13 @@ export class DataConsumer extends EnhancedEventEmitter { routerId: string; transportId: string; - dataProducerId: string; dataConsumerId: string; }; // DataConsumer data. readonly #data: { + dataProducerId: string; type: DataConsumerType; sctpStreamParameters?: SctpStreamParameters; label: string; @@ -157,7 +157,7 @@ export class DataConsumer extends EnhancedEventEmitter */ get dataProducerId(): string { - return this.#internal.dataProducerId; + return this.#data.dataProducerId; } /** diff --git a/node/src/PipeTransport.ts b/node/src/PipeTransport.ts index bbf6b5e4c1..0c236fb211 100644 --- a/node/src/PipeTransport.ts +++ b/node/src/PipeTransport.ts @@ -287,9 +287,10 @@ export class PipeTransport const rtpParameters = ortc.getPipeConsumerRtpParameters( producer.consumableRtpParameters, this.#data.rtx); - const internal = { ...this.internal, consumerId: uuidv4(), producerId }; + const internal = { ...this.internal, consumerId: uuidv4() }; const reqData = { + producerId, kind : producer.kind, rtpParameters, type : 'pipe', @@ -299,7 +300,13 @@ export class PipeTransport const status = await this.channel.request('transport.consume', internal, reqData); - const data = { kind: producer.kind, rtpParameters, type: 'pipe' }; + const data = + { + producerId, + kind : producer.kind, + rtpParameters, + type : 'pipe' + }; const consumer = new Consumer( { diff --git a/node/src/Router.ts b/node/src/Router.ts index 674464394e..c38ba72d3a 100644 --- a/node/src/Router.ts +++ b/node/src/Router.ts @@ -404,11 +404,12 @@ export class Router extends EnhancedEventEmitter const internal = { ...this.#internal, - transportId : uuidv4(), - webRtcServerId : webRtcServer ? webRtcServer.id : undefined + transportId : uuidv4() }; - const reqData = { + const reqData = + { + webRtcServerId : webRtcServer ? webRtcServer.id : undefined, listenIps, port, enableUdp, @@ -420,7 +421,7 @@ export class Router extends EnhancedEventEmitter numSctpStreams, maxSctpMessageSize, sctpSendBufferSize, - isDataChannel : true + isDataChannel : true }; const data = webRtcServer diff --git a/node/src/Transport.ts b/node/src/Transport.ts index ccb2b34b3d..269444419e 100644 --- a/node/src/Transport.ts +++ b/node/src/Transport.ts @@ -672,9 +672,10 @@ export class Transport, @@ -921,7 +921,7 @@ pub(crate) struct ConsumerEnableTraceEventData { } request_response!( - "producer.enableTraceEvent", + "consumer.enableTraceEvent", ConsumerEnableTraceEventRequest { internal: ConsumerInternal, data: ConsumerEnableTraceEventData, diff --git a/rust/src/router/consumer.rs b/rust/src/router/consumer.rs index 2e5a54de82..ca69d3ce87 100644 --- a/rust/src/router/consumer.rs +++ b/rust/src/router/consumer.rs @@ -408,7 +408,6 @@ impl Inner { router_id: self.transport.router().id(), transport_id: self.transport.id(), consumer_id: self.id, - producer_id: self.producer_id, }, }; let weak_producer = self.weak_producer.clone(); @@ -979,7 +978,6 @@ impl Consumer { router_id: self.inner.transport.router().id(), transport_id: self.inner.transport.id(), consumer_id: self.inner.id, - producer_id: self.inner.producer_id, } } } diff --git a/rust/src/router/data_consumer.rs b/rust/src/router/data_consumer.rs index 409f2d444c..3e4f2f112b 100644 --- a/rust/src/router/data_consumer.rs +++ b/rust/src/router/data_consumer.rs @@ -235,7 +235,6 @@ impl Inner { router_id: self.transport.router().id(), transport_id: self.transport.id(), data_consumer_id: self.id, - data_producer_id: self.data_producer_id, }, }; let weak_data_producer = self.weak_data_producer.clone(); @@ -681,7 +680,6 @@ impl DataConsumer { router_id: self.inner().transport.router().id(), transport_id: self.inner().transport.id(), data_consumer_id: self.inner().id, - data_producer_id: self.inner().data_producer_id, } } } @@ -699,7 +697,6 @@ impl DirectDataConsumer { router_id: self.inner.transport.router().id(), transport_id: self.inner.transport.id(), data_consumer_id: self.inner.id, - data_producer_id: self.inner.data_producer_id, }, data: DataConsumerSendRequestData { ppid }, }, diff --git a/rust/src/router/transport.rs b/rust/src/router/transport.rs index 013a027c13..4c4d3468f9 100644 --- a/rust/src/router/transport.rs +++ b/rust/src/router/transport.rs @@ -610,9 +610,9 @@ pub(super) trait TransportImpl: TransportGeneric { router_id: self.router().id(), transport_id: self.id(), consumer_id, - producer_id: producer.id(), }, data: TransportConsumeData { + producer_id: producer.id(), kind: producer.kind(), rtp_parameters: rtp_parameters.clone(), r#type, @@ -778,10 +778,10 @@ pub(super) trait TransportImpl: TransportGeneric { internal: DataConsumerInternal { router_id: self.router().id(), transport_id: self.id(), - data_producer_id: data_producer.id(), data_consumer_id, }, data: TransportConsumeDataData { + data_producer_id: data_producer.id(), r#type, sctp_stream_parameters, label: data_producer.label().clone(), diff --git a/worker/src/RTC/Router.cpp b/worker/src/RTC/Router.cpp index 268feabb01..a47deada8f 100644 --- a/worker/src/RTC/Router.cpp +++ b/worker/src/RTC/Router.cpp @@ -209,11 +209,11 @@ namespace RTC // This may throw. SetNewTransportIdFromInternal(request->internal, transportId); - auto jsonWebRtcServerIdIt = request->internal.find("webRtcServerId"); + auto jsonWebRtcServerIdIt = request->data.find("webRtcServerId"); - if (jsonWebRtcServerIdIt == request->internal.end() || !jsonWebRtcServerIdIt->is_string()) + if (jsonWebRtcServerIdIt == request->data.end() || !jsonWebRtcServerIdIt->is_string()) { - MS_THROW_ERROR("missing internal.webRtcServerId"); + MS_THROW_TYPE_ERROR("missing webRtcServerId"); } std::string webRtcServerId = jsonWebRtcServerIdIt->get(); @@ -221,7 +221,7 @@ namespace RTC auto* webRtcServer = this->listener->OnRouterNeedWebRtcServer(this, webRtcServerId); if (!webRtcServer) - MS_THROW_ERROR("wrong internal.webRtcServerId (no associated WebRtcServer found)"); + MS_THROW_ERROR("wrong webRtcServerId (no associated WebRtcServer found)"); bool enableUdp{ true }; auto jsonEnableUdpIt = request->data.find("enableUdp"); @@ -540,12 +540,16 @@ namespace RTC auto jsonTransportIdIt = internal.find("transportId"); if (jsonTransportIdIt == internal.end() || !jsonTransportIdIt->is_string()) - MS_THROW_ERROR("missing internal.transportId"); + { + MS_THROW_TYPE_ERROR("missing transportId"); + } transportId.assign(jsonTransportIdIt->get()); if (this->mapTransports.find(transportId) != this->mapTransports.end()) + { MS_THROW_ERROR("a Transport with same transportId already exists"); + } } RTC::Transport* Router::GetTransportFromInternal(json& internal) const @@ -555,7 +559,9 @@ namespace RTC auto jsonTransportIdIt = internal.find("transportId"); if (jsonTransportIdIt == internal.end() || !jsonTransportIdIt->is_string()) - MS_THROW_ERROR("missing internal.transportId"); + { + MS_THROW_TYPE_ERROR("missing transportId"); + } auto it = this->mapTransports.find(jsonTransportIdIt->get()); @@ -574,12 +580,16 @@ namespace RTC auto jsonRtpObserverIdIt = internal.find("rtpObserverId"); if (jsonRtpObserverIdIt == internal.end() || !jsonRtpObserverIdIt->is_string()) - MS_THROW_ERROR("missing internal.rtpObserverId"); + { + MS_THROW_TYPE_ERROR("missing rtpObserverId"); + } rtpObserverId.assign(jsonRtpObserverIdIt->get()); if (this->mapRtpObservers.find(rtpObserverId) != this->mapRtpObservers.end()) + { MS_THROW_ERROR("an RtpObserver with same rtpObserverId already exists"); + } } RTC::RtpObserver* Router::GetRtpObserverFromInternal(json& internal) const @@ -589,7 +599,9 @@ namespace RTC auto jsonRtpObserverIdIt = internal.find("rtpObserverId"); if (jsonRtpObserverIdIt == internal.end() || !jsonRtpObserverIdIt->is_string()) - MS_THROW_ERROR("missing internal.rtpObserverId"); + { + MS_THROW_TYPE_ERROR("missing rtpObserverId"); + } auto it = this->mapRtpObservers.find(jsonRtpObserverIdIt->get()); @@ -608,7 +620,9 @@ namespace RTC auto jsonProducerIdIt = data.find("producerId"); if (jsonProducerIdIt == data.end() || !jsonProducerIdIt->is_string()) - MS_THROW_ERROR("missing data.producerId"); + { + MS_THROW_TYPE_ERROR("missing producerId"); + } auto it = this->mapProducers.find(jsonProducerIdIt->get()); diff --git a/worker/src/RTC/Transport.cpp b/worker/src/RTC/Transport.cpp index 78c9dbe355..38f1252e1c 100644 --- a/worker/src/RTC/Transport.cpp +++ b/worker/src/RTC/Transport.cpp @@ -826,10 +826,12 @@ namespace RTC case Channel::ChannelRequest::MethodId::TRANSPORT_CONSUME: { - auto jsonProducerIdIt = request->internal.find("producerId"); + auto jsonProducerIdIt = request->data.find("producerId"); - if (jsonProducerIdIt == request->internal.end() || !jsonProducerIdIt->is_string()) - MS_THROW_ERROR("missing internal.producerId"); + if (jsonProducerIdIt == request->data.end() || !jsonProducerIdIt->is_string()) + { + MS_THROW_TYPE_ERROR("missing producerId"); + } std::string producerId = jsonProducerIdIt->get(); std::string consumerId; @@ -1180,11 +1182,11 @@ namespace RTC MS_THROW_ERROR("SCTP not enabled and not a direct Transport"); } - auto jsonDataProducerIdIt = request->internal.find("dataProducerId"); + auto jsonDataProducerIdIt = request->data.find("dataProducerId"); - if (jsonDataProducerIdIt == request->internal.end() || !jsonDataProducerIdIt->is_string()) + if (jsonDataProducerIdIt == request->data.end() || !jsonDataProducerIdIt->is_string()) { - MS_THROW_ERROR("missing internal.dataProducerId"); + MS_THROW_ERROR("missing dataProducerId"); } std::string dataProducerId = jsonDataProducerIdIt->get(); @@ -1500,7 +1502,7 @@ namespace RTC if (dataConsumer->GetType() != RTC::DataConsumer::Type::SCTP) { - MS_THROW_ERROR("invalid DataConsumer type"); + MS_THROW_TYPE_ERROR("invalid DataConsumer type"); } if (!this->sctpAssociation) @@ -1525,7 +1527,7 @@ namespace RTC if (dataConsumer->GetType() != RTC::DataConsumer::Type::SCTP) { - MS_THROW_ERROR("invalid DataConsumer type"); + MS_THROW_TYPE_ERROR("invalid DataConsumer type"); } dataConsumer->HandleRequest(request); @@ -1553,7 +1555,7 @@ namespace RTC if (dataConsumer->GetType() != RTC::DataConsumer::Type::SCTP) { - MS_THROW_ERROR("invalid DataConsumer type"); + MS_THROW_TYPE_ERROR("invalid DataConsumer type"); } if (!this->sctpAssociation) @@ -1768,12 +1770,16 @@ namespace RTC auto jsonProducerIdIt = internal.find("producerId"); if (jsonProducerIdIt == internal.end() || !jsonProducerIdIt->is_string()) - MS_THROW_ERROR("missing internal.producerId"); + { + MS_THROW_TYPE_ERROR("missing producerId"); + } producerId.assign(jsonProducerIdIt->get()); if (this->mapProducers.find(producerId) != this->mapProducers.end()) + { MS_THROW_ERROR("a Producer with same producerId already exists"); + } } RTC::Producer* Transport::GetProducerFromInternal(json& internal) const @@ -1783,7 +1789,9 @@ namespace RTC auto jsonProducerIdIt = internal.find("producerId"); if (jsonProducerIdIt == internal.end() || !jsonProducerIdIt->is_string()) - MS_THROW_ERROR("missing internal.producerId"); + { + MS_THROW_TYPE_ERROR("missing producerId"); + } auto it = this->mapProducers.find(jsonProducerIdIt->get()); @@ -1802,12 +1810,16 @@ namespace RTC auto jsonConsumerIdIt = internal.find("consumerId"); if (jsonConsumerIdIt == internal.end() || !jsonConsumerIdIt->is_string()) - MS_THROW_ERROR("missing internal.consumerId"); + { + MS_THROW_TYPE_ERROR("missing consumerId"); + } consumerId.assign(jsonConsumerIdIt->get()); if (this->mapConsumers.find(consumerId) != this->mapConsumers.end()) + { MS_THROW_ERROR("a Consumer with same consumerId already exists"); + } } RTC::Consumer* Transport::GetConsumerFromInternal(json& internal) const @@ -1817,7 +1829,9 @@ namespace RTC auto jsonConsumerIdIt = internal.find("consumerId"); if (jsonConsumerIdIt == internal.end() || !jsonConsumerIdIt->is_string()) - MS_THROW_ERROR("missing internal.consumerId"); + { + MS_THROW_TYPE_ERROR("missing consumerId"); + } auto it = this->mapConsumers.find(jsonConsumerIdIt->get()); @@ -1864,12 +1878,16 @@ namespace RTC auto jsonDataProducerIdIt = internal.find("dataProducerId"); if (jsonDataProducerIdIt == internal.end() || !jsonDataProducerIdIt->is_string()) - MS_THROW_ERROR("missing internal.dataProducerId"); + { + MS_THROW_TYPE_ERROR("missing dataProducerId"); + } dataProducerId.assign(jsonDataProducerIdIt->get()); if (this->mapDataProducers.find(dataProducerId) != this->mapDataProducers.end()) + { MS_THROW_ERROR("a DataProducer with same dataProducerId already exists"); + } } RTC::DataProducer* Transport::GetDataProducerFromInternal(json& internal) const @@ -1879,7 +1897,9 @@ namespace RTC auto jsonDataProducerIdIt = internal.find("dataProducerId"); if (jsonDataProducerIdIt == internal.end() || !jsonDataProducerIdIt->is_string()) - MS_THROW_ERROR("missing internal.dataProducerId"); + { + MS_THROW_TYPE_ERROR("missing dataProducerId"); + } auto it = this->mapDataProducers.find(jsonDataProducerIdIt->get()); @@ -1898,12 +1918,16 @@ namespace RTC auto jsonDataConsumerIdIt = internal.find("dataConsumerId"); if (jsonDataConsumerIdIt == internal.end() || !jsonDataConsumerIdIt->is_string()) - MS_THROW_ERROR("missing internal.dataConsumerId"); + { + MS_THROW_TYPE_ERROR("missing dataConsumerId"); + } dataConsumerId.assign(jsonDataConsumerIdIt->get()); if (this->mapDataConsumers.find(dataConsumerId) != this->mapDataConsumers.end()) + { MS_THROW_ERROR("a DataConsumer with same dataConsumerId already exists"); + } } RTC::DataConsumer* Transport::GetDataConsumerFromInternal(json& internal) const @@ -1913,7 +1937,9 @@ namespace RTC auto jsonDataConsumerIdIt = internal.find("dataConsumerId"); if (jsonDataConsumerIdIt == internal.end() || !jsonDataConsumerIdIt->is_string()) - MS_THROW_ERROR("missing internal.dataConsumerId"); + { + MS_THROW_TYPE_ERROR("missing dataConsumerId"); + } auto it = this->mapDataConsumers.find(jsonDataConsumerIdIt->get());