From bf86c33b0ef412597c619699909835c9620b31db Mon Sep 17 00:00:00 2001 From: "henrik.lundin@webrtc.org" Date: Wed, 7 Dec 2011 10:44:05 +0000 Subject: [PATCH] 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 --- .../rtp_rtcp/source/overuse_detector.cc | 43 ------------------- .../rtp_rtcp/source/overuse_detector.h | 1 - .../rtp_rtcp/source/remote_rate_control.cc | 39 +++-------------- .../rtp_rtcp/source/remote_rate_control.h | 3 -- 4 files changed, 5 insertions(+), 81 deletions(-) diff --git a/src/modules/rtp_rtcp/source/overuse_detector.cc b/src/modules/rtp_rtcp/source/overuse_detector.cc index e0b12c824..c34533e57 100644 --- a/src/modules/rtp_rtcp/source/overuse_detector.cc +++ b/src/modules/rtp_rtcp/source/overuse_detector.cc @@ -216,49 +216,6 @@ bool OverUseDetector::Update(const WebRtcRTPHeader& rtpHeader, 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; } diff --git a/src/modules/rtp_rtcp/source/overuse_detector.h b/src/modules/rtp_rtcp/source/overuse_detector.h index 12fff5ce7..685cc6ffa 100644 --- a/src/modules/rtp_rtcp/source/overuse_detector.h +++ b/src/modules/rtp_rtcp/source/overuse_detector.h @@ -15,7 +15,6 @@ #include "module_common_types.h" #include "typedefs.h" #include "list_wrapper.h" -#include //#define DEBUG_FILE diff --git a/src/modules/rtp_rtcp/source/remote_rate_control.cc b/src/modules/rtp_rtcp/source/remote_rate_control.cc index 404efca97..b624ee2b9 100644 --- a/src/modules/rtp_rtcp/source/remote_rate_control.cc +++ b/src/modules/rtp_rtcp/source/remote_rate_control.cc @@ -211,16 +211,9 @@ WebRtc_UWord32 RemoteRateControl::ChangeBitRate(WebRtc_UWord32 currentBitRate, ChangeRegion(kRcAboveMax); } } -#ifdef _DEBUG - char logStr[256]; -#ifdef _WIN32 - _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 + WEBRTC_TRACE(kTraceStream, kTraceRtpRtcp, -1, + "BWE: Response time: %f + %i + 10*33\n", + _avgChangePeriod, RTT); const WebRtc_UWord32 responseTime = static_cast(_avgChangePeriod + 0.5f) + RTT + 300; double alpha = RateIncreaseFactor(nowMS, _lastBitRateChange, responseTime, noiseVar); @@ -242,18 +235,6 @@ WebRtc_UWord32 RemoteRateControl::ChangeBitRate(WebRtc_UWord32 currentBitRate, _maxHoldRate = 0; WEBRTC_TRACE(kTraceStream, kTraceRtpRtcp, -1, "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 (currentBitRate / 1000)); - OutputDebugStringA(logStr); -#else - snprintf(logStr,256, "New bitRate: %lu\n", - static_cast (currentBitRate / 1000)); - //TODO -#endif -#endif _lastBitRateChange = nowMS; break; } @@ -461,25 +442,16 @@ void RemoteRateControl::ChangeState(RateControlState newState) { _cameFromState = _rcState; _rcState = newState; -#ifdef _DEBUG - char logStr[256]; char state1[15]; char state2[15]; char state3[15]; StateStr(_cameFromState, state1); StateStr(_rcState, state2); StateStr(_currentInput._bwState, state3); -#ifdef _WIN32 - _snprintf(logStr,256, "\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 + WEBRTC_TRACE(kTraceStream, kTraceRtpRtcp, -1, + "\t%s => %s due to %s\n", state1, state2, state3); } -#ifdef _DEBUG void RemoteRateControl::StateStr(RateControlState state, char* str) { switch (state) @@ -517,6 +489,5 @@ void RemoteRateControl::StateStr(BandwidthUsage state, char* str) break; } } -#endif } // namespace webrtc diff --git a/src/modules/rtp_rtcp/source/remote_rate_control.h b/src/modules/rtp_rtcp/source/remote_rate_control.h index 26d867a80..808f7d444 100644 --- a/src/modules/rtp_rtcp/source/remote_rate_control.h +++ b/src/modules/rtp_rtcp/source/remote_rate_control.h @@ -14,7 +14,6 @@ #include "bwe_defines.h" #include "typedefs.h" #include "list_wrapper.h" -#include #ifdef MATLAB #include "../test/BWEStandAlone/MatlabPlot.h" @@ -43,10 +42,8 @@ private: void ChangeState(const RateControlInput& input, WebRtc_Word64 nowMs); void ChangeState(RateControlState newState); void ChangeRegion(RateControlRegion region); -#ifdef _DEBUG static void StateStr(RateControlState state, char* str); static void StateStr(BandwidthUsage state, char* str); -#endif WebRtc_UWord32 _minConfiguredBitRate; WebRtc_UWord32 _maxConfiguredBitRate;