| Index: webrtc/modules/audio_device/win/audio_device_core_win.cc
|
| diff --git a/webrtc/modules/audio_device/win/audio_device_core_win.cc b/webrtc/modules/audio_device/win/audio_device_core_win.cc
|
| index c77eacc774e4f6d0cd5730c793e5339570129498..0c6d34e4c4bc0918b57d955d0a8bfd5115eb9ac0 100644
|
| --- a/webrtc/modules/audio_device/win/audio_device_core_win.cc
|
| +++ b/webrtc/modules/audio_device/win/audio_device_core_win.cc
|
| @@ -438,7 +438,6 @@ AudioDeviceWindowsCore::AudioDeviceWindowsCore()
|
| _sndCardRecDelay(0),
|
| _writtenSamples(0),
|
| _readSamples(0),
|
| - _playAcc(0),
|
| _recAudioFrameSize(0),
|
| _recSampleRate(0),
|
| _recBlockSize(0),
|
| @@ -469,9 +468,7 @@ AudioDeviceWindowsCore::AudioDeviceWindowsCore()
|
| _playError(0),
|
| _recWarning(0),
|
| _recError(0),
|
| - _playBufType(AudioDeviceModule::kAdaptiveBufferSize),
|
| _playBufDelay(80),
|
| - _playBufDelayFixed(80),
|
| _usingInputDeviceIndex(false),
|
| _usingOutputDeviceIndex(false),
|
| _inputDevice(AudioDeviceModule::kDefaultCommunicationDevice),
|
| @@ -530,7 +527,6 @@ AudioDeviceWindowsCore::AudioDeviceWindowsCore()
|
|
|
| _perfCounterFreq.QuadPart = 1;
|
| _perfCounterFactor = 0.0;
|
| - _avgCPULoad = 0.0;
|
|
|
| // list of number of channels to use on recording side
|
| _recChannelsPrioList[0] = 2; // stereo is prio 1
|
| @@ -1083,23 +1079,6 @@ int32_t AudioDeviceWindowsCore::MinSpeakerVolume(uint32_t& minVolume) const
|
| return 0;
|
| }
|
|
|
| -// ----------------------------------------------------------------------------
|
| -// SpeakerVolumeStepSize
|
| -// ----------------------------------------------------------------------------
|
| -
|
| -int32_t AudioDeviceWindowsCore::SpeakerVolumeStepSize(uint16_t& stepSize) const
|
| -{
|
| -
|
| - if (!_speakerIsInitialized)
|
| - {
|
| - return -1;
|
| - }
|
| -
|
| - stepSize = CORE_SPEAKER_VOLUME_STEP_SIZE;
|
| -
|
| - return 0;
|
| -}
|
| -
|
| // ----------------------------------------------------------------------------
|
| // SpeakerMuteIsAvailable
|
| // ----------------------------------------------------------------------------
|
| @@ -1327,47 +1306,6 @@ Exit:
|
| return -1;
|
| }
|
|
|
| -// ----------------------------------------------------------------------------
|
| -// MicrophoneBoostIsAvailable
|
| -// ----------------------------------------------------------------------------
|
| -
|
| -int32_t AudioDeviceWindowsCore::MicrophoneBoostIsAvailable(bool& available)
|
| -{
|
| -
|
| - available = false;
|
| - return 0;
|
| -}
|
| -
|
| -// ----------------------------------------------------------------------------
|
| -// SetMicrophoneBoost
|
| -// ----------------------------------------------------------------------------
|
| -
|
| -int32_t AudioDeviceWindowsCore::SetMicrophoneBoost(bool enable)
|
| -{
|
| -
|
| - if (!_microphoneIsInitialized)
|
| - {
|
| - return -1;
|
| - }
|
| -
|
| - return -1;
|
| -}
|
| -
|
| -// ----------------------------------------------------------------------------
|
| -// MicrophoneBoost
|
| -// ----------------------------------------------------------------------------
|
| -
|
| -int32_t AudioDeviceWindowsCore::MicrophoneBoost(bool& enabled) const
|
| -{
|
| -
|
| - if (!_microphoneIsInitialized)
|
| - {
|
| - return -1;
|
| - }
|
| -
|
| - return -1;
|
| -}
|
| -
|
| // ----------------------------------------------------------------------------
|
| // StereoRecordingIsAvailable
|
| // ----------------------------------------------------------------------------
|
| @@ -1650,23 +1588,6 @@ int32_t AudioDeviceWindowsCore::MinMicrophoneVolume(uint32_t& minVolume) const
|
| return 0;
|
| }
|
|
|
| -// ----------------------------------------------------------------------------
|
| -// MicrophoneVolumeStepSize
|
| -// ----------------------------------------------------------------------------
|
| -
|
| -int32_t AudioDeviceWindowsCore::MicrophoneVolumeStepSize(uint16_t& stepSize) const
|
| -{
|
| -
|
| - if (!_microphoneIsInitialized)
|
| - {
|
| - return -1;
|
| - }
|
| -
|
| - stepSize = CORE_MICROPHONE_VOLUME_STEP_SIZE;
|
| -
|
| - return 0;
|
| -}
|
| -
|
| // ----------------------------------------------------------------------------
|
| // PlayoutDevices
|
| // ----------------------------------------------------------------------------
|
| @@ -2827,8 +2748,6 @@ int32_t AudioDeviceWindowsCore::StartRecording()
|
| }
|
| LOG(LS_VERBOSE) << "capture audio stream has now started...";
|
|
|
| - _avgCPULoad = 0.0f;
|
| - _playAcc = 0;
|
| _recording = true;
|
|
|
| return 0;
|
| @@ -3141,58 +3060,6 @@ bool AudioDeviceWindowsCore::Playing() const
|
| {
|
| return (_playing);
|
| }
|
| -// ----------------------------------------------------------------------------
|
| -// SetPlayoutBuffer
|
| -// ----------------------------------------------------------------------------
|
| -
|
| -int32_t AudioDeviceWindowsCore::SetPlayoutBuffer(const AudioDeviceModule::BufferType type, uint16_t sizeMS)
|
| -{
|
| -
|
| - rtc::CritScope lock(&_critSect);
|
| -
|
| - _playBufType = type;
|
| -
|
| - if (type == AudioDeviceModule::kFixedBufferSize)
|
| - {
|
| - _playBufDelayFixed = sizeMS;
|
| - }
|
| -
|
| - return 0;
|
| -}
|
| -
|
| -// ----------------------------------------------------------------------------
|
| -// PlayoutBuffer
|
| -// ----------------------------------------------------------------------------
|
| -
|
| -int32_t AudioDeviceWindowsCore::PlayoutBuffer(AudioDeviceModule::BufferType& type, uint16_t& sizeMS) const
|
| -{
|
| - rtc::CritScope lock(&_critSect);
|
| - type = _playBufType;
|
| -
|
| - if (type == AudioDeviceModule::kFixedBufferSize)
|
| - {
|
| - sizeMS = _playBufDelayFixed;
|
| - }
|
| - else
|
| - {
|
| - // Use same value as for PlayoutDelay
|
| - sizeMS = static_cast<uint16_t>(_sndCardPlayDelay);
|
| - }
|
| -
|
| - return 0;
|
| -}
|
| -
|
| -// ----------------------------------------------------------------------------
|
| -// CPULoad
|
| -// ----------------------------------------------------------------------------
|
| -
|
| -int32_t AudioDeviceWindowsCore::CPULoad(uint16_t& load) const
|
| -{
|
| -
|
| - load = static_cast<uint16_t> (100*_avgCPULoad);
|
| -
|
| - return 0;
|
| -}
|
|
|
| // ----------------------------------------------------------------------------
|
| // PlayoutWarning
|
| @@ -3388,10 +3255,6 @@ DWORD AudioDeviceWindowsCore::DoRenderThread()
|
| HRESULT hr = S_OK;
|
| HANDLE hMmTask = NULL;
|
|
|
| - LARGE_INTEGER t1;
|
| - LARGE_INTEGER t2;
|
| - int32_t time(0);
|
| -
|
| // Initialize COM as MTA in this thread.
|
| ScopedCOMInitializer comInit(ScopedCOMInitializer::kMTA);
|
| if (!comInit.succeeded()) {
|
| @@ -3558,8 +3421,6 @@ DWORD AudioDeviceWindowsCore::DoRenderThread()
|
| _ptrRenderClient->GetBuffer(_playBlockSizeInFrames, &pData);
|
| EXIT_ON_ERROR(hr);
|
|
|
| - QueryPerformanceCounter(&t1); // measure time: START
|
| -
|
| if (_ptrAudioBuffer)
|
| {
|
| // Request data to be played out (#bytes =
|
| @@ -3596,10 +3457,6 @@ DWORD AudioDeviceWindowsCore::DoRenderThread()
|
| nSamples = _ptrAudioBuffer->GetPlayoutData((int8_t*)pData);
|
| }
|
|
|
| - QueryPerformanceCounter(&t2); // measure time: STOP
|
| - time = (int)(t2.QuadPart-t1.QuadPart);
|
| - _playAcc += time;
|
| -
|
| DWORD dwFlags(0);
|
| hr = _ptrRenderClient->ReleaseBuffer(_playBlockSizeInFrames,
|
| dwFlags);
|
| @@ -3878,8 +3735,6 @@ DWORD AudioDeviceWindowsCore::DoCaptureThread()
|
| HRESULT hr = S_OK;
|
|
|
| LARGE_INTEGER t1;
|
| - LARGE_INTEGER t2;
|
| - int32_t time(0);
|
|
|
| BYTE* syncBuffer = NULL;
|
| UINT32 syncBufIndex = 0;
|
| @@ -4068,22 +3923,10 @@ DWORD AudioDeviceWindowsCore::DoCaptureThread()
|
|
|
| _ptrAudioBuffer->SetTypingStatus(KeyPressed());
|
|
|
| - QueryPerformanceCounter(&t1); // measure time: START
|
| -
|
| _UnLock(); // release lock while making the callback
|
| _ptrAudioBuffer->DeliverRecordedData();
|
| _Lock(); // restore the lock
|
|
|
| - QueryPerformanceCounter(&t2); // measure time: STOP
|
| -
|
| - // Measure "average CPU load".
|
| - // Basically what we do here is to measure how many percent of our 10ms period
|
| - // is used for encoding and decoding. This value shuld be used as a warning indicator
|
| - // only and not seen as an absolute value. Running at ~100% will lead to bad QoS.
|
| - time = (int)(t2.QuadPart - t1.QuadPart);
|
| - _avgCPULoad = (float)(_avgCPULoad*.99 + (time + _playAcc) / (double)(_perfCounterFreq.QuadPart));
|
| - _playAcc = 0;
|
| -
|
| // Sanity check to ensure that essential states are not modified during the unlocked period
|
| if (_ptrCaptureClient == NULL || _ptrClientIn == NULL)
|
| {
|
|
|