Convert logs in rtp rtcp module from WEBRTC_TRACE into LOG.
Clean some logs and add asserts in the way.
BUG=3153
R=mflodman@webrtc.org, stefan@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/11129004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@5861 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc b/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
index 4012a81..21ccf67 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
@@ -18,7 +18,7 @@
#include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h"
#include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h"
#include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
-#include "webrtc/system_wrappers/interface/trace.h"
+#include "webrtc/system_wrappers/interface/logging.h"
#include "webrtc/system_wrappers/interface/trace_event.h"
namespace webrtc {
@@ -57,7 +57,6 @@
_lastIncreasedSequenceNumberMs(0),
stats_callback_(NULL) {
memset(&_remoteSenderInfo, 0, sizeof(_remoteSenderInfo));
- WEBRTC_TRACE(kTraceMemory, kTraceRtpRtcp, id, "%s created", __FUNCTION__);
}
RTCPReceiver::~RTCPReceiver() {
@@ -82,8 +81,6 @@
delete first->second;
_receivedCnameMap.erase(first);
}
- WEBRTC_TRACE(kTraceMemory, kTraceRtpRtcp, _id,
- "%s deleted", __FUNCTION__);
}
void
@@ -178,8 +175,7 @@
RTCPReportBlockInformation* reportBlock =
GetReportBlockInformation(remoteSSRC);
if (reportBlock == NULL) {
- WEBRTC_TRACE(kTraceError, kTraceRtpRtcp, _id,
- "\tfailed to GetReportBlockInformation(%u)", remoteSSRC);
+ LOG(LS_WARNING) << "Failed to reset rtt for ssrc " << remoteSSRC;
return -1;
}
reportBlock->RTT = 0;
@@ -282,22 +278,14 @@
return true;
}
-int32_t
-RTCPReceiver::SenderInfoReceived(RTCPSenderInfo* senderInfo) const
-{
- if(senderInfo == NULL)
- {
- WEBRTC_TRACE(kTraceError, kTraceRtpRtcp, _id, "%s invalid argument", __FUNCTION__);
- return -1;
- }
- CriticalSectionScoped lock(_criticalSectionRTCPReceiver);
- if(_lastReceivedSRNTPsecs == 0)
- {
- WEBRTC_TRACE(kTraceWarning, kTraceRtpRtcp, _id, "%s No received SR", __FUNCTION__);
- return -1;
- }
- memcpy(senderInfo, &(_remoteSenderInfo), sizeof(RTCPSenderInfo));
- return 0;
+int32_t RTCPReceiver::SenderInfoReceived(RTCPSenderInfo* senderInfo) const {
+ assert(senderInfo);
+ CriticalSectionScoped lock(_criticalSectionRTCPReceiver);
+ if (_lastReceivedSRNTPsecs == 0) {
+ return -1;
+ }
+ memcpy(senderInfo, &(_remoteSenderInfo), sizeof(RTCPSenderInfo));
+ return 0;
}
// statistics
@@ -518,8 +506,8 @@
RTCPReportBlockInformation* reportBlock =
CreateReportBlockInformation(remoteSSRC);
if (reportBlock == NULL) {
- WEBRTC_TRACE(kTraceError, kTraceRtpRtcp, _id,
- "\tfailed to CreateReportBlockInformation(%u)", remoteSSRC);
+ LOG(LS_WARNING) << "Failed to CreateReportBlockInformation("
+ << remoteSSRC << ")";
return;
}
@@ -779,9 +767,6 @@
}
RTCPReceiveInformation* receiveInfo = receiveInfoIt->second;
if (receiveInfo == NULL) {
- WEBRTC_TRACE(kTraceError, kTraceRtpRtcp, _id,
- "%s failed to get RTCPReceiveInformation",
- __FUNCTION__);
return -1;
}
if (receiveInfo->TmmbnBoundingSet.lengthOfSet() > 0) {
@@ -1348,8 +1333,7 @@
TMMBRSet* boundingSet = NULL;
numBoundingSet = FindTMMBRBoundingSet(boundingSet);
if (numBoundingSet == -1) {
- WEBRTC_TRACE(kTraceWarning, kTraceRtpRtcp, _id,
- "Failed to find TMMBR bounding set.");
+ LOG(LS_WARNING) << "Failed to find TMMBR bounding set.";
return -1;
}
// Set bounding set
@@ -1369,8 +1353,6 @@
CriticalSectionScoped lock(_criticalSectionFeedbacks);
if (_cbRtcpBandwidthObserver) {
_cbRtcpBandwidthObserver->OnReceivedEstimatedBitrate(bitrate * 1000);
- WEBRTC_TRACE(kTraceStream, kTraceRtpRtcp, _id,
- "Set TMMBR request:%d kbps", bitrate);
}
}
return 0;
@@ -1395,9 +1377,6 @@
// Process TMMBR and REMB first to avoid multiple callbacks
// to OnNetworkChanged.
if (rtcpPacketInformation.rtcpPacketTypeFlags & kRtcpTmmbr) {
- WEBRTC_TRACE(kTraceStateInfo, kTraceRtpRtcp, _id,
- "SIG [RTCP] Incoming TMMBR to id:%d", _id);
-
// Might trigger a OnReceivedBandwidthEstimateUpdate.
UpdateTMMBR();
}
@@ -1412,9 +1391,8 @@
}
if (rtcpPacketInformation.rtcpPacketTypeFlags & kRtcpNack) {
if (rtcpPacketInformation.nackSequenceNumbers.size() > 0) {
- WEBRTC_TRACE(kTraceStateInfo, kTraceRtpRtcp, _id,
- "SIG [RTCP] Incoming NACK length:%d",
- rtcpPacketInformation.nackSequenceNumbers.size());
+ LOG(LS_INFO) << "Incoming NACK length: "
+ << rtcpPacketInformation.nackSequenceNumbers.size();
_rtpRtcp.OnReceivedNACK(rtcpPacketInformation.nackSequenceNumbers);
}
}
@@ -1429,13 +1407,11 @@
if ((rtcpPacketInformation.rtcpPacketTypeFlags & kRtcpPli) ||
(rtcpPacketInformation.rtcpPacketTypeFlags & kRtcpFir)) {
if (rtcpPacketInformation.rtcpPacketTypeFlags & kRtcpPli) {
- WEBRTC_TRACE(kTraceStateInfo, kTraceRtpRtcp, _id,
- "SIG [RTCP] Incoming PLI from SSRC:0x%x",
- rtcpPacketInformation.remoteSSRC);
+ LOG(LS_INFO) << "Incoming PLI from SSRC "
+ << rtcpPacketInformation.remoteSSRC;
} else {
- WEBRTC_TRACE(kTraceStateInfo, kTraceRtpRtcp, _id,
- "SIG [RTCP] Incoming FIR from SSRC:0x%x",
- rtcpPacketInformation.remoteSSRC);
+ LOG(LS_INFO) << "Incoming FIR from SSRC "
+ << rtcpPacketInformation.remoteSSRC;
}
_cbRtcpIntraFrameObserver->OnReceivedIntraFrameRequest(local_ssrc);
}
@@ -1450,9 +1426,8 @@
}
if (_cbRtcpBandwidthObserver) {
if (rtcpPacketInformation.rtcpPacketTypeFlags & kRtcpRemb) {
- WEBRTC_TRACE(kTraceStateInfo, kTraceRtpRtcp, _id,
- "SIG [RTCP] Incoming REMB:%d",
- rtcpPacketInformation.receiverEstimatedMaxBitrate);
+ LOG(LS_INFO) << "Incoming REMB: "
+ << rtcpPacketInformation.receiverEstimatedMaxBitrate;
_cbRtcpBandwidthObserver->OnReceivedEstimatedBitrate(
rtcpPacketInformation.receiverEstimatedMaxBitrate);
}
@@ -1548,9 +1523,6 @@
while (receiveInfoIt != _receivedInfoMap.end()) {
RTCPReceiveInformation* receiveInfo = receiveInfoIt->second;
if(receiveInfo == NULL) {
- WEBRTC_TRACE(kTraceError, kTraceRtpRtcp, _id,
- "%s failed to get RTCPReceiveInformation",
- __FUNCTION__);
return -1;
}
num += receiveInfo->TmmbrSet.lengthOfSet();