From aae6101c3d94dc4441c936337542139772909a59 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Thu, 26 Jul 2018 11:21:35 +0200 Subject: [PATCH] Fixed RTSP input, added support for non-standard "PCM" RTP profile, improving IP cam compatibility. --- lib/sdp.cpp | 2 +- src/input/input_rtsp.cpp | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/sdp.cpp b/lib/sdp.cpp index be10c77b..5a74db9d 100644 --- a/lib/sdp.cpp +++ b/lib/sdp.cpp @@ -479,7 +479,7 @@ namespace SDP{ thisTrack->codec = "PCM"; thisTrack->size = 20; } - if (trCodec == "L24"){ + if (trCodec == "L24"|| trCodec == "PCM"){ thisTrack->codec = "PCM"; thisTrack->size = 24; } diff --git a/src/input/input_rtsp.cpp b/src/input/input_rtsp.cpp index 7beb9761..cf66472c 100755 --- a/src/input/input_rtsp.cpp +++ b/src/input/input_rtsp.cpp @@ -314,6 +314,7 @@ namespace Mist{ for (std::map::iterator it = sdpState.tracks.begin(); it != sdpState.tracks.end(); ++it){ Socket::UDPConnection &s = it->second.data; + it->second.sorter.setCallback(it->first, insertRTP); while (s.Receive()){ r = true; // if (s.getDestPort() != it->second.sPortA){ @@ -321,7 +322,15 @@ namespace Mist{ // continue; //} tcpCon.addDown(s.data_len); - it->second.sorter.addPacket(s.data, s.data_len); + RTP::Packet pack(s.data, s.data_len); + if (!it->second.theirSSRC){ + it->second.theirSSRC = pack.getSSRC(); + } + it->second.sorter.addPacket(pack); + } + if (Util::epoch() / 5 != it->second.rtcpSent){ + it->second.rtcpSent = Util::epoch() / 5; + it->second.pack.sendRTCP_RR(connectedAt, it->second, it->first, myMeta, sendUDP); } } return r;