OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_SHIFTER_H | 5 #ifndef MEDIA_BASE_AUDIO_SHIFTER_H |
6 #define MEDIA_BASE_AUDIO_SHIFTER_H | 6 #define MEDIA_BASE_AUDIO_SHIFTER_H |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <deque> | 10 #include <deque> |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // calculate playout_time would be now + audio pipeline delay. | 82 // calculate playout_time would be now + audio pipeline delay. |
83 void Pull(AudioBus* output, base::TimeTicks playout_time); | 83 void Pull(AudioBus* output, base::TimeTicks playout_time); |
84 | 84 |
85 private: | 85 private: |
86 void Zero(AudioBus* output); | 86 void Zero(AudioBus* output); |
87 void ResamplerCallback(int frame_delay, AudioBus* destination); | 87 void ResamplerCallback(int frame_delay, AudioBus* destination); |
88 | 88 |
89 struct AudioQueueEntry { | 89 struct AudioQueueEntry { |
90 AudioQueueEntry(base::TimeTicks target_playout_time_, | 90 AudioQueueEntry(base::TimeTicks target_playout_time_, |
91 scoped_ptr<AudioBus> audio_); | 91 scoped_ptr<AudioBus> audio_); |
| 92 AudioQueueEntry(const AudioQueueEntry& other); |
92 ~AudioQueueEntry(); | 93 ~AudioQueueEntry(); |
93 base::TimeTicks target_playout_time; | 94 base::TimeTicks target_playout_time; |
94 linked_ptr<AudioBus> audio; | 95 linked_ptr<AudioBus> audio; |
95 }; | 96 }; |
96 | 97 |
97 typedef std::deque<AudioQueueEntry> AudioShifterQueue; | 98 typedef std::deque<AudioQueueEntry> AudioShifterQueue; |
98 | 99 |
99 // Set from constructor. | 100 // Set from constructor. |
100 const base::TimeDelta max_buffer_size_; | 101 const base::TimeDelta max_buffer_size_; |
101 const base::TimeDelta clock_accuracy_; | 102 const base::TimeDelta clock_accuracy_; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 // Resampler. | 134 // Resampler. |
134 MultiChannelResampler resampler_; | 135 MultiChannelResampler resampler_; |
135 | 136 |
136 // Current resampler ratio. | 137 // Current resampler ratio. |
137 double current_ratio_; | 138 double current_ratio_; |
138 }; | 139 }; |
139 | 140 |
140 } // namespace media | 141 } // namespace media |
141 | 142 |
142 #endif // MEDIA_BASE_AUDIO_SHIFTER_H | 143 #endif // MEDIA_BASE_AUDIO_SHIFTER_H |
OLD | NEW |