Fix win trybot errors due to r4729.
The addition of logging.h in r4729 was causing the win trybot to fail with "#pragma deprecated" errors in standard library headers. This turned out to be due to including strsafe.h (via audio_device_config.h) before sstream (via logging.h). strsafe.h was only being included for the unused DEBUG_PRINT macro. I removed all references to it. This incidentally removes a bunch of other unneeded headers discovered while trying to track the problem down. This didn't show up in the commitbots; my guess is that the trybots are using the VC10 toolchain and the commitbots the VC11 toolchain. TBR=pbos Review URL: https://webrtc-codereview.appspot.com/2204004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@4738 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
6a5cc9d899
commit
2553450959
@ -9,18 +9,16 @@
|
||||
*/
|
||||
|
||||
#include "webrtc/modules/audio_device/audio_device_buffer.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#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 <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
static const int kHighDelayThresholdMs = 300;
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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 <windows.h>
|
||||
#include <tchar.h>
|
||||
#include <strsafe.h>
|
||||
#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_
|
||||
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user