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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 const AudioParameters& GetOutputParamsForTesting() { return output_params_; }; | 57 const AudioParameters& GetOutputParamsForTesting() { return output_params_; }; |
58 | 58 |
59 private: | 59 private: |
60 class UMAMaxValueTracker; | 60 class UMAMaxValueTracker; |
61 | 61 |
62 // Maps input sample rate to the dedicated converter. | 62 // Maps input sample rate to the dedicated converter. |
63 using AudioConvertersMap = | 63 using AudioConvertersMap = |
64 std::map<int, std::unique_ptr<LoopbackAudioConverter>>; | 64 std::map<int, std::unique_ptr<LoopbackAudioConverter>>; |
65 | 65 |
66 // AudioRendererSink::RenderCallback implementation. | 66 // AudioRendererSink::RenderCallback implementation. |
67 int Render(base::TimeDelta delay, | 67 int Render(AudioBus* audio_bus, |
68 base::TimeTicks delay_timestamp, | 68 uint32_t frames_delayed, |
69 int prior_frames_skipped, | 69 uint32_t frames_skipped) override; |
70 AudioBus* audio_bus) override; | |
71 void OnRenderError() override; | 70 void OnRenderError() override; |
72 | 71 |
73 bool is_master_sample_rate(int sample_rate) { | 72 bool is_master_sample_rate(int sample_rate) { |
74 return sample_rate == output_params_.sample_rate(); | 73 return sample_rate == output_params_.sample_rate(); |
75 } | 74 } |
76 | 75 |
77 // Output parameters for this mixer. | 76 // Output parameters for this mixer. |
78 const AudioParameters output_params_; | 77 const AudioParameters output_params_; |
79 | 78 |
80 // Output sink for this mixer. | 79 // Output sink for this mixer. |
(...skipping 24 matching lines...) Expand all Loading... |
105 // Tracks the maximum number of simultaneous mixer inputs and logs it into | 104 // Tracks the maximum number of simultaneous mixer inputs and logs it into |
106 // UMA histogram upon the destruction. | 105 // UMA histogram upon the destruction. |
107 std::unique_ptr<UMAMaxValueTracker> input_count_tracker_; | 106 std::unique_ptr<UMAMaxValueTracker> input_count_tracker_; |
108 | 107 |
109 DISALLOW_COPY_AND_ASSIGN(AudioRendererMixer); | 108 DISALLOW_COPY_AND_ASSIGN(AudioRendererMixer); |
110 }; | 109 }; |
111 | 110 |
112 } // namespace media | 111 } // namespace media |
113 | 112 |
114 #endif // MEDIA_BASE_AUDIO_RENDERER_MIXER_H_ | 113 #endif // MEDIA_BASE_AUDIO_RENDERER_MIXER_H_ |
OLD | NEW |