summaryrefslogtreecommitdiff
path: root/voice_engine/voe_audio_processing_impl.cc
diff options
context:
space:
mode:
authorandrew@webrtc.org <andrew@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2012-11-14 19:07:54 +0000
committerandrew@webrtc.org <andrew@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2012-11-14 19:07:54 +0000
commitd898c019c4e09c73bc7354da9f1b54004f3e4b7e (patch)
treee8c2cb95f04570a59843adf38c8e07928157f820 /voice_engine/voe_audio_processing_impl.cc
parent27fe999a8fe09ea7a39318e00262b30e38caa83c (diff)
downloadwebrtc-d898c019c4e09c73bc7354da9f1b54004f3e4b7e.tar.gz
Add libjingle-style stream-style logging.
Add a highly stripped-down version of libjingle's base/logging.h. It is a thin wrapper around WEBRTC_TRACE, maintaining the libjingle log semantics to ease a transition to that format. Also add some helper macros for easy API and function failure logging. Review URL: https://webrtc-codereview.appspot.com/931010 git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@3099 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'voice_engine/voe_audio_processing_impl.cc')
-rw-r--r--voice_engine/voe_audio_processing_impl.cc21
1 files changed, 6 insertions, 15 deletions
diff --git a/voice_engine/voe_audio_processing_impl.cc b/voice_engine/voe_audio_processing_impl.cc
index 62440f4e..9397bfaf 100644
--- a/voice_engine/voe_audio_processing_impl.cc
+++ b/voice_engine/voe_audio_processing_impl.cc
@@ -13,18 +13,13 @@
#include "audio_processing.h"
#include "channel.h"
#include "critical_section_wrapper.h"
+#include "logging.h"
#include "trace.h"
#include "transmit_mixer.h"
#include "voe_errors.h"
#include "voice_engine_impl.h"
// TODO(andrew): move to a common place.
-#define WEBRTC_TRACE_VOICE_API() \
- do { \
- WEBRTC_TRACE(kTraceApiCall, kTraceVoice, \
- VoEId(_shared->instance_id(), -1), __FUNCTION__); \
- } while (0)
-
#define WEBRTC_VOICE_INIT_CHECK() \
do { \
if (!_shared->statistics().Initialized()) { \
@@ -41,7 +36,6 @@
} \
} while (0)
-
namespace webrtc {
#if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS)
@@ -353,9 +347,7 @@ int VoEAudioProcessingImpl::GetAgcConfig(AgcConfig& config) {
int VoEAudioProcessingImpl::SetRxNsStatus(int channel,
bool enable,
NsModes mode) {
- WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
- "SetRxNsStatus(channel=%d, enable=%d, mode=%d)",
- channel, (int)enable, (int)mode);
+ LOG_API3(channel, enable, mode);
#ifdef WEBRTC_VOICE_ENGINE_NR
if (!_shared->statistics().Initialized()) {
_shared->SetLastError(VE_NOT_INITED, kTraceError);
@@ -514,7 +506,7 @@ bool VoEAudioProcessing::DriftCompensationSupported() {
}
int VoEAudioProcessingImpl::EnableDriftCompensation(bool enable) {
- WEBRTC_TRACE_VOICE_API();
+ LOG_API1(enable);
WEBRTC_VOICE_INIT_CHECK();
if (!DriftCompensationSupported()) {
@@ -533,7 +525,7 @@ int VoEAudioProcessingImpl::EnableDriftCompensation(bool enable) {
}
bool VoEAudioProcessingImpl::DriftCompensationEnabled() {
- WEBRTC_TRACE_VOICE_API();
+ LOG_API0();
WEBRTC_VOICE_INIT_CHECK_BOOL();
EchoCancellation* aec = _shared->audio_processing()->echo_cancellation();
@@ -1139,13 +1131,12 @@ int VoEAudioProcessingImpl::SetTypingDetectionParameters(int timeWindow,
}
void VoEAudioProcessingImpl::EnableStereoChannelSwapping(bool enable) {
- WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
- "EnableStereoChannelSwapping(enable=%d)", enable);
+ LOG_API1(enable);
_shared->transmit_mixer()->EnableStereoChannelSwapping(enable);
}
bool VoEAudioProcessingImpl::IsStereoChannelSwappingEnabled() {
- WEBRTC_TRACE_VOICE_API();
+ LOG_API0();
return _shared->transmit_mixer()->IsStereoChannelSwappingEnabled();
}