| 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(AudioBus* audio_bus, | 67 int Render(base::TimeDelta delay, |
| 68 uint32_t frames_delayed, | 68 base::TimeTicks delay_timestamp, |
| 69 uint32_t frames_skipped) override; | 69 int prior_frames_skipped, |
| 70 AudioBus* audio_bus) override; |
| 70 void OnRenderError() override; | 71 void OnRenderError() override; |
| 71 | 72 |
| 72 bool is_master_sample_rate(int sample_rate) { | 73 bool is_master_sample_rate(int sample_rate) { |
| 73 return sample_rate == output_params_.sample_rate(); | 74 return sample_rate == output_params_.sample_rate(); |
| 74 } | 75 } |
| 75 | 76 |
| 76 // Output parameters for this mixer. | 77 // Output parameters for this mixer. |
| 77 const AudioParameters output_params_; | 78 const AudioParameters output_params_; |
| 78 | 79 |
| 79 // Output sink for this mixer. | 80 // Output sink for this mixer. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 104 // Tracks the maximum number of simultaneous mixer inputs and logs it into | 105 // Tracks the maximum number of simultaneous mixer inputs and logs it into |
| 105 // UMA histogram upon the destruction. | 106 // UMA histogram upon the destruction. |
| 106 std::unique_ptr<UMAMaxValueTracker> input_count_tracker_; | 107 std::unique_ptr<UMAMaxValueTracker> input_count_tracker_; |
| 107 | 108 |
| 108 DISALLOW_COPY_AND_ASSIGN(AudioRendererMixer); | 109 DISALLOW_COPY_AND_ASSIGN(AudioRendererMixer); |
| 109 }; | 110 }; |
| 110 | 111 |
| 111 } // namespace media | 112 } // namespace media |
| 112 | 113 |
| 113 #endif // MEDIA_BASE_AUDIO_RENDERER_MIXER_H_ | 114 #endif // MEDIA_BASE_AUDIO_RENDERER_MIXER_H_ |
| OLD | NEW |