Quellcode durchsuchen

ref(JSPC._renegotiate): raw text SDP as an argument

Creating SDP instance was unnecessary.
dev1
paweldomas vor 8 Jahren
Ursprung
Commit
7d2cbab818
1 geänderte Dateien mit 5 neuen und 9 gelöschten Zeilen
  1. 5
    9
      modules/xmpp/JingleSessionPC.js

+ 5
- 9
modules/xmpp/JingleSessionPC.js Datei anzeigen

827
             const oldLocalSdp
827
             const oldLocalSdp
828
                 = this.peerconnection.localDescription.sdp;
828
                 = this.peerconnection.localDescription.sdp;
829
 
829
 
830
-            this._renegotiate(newRemoteSdp)
830
+            this._renegotiate(newRemoteSdp.raw)
831
                 .then(() => {
831
                 .then(() => {
832
                     if (this.state === JingleSessionState.PENDING) {
832
                     if (this.state === JingleSessionState.PENDING) {
833
                         this.state = JingleSessionState.ACTIVE;
833
                         this.state = JingleSessionState.ACTIVE;
1250
                     ? this._processRemoteAddSource(addOrRemoveSsrcInfo)
1250
                     ? this._processRemoteAddSource(addOrRemoveSsrcInfo)
1251
                     : this._processRemoteRemoveSource(addOrRemoveSsrcInfo);
1251
                     : this._processRemoteRemoveSource(addOrRemoveSsrcInfo);
1252
 
1252
 
1253
-            this._renegotiate(newRemoteSdp)
1253
+            this._renegotiate(newRemoteSdp.raw)
1254
                 .then(() => {
1254
                 .then(() => {
1255
                     const newLocalSdp
1255
                     const newLocalSdp
1256
                         = new SDP(this.peerconnection.localDescription.sdp);
1256
                         = new SDP(this.peerconnection.localDescription.sdp);
1355
 
1355
 
1356
     /**
1356
     /**
1357
      * Do a new o/a flow using the existing remote description
1357
      * Do a new o/a flow using the existing remote description
1358
-     * @param {SDP object} optionalRemoteSdp optional remote sdp
1358
+     * @param {string} [optionalRemoteSdp] optional, raw remote sdp
1359
      *  to use.  If not provided, the remote sdp from the
1359
      *  to use.  If not provided, the remote sdp from the
1360
      *  peerconnection will be used
1360
      *  peerconnection will be used
1361
      * @returns {Promise} promise which resolves when the
1361
      * @returns {Promise} promise which resolves when the
1363
      *  rejects with an error {string}
1363
      *  rejects with an error {string}
1364
      */
1364
      */
1365
     _renegotiate(optionalRemoteSdp) {
1365
     _renegotiate(optionalRemoteSdp) {
1366
-        const currentRemoteSdp = this.peerconnection.remoteDescription.sdp;
1367
-
1368
-        // FIXME new SDP() may not be necessary - raw SDP is needed anyway
1369
         const remoteSdp
1366
         const remoteSdp
1370
-            = optionalRemoteSdp
1371
-                || (currentRemoteSdp && new SDP(currentRemoteSdp));
1367
+            = optionalRemoteSdp || this.peerconnection.remoteDescription.sdp;
1372
 
1368
 
1373
         if (!remoteSdp) {
1369
         if (!remoteSdp) {
1374
             return Promise.reject(
1370
             return Promise.reject(
1378
 
1374
 
1379
         const remoteDescription = new RTCSessionDescription({
1375
         const remoteDescription = new RTCSessionDescription({
1380
             type: this.isInitiator ? 'answer' : 'offer',
1376
             type: this.isInitiator ? 'answer' : 'offer',
1381
-            sdp: remoteSdp.raw
1377
+            sdp: remoteSdp
1382
         });
1378
         });
1383
 
1379
 
1384
         return new Promise((resolve, reject) => {
1380
         return new Promise((resolve, reject) => {

Laden…
Abbrechen
Speichern