瀏覽代碼

Implement review changes 4

dev1
Mihai-Andrei Uscat 4 年之前
父節點
當前提交
8b3dc59374
共有 4 個檔案被更改,包括 14 行新增13 行删除
  1. 2
    2
      modules/RTC/RTCUtils.js
  2. 2
    2
      modules/RTC/ScreenObtainer.js
  3. 9
    7
      modules/RTC/TraceablePeerConnection.js
  4. 1
    2
      modules/xmpp/JingleSessionPC.js

+ 2
- 2
modules/RTC/RTCUtils.js 查看文件

@@ -759,8 +759,8 @@ class RTCUtils extends Listenable {
759 759
             disableHPF = options.disableHPF;
760 760
             logger.info(`Disable HPF: ${disableHPF}`);
761 761
         }
762
-        if (typeof options.stereo === 'boolean') {
763
-            stereo = options.stereo;
762
+        if (typeof options.audioQuality?.stereo === 'boolean') {
763
+            stereo = options.audioQuality.stereo;
764 764
             logger.info(`Stereo: ${stereo}`);
765 765
         }
766 766
 

+ 2
- 2
modules/RTC/ScreenObtainer.js 查看文件

@@ -163,8 +163,8 @@ const ScreenObtainer = {
163 163
             getDisplayMedia = navigator.mediaDevices.getDisplayMedia.bind(navigator.mediaDevices);
164 164
         }
165 165
 
166
-        const { stereo } = this.options;
167
-        const audio = stereo ? {
166
+        const { audioQuality } = this.options;
167
+        const audio = audioQuality?.stereo ? {
168 168
             autoGainControl: false,
169 169
             channelCount: 2,
170 170
             echoCancellation: false,

+ 9
- 7
modules/RTC/TraceablePeerConnection.js 查看文件

@@ -2157,9 +2157,9 @@ TraceablePeerConnection.prototype._adjustLocalMediaDirection = function(
2157 2157
  * @returns {RTCSessionDescription} the munged description.
2158 2158
  */
2159 2159
 TraceablePeerConnection.prototype._mungeOpus = function(description) {
2160
-    const { opusMaxAverageBitrate, stereo } = this.options;
2160
+    const { audioQuality } = this.options;
2161 2161
 
2162
-    if (!opusMaxAverageBitrate || !stereo) {
2162
+    if (!audioQuality?.stereo && !audioQuality?.opusMaxAverageBitrate) {
2163 2163
         return description;
2164 2164
     }
2165 2165
 
@@ -2171,7 +2171,8 @@ TraceablePeerConnection.prototype._mungeOpus = function(description) {
2171 2171
             const { payload } = mLine.rtp.find(protocol => protocol.codec === CodecMimeType.OPUS);
2172 2172
 
2173 2173
             if (!payload) {
2174
-                break;
2174
+                // eslint-disable-next-line no-continue
2175
+                continue;
2175 2176
             }
2176 2177
 
2177 2178
             let fmtpOpus = mLine.fmtp.find(protocol => protocol.payload === payload);
@@ -2186,18 +2187,19 @@ TraceablePeerConnection.prototype._mungeOpus = function(description) {
2186 2187
             const fmtpConfig = transform.parseParams(fmtpOpus.config);
2187 2188
             let sdpChanged = false;
2188 2189
 
2189
-            if (stereo) {
2190
+            if (audioQuality?.stereo) {
2190 2191
                 fmtpConfig.stereo = 1;
2191 2192
                 sdpChanged = true;
2192 2193
             }
2193 2194
 
2194
-            if (opusMaxAverageBitrate) {
2195
-                fmtpConfig.opusMaxAverageBitrate = opusMaxAverageBitrate;
2195
+            if (audioQuality?.opusMaxAverageBitrate) {
2196
+                fmtpConfig.opusMaxAverageBitrate = audioQuality.opusMaxAverageBitrate;
2196 2197
                 sdpChanged = true;
2197 2198
             }
2198 2199
 
2199 2200
             if (!sdpChanged) {
2200
-                break;
2201
+                // eslint-disable-next-line no-continue
2202
+                continue;
2201 2203
             }
2202 2204
 
2203 2205
             let mungedConfig = '';

+ 1
- 2
modules/xmpp/JingleSessionPC.js 查看文件

@@ -329,8 +329,7 @@ export default class JingleSessionPC extends JingleSession {
329 329
         pcOptions.enableInsertableStreams = options.enableInsertableStreams;
330 330
         pcOptions.videoQuality = options.videoQuality;
331 331
         pcOptions.forceTurnRelay = options.forceTurnRelay;
332
-        pcOptions.stereo = options.stereo;
333
-        pcOptions.opusMaxAverageBitrate = options.opusMaxAverageBitrate;
332
+        pcOptions.audioQuality = options.audioQuality;
334 333
 
335 334
         if (this.isP2P) {
336 335
             // simulcast needs to be disabled for P2P (121) calls

Loading…
取消
儲存