Github-Arduino/libraries/ideawu_RTC/multimedia/webrtc/modules/audio_device/audio_device_impl.cc
int32_t AudioDeviceModuleImpl::Process()
{

    _lastProcessTime = AudioDeviceUtility::GetTimeInMS();

    // kPlayoutWarning
    if (_ptrAudioDevice->PlayoutWarning())
    {
        CriticalSectionScoped lock(&_critSectEventCb);
        if (_ptrCbAudioDeviceObserver)
        {
            WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, "=> OnWarningIsReported(kPlayoutWarning)");
            _ptrCbAudioDeviceObserver->OnWarningIsReported(AudioDeviceObserver::kPlayoutWarning);
        }
        _ptrAudioDevice->ClearPlayoutWarning();
    }

    // kPlayoutError
    if (_ptrAudioDevice->PlayoutError())
    {
        CriticalSectionScoped lock(&_critSectEventCb);
        if (_ptrCbAudioDeviceObserver)
        {
            WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, "=> OnErrorIsReported(kPlayoutError)");
            _ptrCbAudioDeviceObserver->OnErrorIsReported(AudioDeviceObserver::kPlayoutError);
        }
        _ptrAudioDevice->ClearPlayoutError();
    }

    // kRecordingWarning
    if (_ptrAudioDevice->RecordingWarning())
    {
        CriticalSectionScoped lock(&_critSectEventCb);
        if (_ptrCbAudioDeviceObserver)
        {
            WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, "=> OnWarningIsReported(kRecordingWarning)");
            _ptrCbAudioDeviceObserver->OnWarningIsReported(AudioDeviceObserver::kRecordingWarning);
        }
        _ptrAudioDevice->ClearRecordingWarning();
    }

    // kRecordingError
    if (_ptrAudioDevice->RecordingError())
    {
        CriticalSectionScoped lock(&_critSectEventCb);
        if (_ptrCbAudioDeviceObserver)
        {
            WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, "=> OnErrorIsReported(kRecordingError)");
            _ptrCbAudioDeviceObserver->OnErrorIsReported(AudioDeviceObserver::kRecordingError);
        }
        _ptrAudioDevice->ClearRecordingError();
    }

    return 0;
}
// ----------------------------------------------------------------------------
//  Module::Process
//
//  Check for posted error and warning reports. Generate callbacks if
//  new reports exists.
// ----------------------------------------------------------------------------
:Process
Check for posted error and warning reports. Generate callbacks if
new reports exists.
: Process Check for posted error and warning reports . Generate callbacks if new reports exists .
int32_t AudioDeviceModuleImpl::Process()
{
    _lastProcessTime = AudioDeviceUtility::GetTimeInMS();
    if (_ptrAudioDevice->PlayoutWarning())
    {
        CriticalSectionScoped lock(&_critSectEventCb);
        if (_ptrCbAudioDeviceObserver)
        {
            WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, "=> OnWarningIsReported(kPlayoutWarning)");
            _ptrCbAudioDeviceObserver->OnWarningIsReported(AudioDeviceObserver::kPlayoutWarning);
        }
        _ptrAudioDevice->ClearPlayoutWarning();
    }
    if (_ptrAudioDevice->PlayoutError())
    {
        CriticalSectionScoped lock(&_critSectEventCb);
        if (_ptrCbAudioDeviceObserver)
        {
            WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, "=> OnErrorIsReported(kPlayoutError)");
            _ptrCbAudioDeviceObserver->OnErrorIsReported(AudioDeviceObserver::kPlayoutError);
        }
        _ptrAudioDevice->ClearPlayoutError();
    }
    if (_ptrAudioDevice->RecordingWarning())
    {
        CriticalSectionScoped lock(&_critSectEventCb);
        if (_ptrCbAudioDeviceObserver)
        {
            WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, "=> OnWarningIsReported(kRecordingWarning)");
            _ptrCbAudioDeviceObserver->OnWarningIsReported(AudioDeviceObserver::kRecordingWarning);
        }
        _ptrAudioDevice->ClearRecordingWarning();
    }
    if (_ptrAudioDevice->RecordingError())
    {
        CriticalSectionScoped lock(&_critSectEventCb);
        if (_ptrCbAudioDeviceObserver)
        {
            WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, "=> OnErrorIsReported(kRecordingError)");
            _ptrCbAudioDeviceObserver->OnErrorIsReported(AudioDeviceObserver::kRecordingError);
        }
        _ptrAudioDevice->ClearRecordingError();
    }
    return 0;
}
int32_t AudioDeviceModuleImpl :: Process ( ) { _lastProcessTime = AudioDeviceUtility :: GetTimeInMS ( ) ; if ( _ptrAudioDevice -> PlayoutWarning ( ) ) { CriticalSectionScoped lock ( & _critSectEventCb ) ; if ( _ptrCbAudioDeviceObserver ) { WEBRTC_TRACE ( kTraceWarning , kTraceAudioDevice , _id , " " ) ; _ptrCbAudioDeviceObserver -> OnWarningIsReported ( AudioDeviceObserver :: kPlayoutWarning ) ; } _ptrAudioDevice -> ClearPlayoutWarning ( ) ; } if ( _ptrAudioDevice -> PlayoutError ( ) ) { CriticalSectionScoped lock ( & _critSectEventCb ) ; if ( _ptrCbAudioDeviceObserver ) { WEBRTC_TRACE ( kTraceError , kTraceAudioDevice , _id , " " ) ; _ptrCbAudioDeviceObserver -> OnErrorIsReported ( AudioDeviceObserver :: kPlayoutError ) ; } _ptrAudioDevice -> ClearPlayoutError ( ) ; } if ( _ptrAudioDevice -> RecordingWarning ( ) ) { CriticalSectionScoped lock ( & _critSectEventCb ) ; if ( _ptrCbAudioDeviceObserver ) { WEBRTC_TRACE ( kTraceWarning , kTraceAudioDevice , _id , " " ) ; _ptrCbAudioDeviceObserver -> OnWarningIsReported ( AudioDeviceObserver :: kRecordingWarning ) ; } _ptrAudioDevice -> ClearRecordingWarning ( ) ; } if ( _ptrAudioDevice -> RecordingError ( ) ) { CriticalSectionScoped lock ( & _critSectEventCb ) ; if ( _ptrCbAudioDeviceObserver ) { WEBRTC_TRACE ( kTraceError , kTraceAudioDevice , _id , " " ) ; _ptrCbAudioDeviceObserver -> OnErrorIsReported ( AudioDeviceObserver :: kRecordingError ) ; } _ptrAudioDevice -> ClearRecordingError ( ) ; } return 0 ; }
Module::Process
Check for posted error and warning reports.
Module :: Process Check for posted error and warning reports .
// kPlayoutWarning // kPlayoutError // kRecordingWarning // kRecordingError