OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 MEDIA_BASE_AUDIO_RENDERER_MIXER_H_ | 5 #ifndef MEDIA_BASE_AUDIO_RENDERER_MIXER_H_ |
6 #define MEDIA_BASE_AUDIO_RENDERER_MIXER_H_ | 6 #define MEDIA_BASE_AUDIO_RENDERER_MIXER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 28 matching lines...) Expand all Loading... | |
39 // Since errors may occur even when no inputs are playing, an error callback | 39 // Since errors may occur even when no inputs are playing, an error callback |
40 // must be registered separately from adding a mixer input. The same callback | 40 // must be registered separately from adding a mixer input. The same callback |
41 // must be given to both the functions. | 41 // must be given to both the functions. |
42 void AddErrorCallback(const base::Closure& error_cb); | 42 void AddErrorCallback(const base::Closure& error_cb); |
43 void RemoveErrorCallback(const base::Closure& error_cb); | 43 void RemoveErrorCallback(const base::Closure& error_cb); |
44 | 44 |
45 void set_pause_delay_for_testing(base::TimeDelta delay) { | 45 void set_pause_delay_for_testing(base::TimeDelta delay) { |
46 pause_delay_ = delay; | 46 pause_delay_ = delay; |
47 } | 47 } |
48 | 48 |
49 // TODO(guidou): remove this method. The output device of a mixer should | 49 OutputDeviceInfo GetOutputDeviceInfo(); |
miu
2016/03/24 21:32:02
Consider adding bug 506507 to the BUG= line in the
o1ka
2016/03/29 13:39:54
Done.
| |
50 // never be switched, as it may result in a discrepancy between the output | |
51 // parameters of the new device and the output parameters with which the | |
52 // mixer was initialized. See crbug.com/506507 | |
53 OutputDevice* GetOutputDevice(); | |
54 | 50 |
55 private: | 51 private: |
56 // Maps input sample rate to the dedicated converter. | 52 // Maps input sample rate to the dedicated converter. |
57 typedef std::map<int, scoped_ptr<LoopbackAudioConverter>> AudioConvertersMap; | 53 typedef std::map<int, scoped_ptr<LoopbackAudioConverter>> AudioConvertersMap; |
58 | 54 |
59 // AudioRendererSink::RenderCallback implementation. | 55 // AudioRendererSink::RenderCallback implementation. |
60 int Render(AudioBus* audio_bus, | 56 int Render(AudioBus* audio_bus, |
61 uint32_t frames_delayed, | 57 uint32_t frames_delayed, |
62 uint32_t frames_skipped) override; | 58 uint32_t frames_skipped) override; |
63 void OnRenderError() override; | 59 void OnRenderError() override; |
(...skipping 29 matching lines...) Expand all Loading... | |
93 base::TimeDelta pause_delay_; | 89 base::TimeDelta pause_delay_; |
94 base::TimeTicks last_play_time_; | 90 base::TimeTicks last_play_time_; |
95 bool playing_; | 91 bool playing_; |
96 | 92 |
97 DISALLOW_COPY_AND_ASSIGN(AudioRendererMixer); | 93 DISALLOW_COPY_AND_ASSIGN(AudioRendererMixer); |
98 }; | 94 }; |
99 | 95 |
100 } // namespace media | 96 } // namespace media |
101 | 97 |
102 #endif // MEDIA_BASE_AUDIO_RENDERER_MIXER_H_ | 98 #endif // MEDIA_BASE_AUDIO_RENDERER_MIXER_H_ |
OLD | NEW |