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" |
11 #include "third_party/webrtc/modules/audio_device/include/audio_device.h" | 11 #include "third_party/webrtc/modules/audio_device/include/audio_device.h" |
12 | 12 |
13 namespace base { | 13 namespace base { |
14 class SingleThreadTaskRunner; | 14 class SingleThreadTaskRunner; |
15 } // namespace base | 15 } // namespace base |
16 | 16 |
17 namespace remoting { | 17 namespace remoting { |
18 namespace protocol { | 18 namespace protocol { |
19 | 19 |
20 class AudioStub; | |
21 | |
22 // Audio module passed to WebRTC. It doesn't access actual audio devices, but it | 20 // Audio module passed to WebRTC. It doesn't access actual audio devices, but it |
23 // provides all functionality we need to ensure that audio streaming works | 21 // provides all functionality we need to ensure that audio streaming works |
24 // properly in WebRTC. Particularly it's responsible for calling AudioTransport | 22 // properly in WebRTC. Particularly it's responsible for calling AudioTransport |
25 // on regular intervals when playback is active. This ensures that all incoming | 23 // on regular intervals when playback is active. This ensures that all incoming |
26 // audio data is processed and passed to webrtc::AudioTrackSinkInterface | 24 // audio data is processed and passed to webrtc::AudioTrackSinkInterface |
27 // connected to the audio track. | 25 // connected to the audio track. |
28 class WebrtcAudioModule : public webrtc::AudioDeviceModule { | 26 class WebrtcAudioModule : public webrtc::AudioDeviceModule { |
29 public: | 27 public: |
30 WebrtcAudioModule(); | 28 WebrtcAudioModule(); |
31 ~WebrtcAudioModule() override; | 29 ~WebrtcAudioModule() override; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 | 155 |
158 // Timer running on the |audio_task_runner_| that polls audio from | 156 // Timer running on the |audio_task_runner_| that polls audio from |
159 // |audio_transport_|. | 157 // |audio_transport_|. |
160 base::RepeatingTimer poll_timer_; | 158 base::RepeatingTimer poll_timer_; |
161 }; | 159 }; |
162 | 160 |
163 } // namespace protocol | 161 } // namespace protocol |
164 } // namespace remoting | 162 } // namespace remoting |
165 | 163 |
166 #endif // REMOTING_PROTOCOL_WEBRTC_AUDIO_MODULE_H_ | 164 #endif // REMOTING_PROTOCOL_WEBRTC_AUDIO_MODULE_H_ |
OLD | NEW |