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_BUS_H_ | 5 #ifndef MEDIA_BASE_AUDIO_BUS_H_ |
6 #define MEDIA_BASE_AUDIO_BUS_H_ | 6 #define MEDIA_BASE_AUDIO_BUS_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/aligned_memory.h" | 10 #include "base/memory/aligned_memory.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 94 |
95 int channels() const { return static_cast<int>(channel_data_.size()); } | 95 int channels() const { return static_cast<int>(channel_data_.size()); } |
96 int frames() const { return frames_; } | 96 int frames() const { return frames_; } |
97 void set_frames(int frames); | 97 void set_frames(int frames); |
98 | 98 |
99 // Helper method for zeroing out all channels of audio data. | 99 // Helper method for zeroing out all channels of audio data. |
100 void Zero(); | 100 void Zero(); |
101 void ZeroFrames(int frames); | 101 void ZeroFrames(int frames); |
102 void ZeroFramesPartial(int start_frame, int frames); | 102 void ZeroFramesPartial(int start_frame, int frames); |
103 | 103 |
| 104 // Checks if all frames are zero. |
| 105 bool AreFramesZero() const; |
| 106 |
104 // Scale internal channel values by |volume| >= 0. If an invalid value | 107 // Scale internal channel values by |volume| >= 0. If an invalid value |
105 // is provided, no adjustment is done. | 108 // is provided, no adjustment is done. |
106 void Scale(float volume); | 109 void Scale(float volume); |
107 | 110 |
108 // Swaps channels identified by |a| and |b|. The caller needs to make sure | 111 // Swaps channels identified by |a| and |b|. The caller needs to make sure |
109 // the channels are valid. | 112 // the channels are valid. |
110 void SwapChannels(int a, int b); | 113 void SwapChannels(int a, int b); |
111 | 114 |
112 virtual ~AudioBus(); | 115 virtual ~AudioBus(); |
113 | 116 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 | 151 |
149 AudioBusRefCounted(int channels, int frames); | 152 AudioBusRefCounted(int channels, int frames); |
150 ~AudioBusRefCounted() override; | 153 ~AudioBusRefCounted() override; |
151 | 154 |
152 DISALLOW_COPY_AND_ASSIGN(AudioBusRefCounted); | 155 DISALLOW_COPY_AND_ASSIGN(AudioBusRefCounted); |
153 }; | 156 }; |
154 | 157 |
155 } // namespace media | 158 } // namespace media |
156 | 159 |
157 #endif // MEDIA_BASE_AUDIO_BUS_H_ | 160 #endif // MEDIA_BASE_AUDIO_BUS_H_ |
OLD | NEW |