@@ -410,13 +410,15 @@ public void MediaOrderMatchesRemoteOfferUnitTest()
410
410
411
411
// Create a local session and add the video track first.
412
412
RTPSession rtpSession = new RTPSession ( false , false , false ) ;
413
+
414
+ MediaStreamTrack localVideoTrack = new MediaStreamTrack ( SDPMediaTypesEnum . video , false , new List < SDPAudioVideoMediaFormat > { new SDPAudioVideoMediaFormat ( SDPMediaTypesEnum . video , 96 , "VP8" , 90000 ) } ) ;
415
+ rtpSession . addTrack ( localVideoTrack ) ;
416
+
413
417
MediaStreamTrack localAudioTrack = new MediaStreamTrack ( SDPMediaTypesEnum . audio , false , new List < SDPAudioVideoMediaFormat > {
414
418
new SDPAudioVideoMediaFormat ( SDPWellKnownMediaFormatsEnum . PCMU ) ,
415
419
new SDPAudioVideoMediaFormat ( SDPMediaTypesEnum . audio , 110 , "OPUS/48000/2" )
416
420
} ) ;
417
421
rtpSession . addTrack ( localAudioTrack ) ;
418
- MediaStreamTrack localVideoTrack = new MediaStreamTrack ( SDPMediaTypesEnum . video , false , new List < SDPAudioVideoMediaFormat > { new SDPAudioVideoMediaFormat ( SDPMediaTypesEnum . video , 96 , "VP8" , 90000 ) } ) ;
419
- rtpSession . addTrack ( localVideoTrack ) ;
420
422
421
423
var offer = SDP . ParseSDPDescription ( remoteSdp ) ;
422
424
@@ -432,8 +434,9 @@ public void MediaOrderMatchesRemoteOfferUnitTest()
432
434
433
435
logger . LogDebug ( $ "Local answer: { answer } ") ;
434
436
435
- Assert . Equal ( 110 , rtpSession . AudioStream . LocalTrack . Capabilities . Single ( x => x . Name ( ) == "OPUS" ) . ID ) ;
436
- Assert . Equal ( 96 , rtpSession . VideoStream . LocalTrack . Capabilities . Single ( x => x . Name ( ) == "VP8" ) . ID ) ;
437
+ // Since we set Remote Description FIRST, we expect to have values defined by the remote
438
+ Assert . Equal ( 111 , rtpSession . AudioStream . LocalTrack . Capabilities . Single ( x => x . Name ( ) == "OPUS" ) . ID ) ;
439
+ Assert . Equal ( 100 , rtpSession . VideoStream . LocalTrack . Capabilities . Single ( x => x . Name ( ) == "VP8" ) . ID ) ;
437
440
438
441
//Assert.True(SDPAudioVideoMediaFormat.AreMatch(offer.Media.Single(x => x.Media == SDPMediaTypesEnum.audio)., answer.Media.First().Media));
439
442
//Assert.Equal(offer.Media.Last().Media, answer.Media.Last().Media);
@@ -552,16 +555,14 @@ public void ModifiedWellKnownFormatIDUnitTest()
552
555
SDPWellKnownMediaFormatsEnum . G722 ) ;
553
556
rtpSession . addTrack ( localAudioTrack ) ;
554
557
555
- var offer = SDP . ParseSDPDescription ( remoteSdp ) ;
558
+ Assert . Equal ( 8 , rtpSession . AudioStream . LocalTrack . Capabilities . Single ( x => x . Name ( ) == "PCMA" ) . ID ) ;
556
559
560
+ var offer = SDP . ParseSDPDescription ( remoteSdp ) ;
557
561
logger . LogDebug ( $ "Remote offer: { offer } ") ;
558
-
559
562
var result = rtpSession . SetRemoteDescription ( SIP . App . SdpType . offer , offer ) ;
560
563
561
564
logger . LogDebug ( $ "Set remote description on local session result { result } .") ;
562
-
563
565
Assert . Equal ( SetDescriptionResultEnum . OK , result ) ;
564
- Assert . Equal ( 8 , rtpSession . AudioStream . LocalTrack . Capabilities . Single ( x => x . Name ( ) == "PCMA" ) . ID ) ;
565
566
Assert . Equal ( "PCMA" , rtpSession . AudioStream . GetSendingFormat ( ) . Name ( ) ) ;
566
567
567
568
var answer = rtpSession . CreateAnswer ( null ) ;
0 commit comments