Chromium Code Reviews| Index: webrtc/audio/audio_state.h |
| diff --git a/webrtc/audio/audio_state.h b/webrtc/audio/audio_state.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..fe43983ef9196bf1604c4f7e9c1ac89c24d3ae8f |
| --- /dev/null |
| +++ b/webrtc/audio/audio_state.h |
| @@ -0,0 +1,53 @@ |
| +/* |
| + * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
| + * |
| + * Use of this source code is governed by a BSD-style license |
| + * that can be found in the LICENSE file in the root of the source |
| + * tree. An additional intellectual property rights grant can be found |
| + * in the file PATENTS. All contributing project authors may |
| + * be found in the AUTHORS file in the root of the source tree. |
| + */ |
| + |
| +#ifndef WEBRTC_AUDIO_AUDIO_STATE_H_ |
| +#define WEBRTC_AUDIO_AUDIO_STATE_H_ |
| + |
| +#include "webrtc/audio_state.h" |
| +#include "webrtc/audio/scoped_voe_interface.h" |
| +#include "webrtc/base/constructormagic.h" |
| +#include "webrtc/base/thread_checker.h" |
| +#include "webrtc/voice_engine/include/voe_base.h" |
| + |
| +namespace webrtc { |
| +namespace internal { |
| + |
| +class AudioState final : public webrtc::AudioState, |
| + public webrtc::VoiceEngineObserver { |
| + public: |
| + explicit AudioState(const AudioState::Config& config); |
| + ~AudioState() override; |
| + |
| + VoiceEngine* voice_engine(); |
| + bool typing_noise_detected() const; |
| + |
| + private: |
| + // webrtc::VoiceEngineObserver implementation. |
| + void CallbackOnError(int channel_id, int err_code) override; |
| + |
| + rtc::ThreadChecker thread_checker_; |
| + rtc::ThreadChecker process_thread_checker_; |
| + const webrtc::AudioState::Config config_; |
| + |
| + // We hold one interface pointer to the VoE to make sure it is kept alive. |
| + ScopedVoEInterface<VoEBase> voe_base_; |
| + |
| + // TODO(solenberg): I don't actually think it is worth adding a crit sect in |
| + // this case, but reviewer may think differently... |
|
tommi
2015/10/29 16:28:50
are we reading/writing from/to this variable from
the sun
2015/10/30 12:19:01
Done.
|
| + // rtc::CriticalSection crit_sect_; |
| + bool typing_noise_detected_ = false; |
| + |
| + RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioState); |
| +}; |
| +} // namespace internal |
| +} // namespace webrtc |
| + |
| +#endif // WEBRTC_AUDIO_AUDIO_STATE_H_ |