Explorar el Código

exclude fec-fr secondary ssrcs when looking for primary ssrcs (#668)

* exclude fec-fr secondary ssrcs when looking for primary ssrcs

this was causing us to generate an rtx ssrc for the fec stream

* fix variable
dev1
bbaldino hace 7 años
padre
commit
1990aace17

+ 11
- 0
modules/xmpp/RtxModifier.spec.js Ver fichero

@@ -298,6 +298,17 @@ describe('RtxModifier', () => {
298 298
             });
299 299
         });
300 300
 
301
+        describe('when given an sdp with a flexfec stream', () => {
302
+            it('should not add rtx for the flexfec ssrc', function() {
303
+                const flexFecSdp = SampleSdpStrings.flexFecSdp;
304
+                const newSdpStr = this.rtxModifier.modifyRtxSsrcs(this.transform.write(flexFecSdp));
305
+                const newSdp = transform.parse(newSdpStr);
306
+                const fidGroups = getVideoGroups(newSdp, 'FID');
307
+
308
+                expect(fidGroups.length).toEqual(1);
309
+            });
310
+        });
311
+
301 312
         describe('(corner cases)', () => {
302 313
             it('should handle a recvonly video mline', function() {
303 314
                 const sdp = SampleSdpStrings.plainVideoSdp;

+ 67
- 0
modules/xmpp/SampleSdpStrings.js Ver fichero

@@ -181,6 +181,69 @@ const simulcastRtxVideoMLineSdp = ''
181 181
 + 'a=ssrc-group:SIM 1757014965 1479742055 1089111804\r\n'
182 182
 + 'a=rtcp-mux\r\n';
183 183
 
184
+// An sdp video mline with 1 video ssrc, 1 video rtx ssrc and one flexfec ssrc
185
+const flexFecVideoMLineSdp = ''
186
++ 'm=video 9 RTP/SAVPF 100 107 101 96 99 97 109\r\n'
187
++ 'c=IN IP4 0.0.0.0\r\n'
188
++ 'a=rtcp:9 IN IP4 0.0.0.0\r\n'
189
++ 'a=ice-ufrag:aLBh\r\n'
190
++ 'a=ice-pwd:7IeqrWG5ryCW2X47Lso8XYdK\r\n'
191
++ 'a=ice-options:trickle\r\n'
192
++ 'a=fingerprint:sha-256 78:3C:F9:96:85:FB:20:25:F8:2F:AB:37:8B:8B:17:29:EF:54:7B:7C:17:2E:90:02:8A:A1:8F:A7:F9:C5:F2:90\r\n'
193
++ 'a=setup:active\r\n'
194
++ 'a=mid:video\r\n'
195
++ 'a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\n'
196
++ 'a=sendrecv\r\n'
197
++ 'a=rtcp-mux\r\n'
198
++ 'a=rtpmap:100 VP8/90000\r\n'
199
++ 'a=rtcp-fb:100 goog-remb\r\n'
200
++ 'a=rtcp-fb:100 ccm fir\r\n'
201
++ 'a=rtcp-fb:100 nack\r\n'
202
++ 'a=rtcp-fb:100 nack pli\r\n'
203
++ 'a=rtpmap:107 h264/90000\r\n'
204
++ 'a=rtcp-fb:107 goog-remb\r\n'
205
++ 'a=rtcp-fb:107 ccm fir\r\n'
206
++ 'a=rtcp-fb:107 nack\r\n'
207
++ 'a=rtcp-fb:107 nack pli\r\n'
208
++ 'a=fmtp:107 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f\r\n'
209
++ 'a=rtpmap:101 VP9/90000\r\n'
210
++ 'a=rtcp-fb:101 goog-remb\r\n'
211
++ 'a=rtcp-fb:101 ccm fir\r\n'
212
++ 'a=rtcp-fb:101 nack\r\n'
213
++ 'a=rtcp-fb:101 nack pli\r\n'
214
++ 'a=rtpmap:96 rtx/90000\r\n'
215
++ 'a=fmtp:96 apt=100\r\n'
216
++ 'a=rtpmap:99 rtx/90000\r\n'
217
++ 'a=fmtp:99 apt=107\r\n'
218
++ 'a=rtpmap:97 rtx/90000\r\n'
219
++ 'a=fmtp:97 apt=101\r\n'
220
++ 'a=rtpmap:109 flexfec-03/90000\r\n'
221
++ 'a=fmtp:109 repair-window=10000000\r\n'
222
++ 'a=ssrc-group:FID 2864950112 2236303754\r\n'
223
++ 'a=ssrc-group:FEC-FR 2864950112 116623191\r\n'
224
++ 'a=ssrc:2864950112 cname:mT86hcsCZwQBPh6R\r\n'
225
++ 'a=ssrc:2864950112 msid:a2548ae2-32e8-4b09-89bc-b11f3e49ac5a b3e3d760-6b1b-48bd-8519-9d6261311d28\r\n'
226
++ 'a=ssrc:2864950112 mslabel:a2548ae2-32e8-4b09-89bc-b11f3e49ac5a\r\n'
227
++ 'a=ssrc:2864950112 label:b3e3d760-6b1b-48bd-8519-9d6261311d28\r\n'
228
++ 'a=ssrc:2236303754 cname:mT86hcsCZwQBPh6R\r\n'
229
++ 'a=ssrc:2236303754 msid:a2548ae2-32e8-4b09-89bc-b11f3e49ac5a b3e3d760-6b1b-48bd-8519-9d6261311d28\r\n'
230
++ 'a=ssrc:2236303754 mslabel:a2548ae2-32e8-4b09-89bc-b11f3e49ac5a\r\n'
231
++ 'a=ssrc:2236303754 label:b3e3d760-6b1b-48bd-8519-9d6261311d28\r\n'
232
++ 'a=ssrc:116623191 cname:mT86hcsCZwQBPh6R\r\n'
233
++ 'a=ssrc:116623191 msid:a2548ae2-32e8-4b09-89bc-b11f3e49ac5a b3e3d760-6b1b-48bd-8519-9d6261311d28\r\n'
234
++ 'a=ssrc:116623191 mslabel:a2548ae2-32e8-4b09-89bc-b11f3e49ac5a\r\n'
235
++ 'a=ssrc:116623191 label:b3e3d760-6b1b-48bd-8519-9d6261311d28\r\n'
236
++ 'm=application 9 DTLS/SCTP 5000\r\n'
237
++ 'c=IN IP4 0.0.0.0\r\n'
238
++ 'b=AS:30\r\n'
239
++ 'a=ice-ufrag:aLBh\r\n'
240
++ 'a=ice-pwd:7IeqrWG5ryCW2X47Lso8XYdK\r\n'
241
++ 'a=ice-options:trickle\r\n'
242
++ 'a=fingerprint:sha-256 78:3C:F9:96:85:FB:20:25:F8:2F:AB:37:8B:8B:17:29:EF:54:7B:7C:17:2E:90:02:8A:A1:8F:A7:F9:C5:F2:90\r\n'
243
++ 'a=setup:active\r\n'
244
++ 'a=mid:data\r\n'
245
++ 'a=sctpmap:5000 webrtc-datachannel 1024\r\n';
246
+
184 247
 // A full sdp string representing a client doing simulcast
185 248
 const simulcastSdpStr = baseSessionSdp + baseAudioMLineSdp + simulcastVideoMLineSdp + baseDataMLineSdp;
186 249
 
@@ -196,10 +259,14 @@ const rtxVideoSdpStr = baseSessionSdp + baseAudioMLineSdp + rtxVideoMLineSdp + b
196 259
 // A full sdp string representing a client doing a single video stream with multiple codec options
197 260
 const multiCodecVideoSdpStr = baseSessionSdp + baseAudioMLineSdp + multiCodecVideoMLine + baseDataMLineSdp;
198 261
 
262
+// A full sdp string representing a client doing a single video stream with flexfec
263
+const flexFecSdpStr = baseSessionSdp + baseAudioMLineSdp + flexFecVideoMLineSdp + baseDataMLineSdp;
264
+
199 265
 export const simulcastSdp = transform.parse(simulcastSdpStr);
200 266
 export const simulcastRtxSdp = transform.parse(simulcastRtxSdpStr);
201 267
 export const plainVideoSdp = transform.parse(plainVideoSdpStr);
202 268
 export const rtxVideoSdp = transform.parse(rtxVideoSdpStr);
203 269
 export const multiCodecVideoSdp = transform.parse(multiCodecVideoSdpStr);
270
+export const flexFecSdp = transform.parse(flexFecSdpStr);
204 271
 
205 272
 /* eslint-enable max-len*/

+ 10
- 4
modules/xmpp/SdpTransformUtil.js Ver fichero

@@ -242,7 +242,7 @@ class MLineWrap {
242 242
             return this.mLine.ssrcs[0].id;
243 243
         }
244 244
 
245
-        // Look for a SIM or FID group
245
+        // Look for a SIM, FID, or FEC-FR group
246 246
         if (this.mLine.ssrcGroups) {
247 247
             const simGroup = this.findGroup('SIM');
248 248
 
@@ -254,6 +254,11 @@ class MLineWrap {
254 254
             if (fidGroup) {
255 255
                 return parsePrimarySSRC(fidGroup);
256 256
             }
257
+            const fecGroup = this.findGroup('FEC-FR');
258
+
259
+            if (fecGroup) {
260
+                return parsePrimarySSRC(fecGroup);
261
+            }
257 262
         }
258 263
 
259 264
     }
@@ -299,11 +304,12 @@ class MLineWrap {
299 304
         const videoSSRCs = this.getSSRCs();
300 305
 
301 306
         for (const ssrcGroupInfo of this.ssrcGroups) {
302
-            // Right now, FID groups are the only ones we parse to
307
+            // Right now, FID and FEC-FR groups are the only ones we parse to
303 308
             // disqualify streams.  If/when others arise we'll
304 309
             // need to add support for them here
305
-            if (ssrcGroupInfo.semantics === 'FID') {
306
-                // secondary FID streams should be filtered out
310
+            if (ssrcGroupInfo.semantics === 'FID'
311
+                    || ssrcGroupInfo.semantics === 'FEC-FR') {
312
+                // secondary streams should be filtered out
307 313
                 const secondarySsrc = parseSecondarySSRC(ssrcGroupInfo);
308 314
 
309 315
                 videoSSRCs.splice(

Loading…
Cancelar
Guardar