Removing OutputDebugString from rtp_rtcp module

This is in response to WebRTC issue 167.

BUG=http://code.google.com/p/webrtc/issues/detail?id=167

Review URL: http://webrtc-codereview.appspot.com/301013

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1119 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrik.lundin@webrtc.org 2011-12-07 10:44:05 +00:00
parent 44ef3774ce
commit bf86c33b0e
4 changed files with 5 additions and 81 deletions

View File

@ -216,49 +216,6 @@ bool OverUseDetector::Update(const WebRtcRTPHeader& rtpHeader,
BandwidthUsage OverUseDetector::State() const BandwidthUsage OverUseDetector::State() const
{ {
#ifdef _DEBUG
char logStr[256];
static BandwidthUsage oldState = kBwNormal;
if (_hypothesis != oldState)
{
switch(_hypothesis)
{
case kBwOverusing:
{
#ifdef _WIN32
_snprintf(logStr,256, "State: OVER-USING\n");
#else
snprintf(logStr,256, "State: OVER-USING\n");
#endif
break;
}
case kBwUnderUsing:
{
#ifdef _WIN32
_snprintf(logStr,256, "State: UNDER-USING\n");
#else
snprintf(logStr,256, "State: UNDER-USING\n");
#endif
break;
}
case kBwNormal:
{
#ifdef _WIN32
_snprintf(logStr,256, "State: NORMAL\n");
#else
snprintf(logStr,256, "State: NORMAL\n");
#endif
break;
}
}
#ifdef _WIN32
OutputDebugStringA(logStr);
#else
//TODO
#endif
oldState = _hypothesis;
}
#endif
return _hypothesis; return _hypothesis;
} }

View File

@ -15,7 +15,6 @@
#include "module_common_types.h" #include "module_common_types.h"
#include "typedefs.h" #include "typedefs.h"
#include "list_wrapper.h" #include "list_wrapper.h"
#include <stdio.h>
//#define DEBUG_FILE //#define DEBUG_FILE

View File

@ -211,16 +211,9 @@ WebRtc_UWord32 RemoteRateControl::ChangeBitRate(WebRtc_UWord32 currentBitRate,
ChangeRegion(kRcAboveMax); ChangeRegion(kRcAboveMax);
} }
} }
#ifdef _DEBUG WEBRTC_TRACE(kTraceStream, kTraceRtpRtcp, -1,
char logStr[256]; "BWE: Response time: %f + %i + 10*33\n",
#ifdef _WIN32 _avgChangePeriod, RTT);
_snprintf(logStr,256, "Response time: %f + %i + 10*33\n", _avgChangePeriod, RTT);
OutputDebugStringA(logStr);
#else
snprintf(logStr,256, "Response time: %f + %i + 10*33\n", _avgChangePeriod, RTT);
//TODO
#endif
#endif
const WebRtc_UWord32 responseTime = static_cast<WebRtc_UWord32>(_avgChangePeriod + 0.5f) + RTT + 300; const WebRtc_UWord32 responseTime = static_cast<WebRtc_UWord32>(_avgChangePeriod + 0.5f) + RTT + 300;
double alpha = RateIncreaseFactor(nowMS, _lastBitRateChange, double alpha = RateIncreaseFactor(nowMS, _lastBitRateChange,
responseTime, noiseVar); responseTime, noiseVar);
@ -242,18 +235,6 @@ WebRtc_UWord32 RemoteRateControl::ChangeBitRate(WebRtc_UWord32 currentBitRate,
_maxHoldRate = 0; _maxHoldRate = 0;
WEBRTC_TRACE(kTraceStream, kTraceRtpRtcp, -1, WEBRTC_TRACE(kTraceStream, kTraceRtpRtcp, -1,
"BWE: Increase rate to currentBitRate = %u kbps", currentBitRate/1000); "BWE: Increase rate to currentBitRate = %u kbps", currentBitRate/1000);
#ifdef _DEBUG
//char logStr[256];
#ifdef _WIN32
_snprintf(logStr,256, "New bitRate: %lu\n",
static_cast<long unsigned int> (currentBitRate / 1000));
OutputDebugStringA(logStr);
#else
snprintf(logStr,256, "New bitRate: %lu\n",
static_cast<long unsigned int> (currentBitRate / 1000));
//TODO
#endif
#endif
_lastBitRateChange = nowMS; _lastBitRateChange = nowMS;
break; break;
} }
@ -461,25 +442,16 @@ void RemoteRateControl::ChangeState(RateControlState newState)
{ {
_cameFromState = _rcState; _cameFromState = _rcState;
_rcState = newState; _rcState = newState;
#ifdef _DEBUG
char logStr[256];
char state1[15]; char state1[15];
char state2[15]; char state2[15];
char state3[15]; char state3[15];
StateStr(_cameFromState, state1); StateStr(_cameFromState, state1);
StateStr(_rcState, state2); StateStr(_rcState, state2);
StateStr(_currentInput._bwState, state3); StateStr(_currentInput._bwState, state3);
#ifdef _WIN32 WEBRTC_TRACE(kTraceStream, kTraceRtpRtcp, -1,
_snprintf(logStr,256, "\t%s => %s due to %s\n", state1, state2, state3); "\t%s => %s due to %s\n", state1, state2, state3);
OutputDebugStringA(logStr);
#else
snprintf(logStr,256, "\t%s => %s due to %s\n", state1, state2, state3);
//TODO
#endif
#endif
} }
#ifdef _DEBUG
void RemoteRateControl::StateStr(RateControlState state, char* str) void RemoteRateControl::StateStr(RateControlState state, char* str)
{ {
switch (state) switch (state)
@ -517,6 +489,5 @@ void RemoteRateControl::StateStr(BandwidthUsage state, char* str)
break; break;
} }
} }
#endif
} // namespace webrtc } // namespace webrtc

View File

@ -14,7 +14,6 @@
#include "bwe_defines.h" #include "bwe_defines.h"
#include "typedefs.h" #include "typedefs.h"
#include "list_wrapper.h" #include "list_wrapper.h"
#include <stdio.h>
#ifdef MATLAB #ifdef MATLAB
#include "../test/BWEStandAlone/MatlabPlot.h" #include "../test/BWEStandAlone/MatlabPlot.h"
@ -43,10 +42,8 @@ private:
void ChangeState(const RateControlInput& input, WebRtc_Word64 nowMs); void ChangeState(const RateControlInput& input, WebRtc_Word64 nowMs);
void ChangeState(RateControlState newState); void ChangeState(RateControlState newState);
void ChangeRegion(RateControlRegion region); void ChangeRegion(RateControlRegion region);
#ifdef _DEBUG
static void StateStr(RateControlState state, char* str); static void StateStr(RateControlState state, char* str);
static void StateStr(BandwidthUsage state, char* str); static void StateStr(BandwidthUsage state, char* str);
#endif
WebRtc_UWord32 _minConfiguredBitRate; WebRtc_UWord32 _minConfiguredBitRate;
WebRtc_UWord32 _maxConfiguredBitRate; WebRtc_UWord32 _maxConfiguredBitRate;