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 #include "media/base/audio_shifter.h" | 5 #include "media/base/audio_shifter.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 base::TimeTicks previous_; | 75 base::TimeTicks previous_; |
76 }; | 76 }; |
77 | 77 |
78 AudioShifter::AudioQueueEntry::AudioQueueEntry( | 78 AudioShifter::AudioQueueEntry::AudioQueueEntry( |
79 base::TimeTicks target_playout_time_, | 79 base::TimeTicks target_playout_time_, |
80 scoped_ptr<AudioBus> audio_) : | 80 scoped_ptr<AudioBus> audio_) : |
81 target_playout_time(target_playout_time_), | 81 target_playout_time(target_playout_time_), |
82 audio(audio_.release()) { | 82 audio(audio_.release()) { |
83 } | 83 } |
84 | 84 |
| 85 AudioShifter::AudioQueueEntry::AudioQueueEntry(const AudioQueueEntry& other) = |
| 86 default; |
| 87 |
85 AudioShifter::AudioQueueEntry::~AudioQueueEntry() {} | 88 AudioShifter::AudioQueueEntry::~AudioQueueEntry() {} |
86 | 89 |
87 AudioShifter::AudioShifter(base::TimeDelta max_buffer_size, | 90 AudioShifter::AudioShifter(base::TimeDelta max_buffer_size, |
88 base::TimeDelta clock_accuracy, | 91 base::TimeDelta clock_accuracy, |
89 base::TimeDelta adjustment_time, | 92 base::TimeDelta adjustment_time, |
90 int rate, | 93 int rate, |
91 int channels) | 94 int channels) |
92 : max_buffer_size_(max_buffer_size), | 95 : max_buffer_size_(max_buffer_size), |
93 clock_accuracy_(clock_accuracy), | 96 clock_accuracy_(clock_accuracy), |
94 adjustment_time_(adjustment_time), | 97 adjustment_time_(adjustment_time), |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 } | 276 } |
274 | 277 |
275 void AudioShifter::Zero(AudioBus* output) { | 278 void AudioShifter::Zero(AudioBus* output) { |
276 output->Zero(); | 279 output->Zero(); |
277 running_ = false; | 280 running_ = false; |
278 previous_playout_time_ = base::TimeTicks(); | 281 previous_playout_time_ = base::TimeTicks(); |
279 bias_ = base::TimeDelta(); | 282 bias_ = base::TimeDelta(); |
280 } | 283 } |
281 | 284 |
282 } // namespace media | 285 } // namespace media |
OLD | NEW |