[Opalvoip-svn] SF.net SVN: opalvoip:[32346] opal/trunk
Brought to you by:
csoutheren,
rjongbloed
From: <rjo...@us...> - 2014-07-10 09:17:56
|
Revision: 32346 http://sourceforge.net/p/opalvoip/code/32346 Author: rjongbloed Date: 2014-07-10 09:17:47 +0000 (Thu, 10 Jul 2014) Log Message: ----------- Dump RTCP packet out if there is a decoding error. Modified Paths: -------------- opal/trunk/include/rtp/rtp.h opal/trunk/src/rtp/rtp.cxx opal/trunk/src/rtp/rtp_session.cxx Modified: opal/trunk/include/rtp/rtp.h =================================================================== --- opal/trunk/include/rtp/rtp.h 2014-07-10 08:40:36 UTC (rev 32345) +++ opal/trunk/include/rtp/rtp.h 2014-07-10 09:17:47 UTC (rev 32346) @@ -116,6 +116,10 @@ RTP_ControlFrame(PINDEX compoundSize = 2048); RTP_ControlFrame(const BYTE * data, PINDEX size, bool dynamic = true); +#if PTRACING + virtual void PrintOn(ostream &) const; +#endif + bool IsValid() const; unsigned GetVersion() const { return (BYTE)theArray[m_compoundOffset]>>6; } Modified: opal/trunk/src/rtp/rtp.cxx =================================================================== --- opal/trunk/src/rtp/rtp.cxx 2014-07-10 08:40:36 UTC (rev 32345) +++ opal/trunk/src/rtp/rtp.cxx 2014-07-10 09:17:47 UTC (rev 32346) @@ -629,6 +629,16 @@ } +void RTP_ControlFrame::PrintOn(ostream & strm) const +{ + char fill = strm.fill(); + strm << "RTCP frame, " << m_packetSize << " bytes:\n" + << hex << setprecision(2) << setfill('0') + << PBYTEArray((const BYTE *)theArray, m_packetSize, false) + << dec << setfill(fill); +} + + bool RTP_ControlFrame::IsValid() const { if (m_packetSize < m_compoundOffset + 4) Modified: opal/trunk/src/rtp/rtp_session.cxx =================================================================== --- opal/trunk/src/rtp/rtp_session.cxx 2014-07-10 08:40:36 UTC (rev 32345) +++ opal/trunk/src/rtp/rtp_session.cxx 2014-07-10 09:17:47 UTC (rev 32346) @@ -1193,8 +1193,7 @@ if (frame.GetPacketSize() == 0) return e_IgnorePacket; - PTRACE(6, *this << "OnReceiveControl - " << frame.GetPacketSize() << " bytes:\n" - << hex << setprecision(2) << setfill('0') << PBYTEArray(frame, frame.GetPacketSize(), false) << dec); + PTRACE(6, *this << "OnReceiveControl - " << frame); m_firstControl = false; @@ -1207,7 +1206,7 @@ if (frame.ParseSenderReport(txReport, rxReports)) OnRxSenderReport(txReport, rxReports); else { - PTRACE(2, *this << "SenderReport packet truncated"); + PTRACE(2, *this << "SenderReport packet truncated - " << frame); } break; } @@ -1219,7 +1218,7 @@ if (frame.ParseReceiverReport(ssrc, reports)) OnRxReceiverReport(ssrc, reports); else { - PTRACE(2, *this << "ReceiverReport packet truncated"); + PTRACE(2, *this << "ReceiverReport packet truncated - " << frame); } break; } @@ -1230,7 +1229,7 @@ if (frame.ParseSourceDescriptions(descriptions)) OnRxSourceDescription(descriptions); else { - PTRACE(2, *this << "SourceDescription packet malformed"); + PTRACE(2, *this << "SourceDescription packet malformed - " << frame); } break; } @@ -1243,7 +1242,7 @@ if (frame.ParseGoodbye(rxSSRC, csrc, msg)) OnRxGoodbye(csrc, msg); else { - PTRACE(2, *this << "Goodbye packet truncated"); + PTRACE(2, *this << "Goodbye packet truncated - " << frame); } break; } @@ -1254,7 +1253,7 @@ if (frame.ParseApplDefined(info)) OnRxApplDefined(info); else { - PTRACE(2, *this << "ApplDefined packet truncated"); + PTRACE(2, *this << "ApplDefined packet truncated - " << frame); } break; } @@ -1267,7 +1266,7 @@ if (RTCP_XR_Metrics::ParseExtendedReportArray(frame, rxSSRC, reports)) OnRxExtendedReport(rxSSRC, reports); else { - PTRACE(2, *this << "ReceiverReport packet truncated"); + PTRACE(2, *this << "ReceiverReport packet truncated - " << frame); } break; } @@ -1285,7 +1284,7 @@ OnRxNACK(targetSSRC, lostPackets); } else { - PTRACE(2, *this << "NACK packet truncated"); + PTRACE(2, *this << "NACK packet truncated - " << frame); } break; } @@ -1303,7 +1302,7 @@ } } else { - PTRACE(2, *this << "TMMB" << (frame.GetFbType() == RTP_ControlFrame::e_TMMBR ? 'R' : 'N') << " packet truncated"); + PTRACE(2, *this << "TMMB" << (frame.GetFbType() == RTP_ControlFrame::e_TMMBR ? 'R' : 'N') << " packet truncated - " << frame); } break; } @@ -1331,7 +1330,7 @@ } } else { - PTRACE(2, *this << "PLI packet truncated"); + PTRACE(2, *this << "PLI packet truncated - " << frame); } break; } @@ -1353,7 +1352,7 @@ } } else { - PTRACE(2, *this << "FIR packet truncated"); + PTRACE(2, *this << "FIR packet truncated - " << frame); } break; } @@ -1375,7 +1374,7 @@ } } else { - PTRACE(2, *this << "TSTO packet truncated"); + PTRACE(2, *this << "TSTO packet truncated - " << frame); } break; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |