Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | |
| 3 * | |
| 4 * Use of this source code is governed by a BSD-style license | |
| 5 * that can be found in the LICENSE file in the root of the source | |
| 6 * tree. An additional intellectual property rights grant can be found | |
| 7 * in the file PATENTS. All contributing project authors may | |
| 8 * be found in the AUTHORS file in the root of the source tree. | |
| 9 */ | |
| 10 | |
| 11 #ifndef WEBRTC_AUDIO_AUDIO_STATE_H_ | |
| 12 #define WEBRTC_AUDIO_AUDIO_STATE_H_ | |
| 13 | |
| 14 #include "webrtc/audio_state.h" | |
| 15 #include "webrtc/audio/scoped_voe_interface.h" | |
| 16 #include "webrtc/base/constructormagic.h" | |
| 17 #include "webrtc/base/thread_checker.h" | |
| 18 #include "webrtc/voice_engine/include/voe_base.h" | |
| 19 | |
| 20 namespace webrtc { | |
| 21 namespace internal { | |
| 22 | |
| 23 class AudioState final : public webrtc::AudioState, | |
| 24 public webrtc::VoiceEngineObserver { | |
| 25 public: | |
| 26 explicit AudioState(const AudioState::Config& config); | |
| 27 ~AudioState() override; | |
| 28 | |
| 29 VoiceEngine* voice_engine(); | |
| 30 bool typing_noise_detected() const; | |
| 31 | |
| 32 private: | |
| 33 // webrtc::VoiceEngineObserver implementation. | |
| 34 void CallbackOnError(int channel_id, int err_code) override; | |
| 35 | |
| 36 rtc::ThreadChecker thread_checker_; | |
| 37 rtc::ThreadChecker process_thread_checker_; | |
| 38 const webrtc::AudioState::Config config_; | |
| 39 | |
| 40 // We hold one interface pointer to the VoE to make sure it is kept alive. | |
| 41 ScopedVoEInterface<VoEBase> voe_base_; | |
| 42 | |
| 43 // TODO(solenberg): I don't actually think it is worth adding a crit sect in | |
| 44 // 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.
| |
| 45 // rtc::CriticalSection crit_sect_; | |
| 46 bool typing_noise_detected_ = false; | |
| 47 | |
| 48 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioState); | |
| 49 }; | |
| 50 } // namespace internal | |
| 51 } // namespace webrtc | |
| 52 | |
| 53 #endif // WEBRTC_AUDIO_AUDIO_STATE_H_ | |
| OLD | NEW |