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
This commit is contained in:
andresp@webrtc.org
2014-04-08 11:06:12 +00:00
parent b287d968d9
commit dc80bae2a6
44 changed files with 227 additions and 792 deletions

View File

@ -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 @@ RTCPReceiver::RTCPReceiver(const int32_t id, Clock* clock,
_lastIncreasedSequenceNumberMs(0),
stats_callback_(NULL) {
memset(&_remoteSenderInfo, 0, sizeof(_remoteSenderInfo));
WEBRTC_TRACE(kTraceMemory, kTraceRtpRtcp, id, "%s created", __FUNCTION__);
}
RTCPReceiver::~RTCPReceiver() {
@ -82,8 +81,6 @@ RTCPReceiver::~RTCPReceiver() {
delete first->second;
_receivedCnameMap.erase(first);
}
WEBRTC_TRACE(kTraceMemory, kTraceRtpRtcp, _id,
"%s deleted", __FUNCTION__);
}
void
@ -178,8 +175,7 @@ int32_t RTCPReceiver::ResetRTT(const uint32_t remoteSSRC) {
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 @@ bool RTCPReceiver::LastReceivedXrReferenceTimeInfo(
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 @@ void RTCPReceiver::HandleReportBlock(
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 @@ int32_t RTCPReceiver::BoundingSet(bool &tmmbrOwner, TMMBRSet* boundingSetRec) {
}
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 @@ int32_t RTCPReceiver::UpdateTMMBR() {
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 @@ int32_t RTCPReceiver::UpdateTMMBR() {
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 @@ void RTCPReceiver::TriggerCallbacksFromRTCPPacket(
// 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 @@ void RTCPReceiver::TriggerCallbacksFromRTCPPacket(
}
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 @@ void RTCPReceiver::TriggerCallbacksFromRTCPPacket(
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 @@ void RTCPReceiver::TriggerCallbacksFromRTCPPacket(
}
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 @@ int32_t RTCPReceiver::TMMBRReceived(const uint32_t size,
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();