Sfoglia il codice sorgente

Modify error handling for missing video m-lines and local description (#632)

* ref(sdp): lower logs about missing local video to warning

* ref(sdp): earlier error handling for missing description and mlines

* ref(sdp): rename maybeMungeLocalSdp to be more specific
dev1
virtuacoplenny 8 anni fa
parent
commit
6a5d1dd822

+ 3
- 2
modules/RTC/LocalSdpMunger.js Vedi File

55
         const videoMLine = transformer.selectMedia('video');
55
         const videoMLine = transformer.selectMedia('video');
56
 
56
 
57
         if (!videoMLine) {
57
         if (!videoMLine) {
58
-            logger.error(
58
+            logger.debug(
59
                 `${this.tpc} unable to hack local video track SDP`
59
                 `${this.tpc} unable to hack local video track SDP`
60
                     + '- no "video" media');
60
                     + '- no "video" media');
61
 
61
 
167
      *
167
      *
168
      * @param {object} desc the WebRTC SDP object instance for the local
168
      * @param {object} desc the WebRTC SDP object instance for the local
169
      * description.
169
      * description.
170
+     * @returns {RTCSessionDescription}
170
      */
171
      */
171
-    maybeMungeLocalSdp(desc) {
172
+    maybeAddMutedLocalVideoTracksToSDP(desc) {
172
         if (!desc || !(desc instanceof RTCSessionDescription)) {
173
         if (!desc || !(desc instanceof RTCSessionDescription)) {
173
             throw new Error('Incorrect type, expected RTCSessionDescription');
174
             throw new Error('Incorrect type, expected RTCSessionDescription');
174
         }
175
         }

+ 9
- 3
modules/RTC/TraceablePeerConnection.js Vedi File

1173
     localDescription() {
1173
     localDescription() {
1174
         let desc = this.peerconnection.localDescription;
1174
         let desc = this.peerconnection.localDescription;
1175
 
1175
 
1176
+        if (!desc) {
1177
+            logger.debug('getLocalDescription no localDescription found');
1178
+
1179
+            return {};
1180
+        }
1181
+
1176
         this.trace('getLocalDescription::preTransform', dumpSDP(desc));
1182
         this.trace('getLocalDescription::preTransform', dumpSDP(desc));
1177
 
1183
 
1178
         // if we're running on FF, transform to Plan B first.
1184
         // if we're running on FF, transform to Plan B first.
1179
-        if (desc && RTCBrowserType.usesUnifiedPlan()) {
1185
+        if (RTCBrowserType.usesUnifiedPlan()) {
1180
             desc = this.interop.toPlanB(desc);
1186
             desc = this.interop.toPlanB(desc);
1181
             this.trace('getLocalDescription::postTransform (Plan B)',
1187
             this.trace('getLocalDescription::postTransform (Plan B)',
1182
                 dumpSDP(desc));
1188
                 dumpSDP(desc));
1187
         }
1193
         }
1188
 
1194
 
1189
         if (RTCBrowserType.doesVideoMuteByStreamRemove()) {
1195
         if (RTCBrowserType.doesVideoMuteByStreamRemove()) {
1190
-            desc = this.localSdpMunger.maybeMungeLocalSdp(desc);
1196
+            desc = this.localSdpMunger.maybeAddMutedLocalVideoTracksToSDP(desc);
1191
             logger.debug(
1197
             logger.debug(
1192
                 'getLocalDescription::postTransform (munge local SDP)', desc);
1198
                 'getLocalDescription::postTransform (munge local SDP)', desc);
1193
         }
1199
         }
1202
         // happening (check setLocalDescription impl).
1208
         // happening (check setLocalDescription impl).
1203
         desc = enforceSendRecv(desc);
1209
         desc = enforceSendRecv(desc);
1204
 
1210
 
1205
-        return desc || {};
1211
+        return desc;
1206
     },
1212
     },
1207
     remoteDescription() {
1213
     remoteDescription() {
1208
         let desc = this.peerconnection.remoteDescription;
1214
         let desc = this.peerconnection.remoteDescription;

+ 2
- 2
modules/xmpp/RtxModifier.js Vedi File

116
         const videoMLine = sdpTransformer.selectMedia('video');
116
         const videoMLine = sdpTransformer.selectMedia('video');
117
 
117
 
118
         if (!videoMLine) {
118
         if (!videoMLine) {
119
-            logger.error(`No 'video' media found in the sdp: ${sdpStr}`);
119
+            logger.debug(`No 'video' media found in the sdp: ${sdpStr}`);
120
 
120
 
121
             return sdpStr;
121
             return sdpStr;
122
         }
122
         }
205
         const videoMLine = sdpTransformer.selectMedia('video');
205
         const videoMLine = sdpTransformer.selectMedia('video');
206
 
206
 
207
         if (!videoMLine) {
207
         if (!videoMLine) {
208
-            logger.error(`No 'video' media found in the sdp: ${sdpStr}`);
208
+            logger.debug(`No 'video' media found in the sdp: ${sdpStr}`);
209
 
209
 
210
             return sdpStr;
210
             return sdpStr;
211
         }
211
         }

+ 2
- 2
modules/xmpp/SDPUtil.js Vedi File

573
     preferVideoCodec(videoMLine, codecName) {
573
     preferVideoCodec(videoMLine, codecName) {
574
         let payloadType = null;
574
         let payloadType = null;
575
 
575
 
576
-        if (!codecName) {
576
+        if (!videoMLine || !codecName) {
577
             return;
577
             return;
578
         }
578
         }
579
 
579
 
613
      * @param {string} codecName the name of the codec which will be stripped.
613
      * @param {string} codecName the name of the codec which will be stripped.
614
      */
614
      */
615
     stripVideoCodec(videoMLine, codecName) {
615
     stripVideoCodec(videoMLine, codecName) {
616
-        if (!codecName) {
616
+        if (!videoMLine || !codecName) {
617
             return;
617
             return;
618
         }
618
         }
619
 
619
 

+ 1
- 1
modules/xmpp/SdpConsistency.js Vedi File

76
         const videoMLine = sdpTransformer.selectMedia('video');
76
         const videoMLine = sdpTransformer.selectMedia('video');
77
 
77
 
78
         if (!videoMLine) {
78
         if (!videoMLine) {
79
-            logger.error(
79
+            logger.debug(
80
                 `${this.logPrefix} no 'video' media found in the sdp: `
80
                 `${this.logPrefix} no 'video' media found in the sdp: `
81
                     + `${sdpStr}`);
81
                     + `${sdpStr}`);
82
 
82
 

Loading…
Annulla
Salva