| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_BUFFER_CONVERTER | 5 #ifndef MEDIA_BASE_AUDIO_BUFFER_CONVERTER |
| 6 #define MEDIA_BASE_AUDIO_BUFFER_CONVERTER | 6 #define MEDIA_BASE_AUDIO_BUFFER_CONVERTER |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 int input_buffer_size_for_testing() const { | 45 int input_buffer_size_for_testing() const { |
| 46 return input_params_.frames_per_buffer(); | 46 return input_params_.frames_per_buffer(); |
| 47 } | 47 } |
| 48 int input_frames_left_for_testing() const { | 48 int input_frames_left_for_testing() const { |
| 49 return input_frames_; | 49 return input_frames_; |
| 50 } | 50 } |
| 51 | 51 |
| 52 private: | 52 private: |
| 53 // Callback to provide data to the AudioConverter | 53 // Callback to provide data to the AudioConverter |
| 54 virtual double ProvideInput(AudioBus* audio_bus, | 54 virtual double ProvideInput(AudioBus* audio_bus, |
| 55 base::TimeDelta buffer_delay) OVERRIDE; | 55 base::TimeDelta buffer_delay) override; |
| 56 | 56 |
| 57 // Reset the converter in response to a configuration change. | 57 // Reset the converter in response to a configuration change. |
| 58 void ResetConverter(const scoped_refptr<AudioBuffer>& input_buffer); | 58 void ResetConverter(const scoped_refptr<AudioBuffer>& input_buffer); |
| 59 | 59 |
| 60 // Perform conversion if we have enough data. | 60 // Perform conversion if we have enough data. |
| 61 void ConvertIfPossible(); | 61 void ConvertIfPossible(); |
| 62 | 62 |
| 63 // Flush remaining output | 63 // Flush remaining output |
| 64 void Flush(); | 64 void Flush(); |
| 65 | 65 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 // full AudioBuses in ProvideInput()? | 99 // full AudioBuses in ProvideInput()? |
| 100 bool is_flushing_; | 100 bool is_flushing_; |
| 101 | 101 |
| 102 // The AudioConverter which does the real work here. | 102 // The AudioConverter which does the real work here. |
| 103 scoped_ptr<AudioConverter> audio_converter_; | 103 scoped_ptr<AudioConverter> audio_converter_; |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 } // namespace media | 106 } // namespace media |
| 107 | 107 |
| 108 #endif // MEDIA_BASE_AUDIO_BUFFER_CONVERTER | 108 #endif // MEDIA_BASE_AUDIO_BUFFER_CONVERTER |
| OLD | NEW |