Open biohot opened 4 years ago
I created test method for SDP response of Garmin Virb 360 which not passed:
[TestMethod] public void Parse_TestDocumentWithVideoAndAudioTracksWithSameFmtNumber_ReturnsTwoTracks() { string testInput = "m=video 0 RTP/AVP 96\r\n" + "a=control:rtsp://192.168.0.1/livePreviewStream/video\r\n" + "a=rtpmap:96 H264/90000\r\n" + "a=fmtp:96 packetization-mode=1\r\n" + "m=audio 0 RTP/AVP 96\r\n" + "a=control:rtsp://192.168.0.1/livePreviewStream/audio48wyzx\r\n" + "a=rtpmap:96 mpeg4-generic/48000/4\r\n" + "a=fmtp:96 streamType=5;profile-level-id=65;mode=AAC-hbr;config=11a0;sizeLength=13;indexLength=3;indexDeltaLength=3;constantDuration=1024\r\n"; var testBytes = Encoding.ASCII.GetBytes(testInput); var parser = new SdpParser(); IReadOnlyList<RtspMediaTrackInfo> tracks = parser.Parse(testBytes).Where(t => t is RtspMediaTrackInfo) .Cast<RtspMediaTrackInfo>().ToList(); Assert.AreEqual(2, tracks.Count); RtspMediaTrackInfo videoTrack = tracks.First(t => t.Codec is VideoCodecInfo); Assert.AreEqual("rtsp://192.168.0.1/livePreviewStream/video", videoTrack.TrackName); Assert.AreEqual(90000, videoTrack.SamplesFrequency); RtspMediaTrackInfo audioTrack = tracks.First(t => t.Codec is AudioCodecInfo); Assert.AreEqual("rtsp://192.168.0.1/livePreviewStream/audio48wyzx", audioTrack.TrackName); Assert.AreEqual(48000, audioTrack.SamplesFrequency); }
I created test method for SDP response of Garmin Virb 360 which not passed: