Revert "Remove AudioDeviceObserver and make ADM not inherit from the Module interface."

This reverts commit 34cdd2d402b08aee4e17a6fd38c87e0e5cd7aa30.

Reason for revert: Breaks Chromium

Original change's description:
> Remove AudioDeviceObserver and make ADM not inherit from the Module interface.
> 
> (Re-upload of https://codereview.webrtc.org/3020493002/)
> 
> Bug: webrtc:4690, webrtc:7306
> Change-Id: I67fb9ebca1296aabc08eae8a292a5c69832dc35e
> Reviewed-on: https://webrtc-review.googlesource.com/5360
> Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
> Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20083}

TBR=solenberg@webrtc.org,henrika@webrtc.org

Change-Id: Iad03cafb7865f5a22394c3d4d1d3ff3e0fccd4ff
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:4690, webrtc:7306
Reviewed-on: https://webrtc-review.googlesource.com/5402
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20085}
This commit is contained in:
Fredrik Solenberg
2017-10-02 15:08:56 +00:00
committed by Commit Bot
parent bee50d90fc
commit d4404c232d
35 changed files with 698 additions and 14 deletions

View File

@ -89,7 +89,11 @@ AudioDeviceLinuxALSA::AudioDeviceLinuxALSA() :
_playIsInitialized(false),
_AGC(false),
_recordingDelay(0),
_playoutDelay(0)
_playoutDelay(0),
_playWarning(0),
_playError(0),
_recWarning(0),
_recError(0)
{
memset(_oldKeyState, 0, sizeof(_oldKeyState));
LOG(LS_INFO) << __FUNCTION__ << " created";
@ -162,6 +166,10 @@ AudioDeviceGeneric::InitStatus AudioDeviceLinuxALSA::Init() {
<< "failed to open X display, typing detection will not work";
}
#endif
_playWarning = 0;
_playError = 0;
_recWarning = 0;
_recError = 0;
_initialized = true;
@ -1006,6 +1014,8 @@ int32_t AudioDeviceLinuxALSA::InitPlayout()
_handlePlayout, _playoutFramesIn10MS);
// Init varaibles used for play
_playWarning = 0;
_playError = 0;
if (_handlePlayout != NULL)
{
@ -1437,6 +1447,54 @@ bool AudioDeviceLinuxALSA::Playing() const
return (_playing);
}
bool AudioDeviceLinuxALSA::PlayoutWarning() const
{
rtc::CritScope lock(&_critSect);
return (_playWarning > 0);
}
bool AudioDeviceLinuxALSA::PlayoutError() const
{
rtc::CritScope lock(&_critSect);
return (_playError > 0);
}
bool AudioDeviceLinuxALSA::RecordingWarning() const
{
rtc::CritScope lock(&_critSect);
return (_recWarning > 0);
}
bool AudioDeviceLinuxALSA::RecordingError() const
{
rtc::CritScope lock(&_critSect);
return (_recError > 0);
}
void AudioDeviceLinuxALSA::ClearPlayoutWarning()
{
rtc::CritScope lock(&_critSect);
_playWarning = 0;
}
void AudioDeviceLinuxALSA::ClearPlayoutError()
{
rtc::CritScope lock(&_critSect);
_playError = 0;
}
void AudioDeviceLinuxALSA::ClearRecordingWarning()
{
rtc::CritScope lock(&_critSect);
_recWarning = 0;
}
void AudioDeviceLinuxALSA::ClearRecordingError()
{
rtc::CritScope lock(&_critSect);
_recError = 0;
}
// ============================================================================
// Private Methods
// ============================================================================