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 <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // never be switched, as it may result in a discrepancy between the output | 47 // never be switched, as it may result in a discrepancy between the output |
48 // parameters of the new device and the output parameters with which the | 48 // parameters of the new device and the output parameters with which the |
49 // mixer was initialized. See crbug.com/506507 | 49 // mixer was initialized. See crbug.com/506507 |
50 OutputDevice* GetOutputDevice(); | 50 OutputDevice* GetOutputDevice(); |
51 | 51 |
52 private: | 52 private: |
53 // Maps input sample rate to the dedicated converter. | 53 // Maps input sample rate to the dedicated converter. |
54 typedef std::map<int, scoped_ptr<LoopbackAudioConverter>> AudioConvertersMap; | 54 typedef std::map<int, scoped_ptr<LoopbackAudioConverter>> AudioConvertersMap; |
55 | 55 |
56 // AudioRendererSink::RenderCallback implementation. | 56 // AudioRendererSink::RenderCallback implementation. |
57 int Render(AudioBus* audio_bus, | 57 int Render(AudioBus* audio_bus, int audio_delay_milliseconds) override; |
58 uint32_t audio_delay_milliseconds, | |
59 uint32_t frames_skipped) override; | |
60 void OnRenderError() override; | 58 void OnRenderError() override; |
61 | 59 |
62 bool is_master_sample_rate(int sample_rate) { | 60 bool is_master_sample_rate(int sample_rate) { |
63 return sample_rate == output_params_.sample_rate(); | 61 return sample_rate == output_params_.sample_rate(); |
64 } | 62 } |
65 | 63 |
66 // Output sink for this mixer. | 64 // Output sink for this mixer. |
67 scoped_refptr<AudioRendererSink> audio_sink_; | 65 scoped_refptr<AudioRendererSink> audio_sink_; |
68 | 66 |
69 // Output parameters for this mixer. | 67 // Output parameters for this mixer. |
(...skipping 20 matching lines...) Expand all Loading... |
90 base::TimeDelta pause_delay_; | 88 base::TimeDelta pause_delay_; |
91 base::TimeTicks last_play_time_; | 89 base::TimeTicks last_play_time_; |
92 bool playing_; | 90 bool playing_; |
93 | 91 |
94 DISALLOW_COPY_AND_ASSIGN(AudioRendererMixer); | 92 DISALLOW_COPY_AND_ASSIGN(AudioRendererMixer); |
95 }; | 93 }; |
96 | 94 |
97 } // namespace media | 95 } // namespace media |
98 | 96 |
99 #endif // MEDIA_BASE_AUDIO_RENDERER_MIXER_H_ | 97 #endif // MEDIA_BASE_AUDIO_RENDERER_MIXER_H_ |
OLD | NEW |