Skip to content

Commit

Permalink
SimpleConsumer: Opus DTX ignore capabilities (#846)
Browse files Browse the repository at this point in the history
* SimpleConsumer: Opus DTX ignore capabilities
  • Loading branch information
jmillan authored Jun 29, 2022
1 parent a4c7fec commit f6d1284
Show file tree
Hide file tree
Showing 18 changed files with 272 additions and 14 deletions.
5 changes: 5 additions & 0 deletions node/lib/Consumer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ export declare type ConsumerOptions = {
* If unset, the highest ones are selected.
*/
preferredLayers?: ConsumerLayers;
/**
* Whether this Consumer should ignore DTX packets (only valid for Opus codec).
* If set, DTX packets are not forwarded to the remote Consumer.
*/
ignoreDtx?: Boolean;
/**
* Whether this Consumer should consume all RTP streams generated by the
* Producer.
Expand Down
2 changes: 1 addition & 1 deletion node/lib/Consumer.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node/lib/Transport.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export declare class Transport<Events extends TransportEvents = TransportEvents,
*
* @virtual
*/
consume({ producerId, rtpCapabilities, paused, mid, preferredLayers, pipe, appData }: ConsumerOptions): Promise<Consumer>;
consume({ producerId, rtpCapabilities, paused, mid, preferredLayers, ignoreDtx, pipe, appData }: ConsumerOptions): Promise<Consumer>;
/**
* Create a DataProducer.
*/
Expand Down
2 changes: 1 addition & 1 deletion node/lib/Transport.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions node/lib/Transport.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ class Transport extends EnhancedEventEmitter_1.EnhancedEventEmitter {
*
* @virtual
*/
async consume({ producerId, rtpCapabilities, paused = false, mid, preferredLayers, pipe = false, appData }) {
async consume({ producerId, rtpCapabilities, paused = false, mid, preferredLayers, ignoreDtx = false, pipe = false, appData }) {
logger.debug('consume()');
if (!producerId || typeof producerId !== 'string')
throw new TypeError('missing producerId');
Expand Down Expand Up @@ -381,7 +381,8 @@ class Transport extends EnhancedEventEmitter_1.EnhancedEventEmitter {
type: pipe ? 'pipe' : producer.type,
consumableRtpEncodings: producer.consumableRtpParameters.encodings,
paused,
preferredLayers
preferredLayers,
ignoreDtx
};
const status = await this.channel.request('transport.consume', internal, reqData);
const data = {
Expand Down
6 changes: 1 addition & 5 deletions node/lib/types.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
Expand Down
6 changes: 6 additions & 0 deletions node/src/Consumer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ export type ConsumerOptions =
*/
preferredLayers?: ConsumerLayers;

/**
* Whether this Consumer should ignore DTX packets (only valid for Opus codec).
* If set, DTX packets are not forwarded to the remote Consumer.
*/
ignoreDtx?: Boolean;

/**
* Whether this Consumer should consume all RTP streams generated by the
* Producer.
Expand Down
Loading

0 comments on commit f6d1284

Please sign in to comment.