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_SPLICER_H_ | 5 #ifndef MEDIA_BASE_AUDIO_SPLICER_H_ |
6 #define MEDIA_BASE_AUDIO_SPLICER_H_ | 6 #define MEDIA_BASE_AUDIO_SPLICER_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 scoped_ptr<AudioBus> ExtractCrossfadeFromPreSplice( | 78 scoped_ptr<AudioBus> ExtractCrossfadeFromPreSplice( |
79 scoped_refptr<AudioBuffer>* crossfade_buffer); | 79 scoped_refptr<AudioBuffer>* crossfade_buffer); |
80 | 80 |
81 // Crossfades |pre_splice_bus->frames()| frames from | 81 // Crossfades |pre_splice_bus->frames()| frames from |
82 // |post_splice_sanitizer_| | 82 // |post_splice_sanitizer_| |
83 // with those from |pre_splice_bus|. Adds the crossfaded buffer to | 83 // with those from |pre_splice_bus|. Adds the crossfaded buffer to |
84 // |output_sanitizer_| along with all buffers in |post_splice_sanitizer_|. | 84 // |output_sanitizer_| along with all buffers in |post_splice_sanitizer_|. |
85 // | 85 // |
86 // |post_splice_sanitizer_| will be empty after this operation. | 86 // |post_splice_sanitizer_| will be empty after this operation. |
87 void CrossfadePostSplice(scoped_ptr<AudioBus> pre_splice_bus, | 87 void CrossfadePostSplice(scoped_ptr<AudioBus> pre_splice_bus, |
88 scoped_refptr<AudioBuffer> crossfade_buffer); | 88 const scoped_refptr<AudioBuffer>& crossfade_buffer); |
89 | 89 |
90 // Reset the splice and splice end timestamps. | 90 // Reset the splice and splice end timestamps. |
91 void reset_splice_timestamps() { | 91 void reset_splice_timestamps() { |
92 splice_timestamp_ = max_splice_end_timestamp_ = kNoTimestamp(); | 92 splice_timestamp_ = max_splice_end_timestamp_ = kNoTimestamp(); |
93 } | 93 } |
94 | 94 |
95 const base::TimeDelta max_crossfade_duration_; | 95 const base::TimeDelta max_crossfade_duration_; |
96 base::TimeDelta splice_timestamp_; | 96 base::TimeDelta splice_timestamp_; |
97 base::TimeDelta max_splice_end_timestamp_; | 97 base::TimeDelta max_splice_end_timestamp_; |
98 | 98 |
(...skipping 16 matching lines...) Expand all Loading... |
115 // Whether all buffers which should go into |pre_splice_sanitizer_| have been | 115 // Whether all buffers which should go into |pre_splice_sanitizer_| have been |
116 // received. If true, buffers should now be put in |post_splice_sanitizer_|. | 116 // received. If true, buffers should now be put in |post_splice_sanitizer_|. |
117 bool have_all_pre_splice_buffers_; | 117 bool have_all_pre_splice_buffers_; |
118 | 118 |
119 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioSplicer); | 119 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioSplicer); |
120 }; | 120 }; |
121 | 121 |
122 } // namespace media | 122 } // namespace media |
123 | 123 |
124 #endif | 124 #endif |
OLD | NEW |