| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef REMOTING_PROTOCOL_WEBRTC_AUDIO_MODULE_H_ | 5 #ifndef REMOTING_PROTOCOL_WEBRTC_AUDIO_MODULE_H_ |
| 6 #define REMOTING_PROTOCOL_WEBRTC_AUDIO_MODULE_H_ | 6 #define REMOTING_PROTOCOL_WEBRTC_AUDIO_MODULE_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/synchronization/lock.h" | 9 #include "base/synchronization/lock.h" |
| 10 #include "base/timer/timer.h" | 10 #include "base/timer/timer.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 int32_t GetLoudspeakerStatus(bool* enabled) const override; | 128 int32_t GetLoudspeakerStatus(bool* enabled) const override; |
| 129 bool BuiltInAECIsAvailable() const override; | 129 bool BuiltInAECIsAvailable() const override; |
| 130 bool BuiltInAGCIsAvailable() const override; | 130 bool BuiltInAGCIsAvailable() const override; |
| 131 bool BuiltInNSIsAvailable() const override; | 131 bool BuiltInNSIsAvailable() const override; |
| 132 int32_t EnableBuiltInAEC(bool enable) override; | 132 int32_t EnableBuiltInAEC(bool enable) override; |
| 133 int32_t EnableBuiltInAGC(bool enable) override; | 133 int32_t EnableBuiltInAGC(bool enable) override; |
| 134 int32_t EnableBuiltInNS(bool enable) override; | 134 int32_t EnableBuiltInNS(bool enable) override; |
| 135 | 135 |
| 136 // Only supported on iOS. | 136 // Only supported on iOS. |
| 137 #if defined(WEBRTC_IOS) | 137 #if defined(WEBRTC_IOS) |
| 138 int GetPlayoutAudioParameters(AudioParameters* params) const override; | 138 int GetPlayoutAudioParameters(webrtc::AudioParameters* params) const override; |
| 139 int GetRecordAudioParameters(AudioParameters* params) const override; | 139 int GetRecordAudioParameters(webrtc::AudioParameters* params) const override; |
| 140 #endif // WEBRTC_IOS | 140 #endif // WEBRTC_IOS |
| 141 | 141 |
| 142 private: | 142 private: |
| 143 void StartPlayoutOnAudioThread(); | 143 void StartPlayoutOnAudioThread(); |
| 144 void StopPlayoutOnAudioThread(); | 144 void StopPlayoutOnAudioThread(); |
| 145 | 145 |
| 146 void PollFromSource(); | 146 void PollFromSource(); |
| 147 | 147 |
| 148 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner_; | 148 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner_; |
| 149 | 149 |
| 150 // |lock_| must be locked when accessing |initialized_|, |playing_| and | 150 // |lock_| must be locked when accessing |initialized_|, |playing_| and |
| 151 // |audio_transport_|. | 151 // |audio_transport_|. |
| 152 mutable base::Lock lock_; | 152 mutable base::Lock lock_; |
| 153 | 153 |
| 154 bool initialized_ = false; | 154 bool initialized_ = false; |
| 155 bool playing_ = false; | 155 bool playing_ = false; |
| 156 webrtc::AudioTransport* audio_transport_ = nullptr; | 156 webrtc::AudioTransport* audio_transport_ = nullptr; |
| 157 | 157 |
| 158 // Timer running on the |audio_task_runner_| that polls audio from | 158 // Timer running on the |audio_task_runner_| that polls audio from |
| 159 // |audio_transport_|. | 159 // |audio_transport_|. |
| 160 base::RepeatingTimer poll_timer_; | 160 base::RepeatingTimer poll_timer_; |
| 161 }; | 161 }; |
| 162 | 162 |
| 163 } // namespace protocol | 163 } // namespace protocol |
| 164 } // namespace remoting | 164 } // namespace remoting |
| 165 | 165 |
| 166 #endif // REMOTING_PROTOCOL_WEBRTC_AUDIO_MODULE_H_ | 166 #endif // REMOTING_PROTOCOL_WEBRTC_AUDIO_MODULE_H_ |
| OLD | NEW |