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_AUDIO_PUMP_H_ | 5 #ifndef REMOTING_PROTOCOL_AUDIO_PUMP_H_ |
6 #define REMOTING_PROTOCOL_AUDIO_PUMP_H_ | 6 #define REMOTING_PROTOCOL_AUDIO_PUMP_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 class AudioEncoder; | 22 class AudioEncoder; |
23 class AudioPacket; | 23 class AudioPacket; |
24 | 24 |
25 namespace protocol { | 25 namespace protocol { |
26 | 26 |
27 class AudioStub; | 27 class AudioStub; |
28 class AudioSource; | 28 class AudioSource; |
29 | 29 |
30 // AudioPump is responsible for fetching audio data from the AudioCapturer | 30 // AudioPump is responsible for fetching audio data from the AudioCapturer |
31 // and encoding it before passing it to the AudioStub for delivery to the | 31 // and encoding it before passing it to the AudioStub for delivery to the |
32 // client. Audio is captured and encoded on the audio thread and then passed to | 32 // client. Audio data will be downmixed to stereo if needed. Audio is captured |
33 // AudioStub on the network thread. | 33 // and encoded on the audio thread and then passed to AudioStub on the network |
| 34 // thread. |
34 class AudioPump : public AudioStream { | 35 class AudioPump : public AudioStream { |
35 public: | 36 public: |
36 // The caller must ensure that the |audio_stub| is not destroyed until the | 37 // The caller must ensure that the |audio_stub| is not destroyed until the |
37 // pump is destroyed. | 38 // pump is destroyed. |
38 AudioPump(scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner, | 39 AudioPump(scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner, |
39 std::unique_ptr<AudioSource> audio_source, | 40 std::unique_ptr<AudioSource> audio_source, |
40 std::unique_ptr<AudioEncoder> audio_encoder, | 41 std::unique_ptr<AudioEncoder> audio_encoder, |
41 AudioStub* audio_stub); | 42 AudioStub* audio_stub); |
42 ~AudioPump() override; | 43 ~AudioPump() override; |
43 | 44 |
(...skipping 18 matching lines...) Expand all Loading... |
62 | 63 |
63 base::WeakPtrFactory<AudioPump> weak_factory_; | 64 base::WeakPtrFactory<AudioPump> weak_factory_; |
64 | 65 |
65 DISALLOW_COPY_AND_ASSIGN(AudioPump); | 66 DISALLOW_COPY_AND_ASSIGN(AudioPump); |
66 }; | 67 }; |
67 | 68 |
68 } // namespace protocol | 69 } // namespace protocol |
69 } // namespace remoting | 70 } // namespace remoting |
70 | 71 |
71 #endif // REMOTING_PROTOCOL_AUDIO_PUMP_H_ | 72 #endif // REMOTING_PROTOCOL_AUDIO_PUMP_H_ |
OLD | NEW |