diff --git a/webrtc/modules/audio_device/audio_device_buffer.cc b/webrtc/modules/audio_device/audio_device_buffer.cc index 62d1961396..db5cc322f9 100644 --- a/webrtc/modules/audio_device/audio_device_buffer.cc +++ b/webrtc/modules/audio_device/audio_device_buffer.cc @@ -9,18 +9,16 @@ */ #include "webrtc/modules/audio_device/audio_device_buffer.h" + +#include +#include + #include "webrtc/modules/audio_device/audio_device_config.h" #include "webrtc/modules/audio_device/audio_device_utility.h" #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" #include "webrtc/system_wrappers/interface/logging.h" #include "webrtc/system_wrappers/interface/trace.h" -#include -#include -#include - -#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h" - namespace webrtc { static const int kHighDelayThresholdMs = 300; diff --git a/webrtc/modules/audio_device/audio_device_buffer.h b/webrtc/modules/audio_device/audio_device_buffer.h index 08b9bb0ce4..fd06e7c3c3 100644 --- a/webrtc/modules/audio_device/audio_device_buffer.h +++ b/webrtc/modules/audio_device/audio_device_buffer.h @@ -11,10 +11,8 @@ #ifndef WEBRTC_AUDIO_DEVICE_AUDIO_DEVICE_BUFFER_H #define WEBRTC_AUDIO_DEVICE_AUDIO_DEVICE_BUFFER_H -#include "webrtc/common_audio/resampler/include/resampler.h" #include "webrtc/modules/audio_device/include/audio_device.h" #include "webrtc/system_wrappers/interface/file_wrapper.h" -#include "webrtc/system_wrappers/interface/list_wrapper.h" #include "webrtc/typedefs.h" namespace webrtc { diff --git a/webrtc/modules/audio_device/audio_device_config.h b/webrtc/modules/audio_device/audio_device_config.h index 23b9d5516d..3204cf509a 100644 --- a/webrtc/modules/audio_device/audio_device_config.h +++ b/webrtc/modules/audio_device/audio_device_config.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_AUDIO_DEVICE_AUDIO_DEVICE_CONFIG_H -#define WEBRTC_AUDIO_DEVICE_AUDIO_DEVICE_CONFIG_H +#ifndef WEBRTC_AUDIO_DEVICE_AUDIO_DEVICE_CONFIG_H_ +#define WEBRTC_AUDIO_DEVICE_AUDIO_DEVICE_CONFIG_H_ // Enumerators // @@ -26,19 +26,5 @@ enum { GET_MIC_VOLUME_INTERVAL_MS = 1000 }; #endif #endif -#if (defined(_DEBUG) && defined(_WIN32) && (_MSC_VER >= 1400)) -#include -#include -#include -#define DEBUG_PRINT(...) \ -{ \ - TCHAR msg[256]; \ - StringCchPrintf(msg, 256, __VA_ARGS__); \ - OutputDebugString(msg); \ -} -#else -#define DEBUG_PRINT(exp) ((void)0) -#endif - -#endif // WEBRTC_AUDIO_DEVICE_AUDIO_DEVICE_CONFIG_H +#endif // WEBRTC_AUDIO_DEVICE_AUDIO_DEVICE_CONFIG_H_ diff --git a/webrtc/modules/audio_device/linux/audio_device_utility_linux.cc b/webrtc/modules/audio_device/linux/audio_device_utility_linux.cc index d714f8fc30..fdd7d14167 100644 --- a/webrtc/modules/audio_device/linux/audio_device_utility_linux.cc +++ b/webrtc/modules/audio_device/linux/audio_device_utility_linux.cc @@ -8,7 +8,6 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/modules/audio_device/audio_device_config.h" // DEBUG_PRINT() #include "webrtc/modules/audio_device/linux/audio_device_utility_linux.h" #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" #include "webrtc/system_wrappers/interface/trace.h" diff --git a/webrtc/modules/audio_device/mac/audio_device_utility_mac.cc b/webrtc/modules/audio_device/mac/audio_device_utility_mac.cc index 10e9659db0..ab1e15019e 100644 --- a/webrtc/modules/audio_device/mac/audio_device_utility_mac.cc +++ b/webrtc/modules/audio_device/mac/audio_device_utility_mac.cc @@ -8,7 +8,6 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/modules/audio_device/audio_device_config.h" // DEBUG_PRINT() #include "webrtc/modules/audio_device/mac/audio_device_utility_mac.h" #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" #include "webrtc/system_wrappers/interface/trace.h" diff --git a/webrtc/modules/audio_device/win/audio_device_utility_win.cc b/webrtc/modules/audio_device/win/audio_device_utility_win.cc index 0d0655b21c..1d28e3d290 100644 --- a/webrtc/modules/audio_device/win/audio_device_utility_win.cc +++ b/webrtc/modules/audio_device/win/audio_device_utility_win.cc @@ -8,7 +8,6 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/modules/audio_device/audio_device_config.h" #include "webrtc/modules/audio_device/win/audio_device_utility_win.h" #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" @@ -79,10 +78,8 @@ int32_t AudioDeviceUtilityWindows::Init() { strncpy(os, "Could not get OS info", STRING_MAX_SIZE); } - // DEBUG_PRINTP("OS info: %s\n", os); WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, " OS info: %s", os); #else - // DEBUG_PRINTP("OS info: %s\n", szOS); WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, " OS info: %s", szOS); #endif } @@ -125,7 +122,7 @@ BOOL AudioDeviceUtilityWindows::GetOSDisplayString(LPTSTR pszOS) // Windows Server 2008 R2 6.1 // Windows Server 2008 6.0 // Windows Vista 6.0 - // - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - - - - - // Windows Server 2003 R2 5.2 // Windows Server 2003 5.2 // Windows XP 5.1 @@ -140,7 +137,7 @@ BOOL AudioDeviceUtilityWindows::GetOSDisplayString(LPTSTR pszOS) // Windows Vista or Server 2008 if (osvi.wProductType == VER_NT_WORKSTATION) StringCchCat(pszOS, STRING_MAX_SIZE, TEXT("Windows Vista ")); - else + else StringCchCat(pszOS, STRING_MAX_SIZE, TEXT("Windows Server 2008 " )); } @@ -149,7 +146,7 @@ BOOL AudioDeviceUtilityWindows::GetOSDisplayString(LPTSTR pszOS) // Windows 7 or Server 2008 R2 if (osvi.wProductType == VER_NT_WORKSTATION) StringCchCat(pszOS, STRING_MAX_SIZE, TEXT("Windows 7 ")); - else + else StringCchCat(pszOS, STRING_MAX_SIZE, TEXT("Windows Server 2008 R2 " )); } } @@ -164,7 +161,7 @@ BOOL AudioDeviceUtilityWindows::GetOSDisplayString(LPTSTR pszOS) StringCchCat(pszOS, STRING_MAX_SIZE, TEXT("Windows XP ")); if (osvi.wSuiteMask & VER_SUITE_PERSONAL) StringCchCat(pszOS, STRING_MAX_SIZE, TEXT( "Home Edition" )); - else + else StringCchCat(pszOS, STRING_MAX_SIZE, TEXT( "Professional" )); } @@ -176,7 +173,7 @@ BOOL AudioDeviceUtilityWindows::GetOSDisplayString(LPTSTR pszOS) { StringCchCat(pszOS, STRING_MAX_SIZE, TEXT( "Professional" )); } - else + else { if (osvi.wSuiteMask & VER_SUITE_DATACENTER) StringCchCat(pszOS, STRING_MAX_SIZE, TEXT( "Datacenter Server" )); @@ -206,24 +203,24 @@ BOOL AudioDeviceUtilityWindows::GetOSDisplayString(LPTSTR pszOS) pGNSI = (PGNSI) GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetNativeSystemInfo"); if (NULL != pGNSI) pGNSI(&si); - else + else GetSystemInfo(&si); // Add 64-bit or 32-bit for OS versions "later than" Vista // if (osvi.dwMajorVersion >= 6) { - if ((si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) || + if ((si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) || (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_IA64)) StringCchCat(pszOS, STRING_MAX_SIZE, TEXT( ", 64-bit" )); else if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL ) StringCchCat(pszOS, STRING_MAX_SIZE, TEXT(", 32-bit")); } - - return TRUE; + + return TRUE; } else - { + { return FALSE; } } diff --git a/webrtc/modules/audio_device/win/audio_device_wave_win.cc b/webrtc/modules/audio_device/win/audio_device_wave_win.cc index b48ddfcb40..c05d0a29a7 100644 --- a/webrtc/modules/audio_device/win/audio_device_wave_win.cc +++ b/webrtc/modules/audio_device/win/audio_device_wave_win.cc @@ -231,8 +231,8 @@ int32_t AudioDeviceWindowsWave::Init() } const char* threadName = "webrtc_audio_module_thread"; - _ptrThread = ThreadWrapper::CreateThread(ThreadFunc, - this, + _ptrThread = ThreadWrapper::CreateThread(ThreadFunc, + this, kRealtimePriority, threadName); if (_ptrThread == NULL) @@ -364,7 +364,7 @@ int32_t AudioDeviceWindowsWave::Terminate() return -1; } _critSect.Enter(); - WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, + WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, " volume getter thread is now closed"); SetEvent(_hShutdownSetVolumeEvent); @@ -417,7 +417,7 @@ DWORD AudioDeviceWindowsWave::DoGetCaptureVolumeThread() while (1) { - DWORD waitResult = WaitForSingleObject(waitObject, + DWORD waitResult = WaitForSingleObject(waitObject, GET_MIC_VOLUME_INTERVAL_MS); switch (waitResult) { @@ -440,7 +440,7 @@ DWORD AudioDeviceWindowsWave::DoGetCaptureVolumeThread() _critSect.Enter(); if (_ptrAudioBuffer) { - _ptrAudioBuffer->SetCurrentMicLevel(currentMicLevel); + _ptrAudioBuffer->SetCurrentMicLevel(currentMicLevel); } _critSect.Leave(); } @@ -472,11 +472,11 @@ DWORD AudioDeviceWindowsWave::DoSetCaptureVolumeThread() _critSect.Leave(); if (SetMicrophoneVolume(newMicLevel) == -1) - { + { WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, " the required modification of the microphone volume failed"); } - } + } return 0; } @@ -1269,7 +1269,7 @@ int32_t AudioDeviceWindowsWave::MaxMicrophoneVolume(uint32_t& maxVolume) const // (1) API GetLineControl() returns failure at querying the max Mic level. // (2) API GetLineControl() returns maxVolume as zero in rare cases. // Both cases show we don't have access to the mixer controls. - // We return -1 here to indicate that. + // We return -1 here to indicate that. if (_maxMicVolume == 0) { return -1; @@ -2809,7 +2809,6 @@ int32_t AudioDeviceWindowsWave::GetPlayoutBufferDelay(uint32_t& writtenSamples, // derive remaining amount (in ms) of data in the playout buffer msecInPlayoutBuffer = ((writtenSamples - playedSamples)/nSamplesPerMs); - // DEBUG_PRINTP("msecInPlayoutBuffer=%u\n", msecInPlayoutBuffer); playedDifference = (long) (_playedSamplesOld - playedSamples); @@ -3393,7 +3392,7 @@ int32_t AudioDeviceWindowsWave::RecProc(LONGLONG& consumedTime) // The VQE will only deliver non-zero microphone levels when a change is needed. WEBRTC_TRACE(kTraceStream, kTraceUtility, _id,"AGC change of volume: => new=%u", newMicLevel); - // We store this outside of the audio buffer to avoid + // We store this outside of the audio buffer to avoid // having it overwritten by the getter thread. _newMicLevel = newMicLevel; SetEvent(_hSetCaptureVolumeEvent);