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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
85 int dest_start_frame, | 85 int dest_start_frame, |
86 AudioBus* dest) const; | 86 AudioBus* dest) const; |
87 | 87 |
88 // Returns a raw pointer to the requested channel. Pointer is guaranteed to | 88 // Returns a raw pointer to the requested channel. Pointer is guaranteed to |
89 // have a 16-byte alignment. Warning: Do not rely on having sane (i.e. not | 89 // have a 16-byte alignment. Warning: Do not rely on having sane (i.e. not |
90 // inf, nan, or between [-1.0, 1.0]) values in the channel data. | 90 // inf, nan, or between [-1.0, 1.0]) values in the channel data. |
91 float* channel(int channel) { return channel_data_[channel]; } | 91 float* channel(int channel) { return channel_data_[channel]; } |
92 const float* channel(int channel) const { return channel_data_[channel]; } | 92 const float* channel(int channel) const { return channel_data_[channel]; } |
93 void SetChannelData(int channel, float* data); | 93 void SetChannelData(int channel, float* data); |
94 | 94 |
95 // Returns an array of pointers to each channel. | |
96 float** channel_data() { return &channel_data_[0]; } | |
tommi (sloooow) - chröme
2014/08/06 13:45:56
I would like to get Dale to look at this (and perh
| |
97 const float* const* channel_data() const { return &channel_data_[0]; } | |
98 | |
95 int channels() const { return static_cast<int>(channel_data_.size()); } | 99 int channels() const { return static_cast<int>(channel_data_.size()); } |
96 int frames() const { return frames_; } | 100 int frames() const { return frames_; } |
97 void set_frames(int frames); | 101 void set_frames(int frames); |
98 | 102 |
99 // Helper method for zeroing out all channels of audio data. | 103 // Helper method for zeroing out all channels of audio data. |
100 void Zero(); | 104 void Zero(); |
101 void ZeroFrames(int frames); | 105 void ZeroFrames(int frames); |
102 void ZeroFramesPartial(int start_frame, int frames); | 106 void ZeroFramesPartial(int start_frame, int frames); |
103 | 107 |
104 // Scale internal channel values by |volume| >= 0. If an invalid value | 108 // Scale internal channel values by |volume| >= 0. If an invalid value |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
148 | 152 |
149 AudioBusRefCounted(int channels, int frames); | 153 AudioBusRefCounted(int channels, int frames); |
150 virtual ~AudioBusRefCounted(); | 154 virtual ~AudioBusRefCounted(); |
151 | 155 |
152 DISALLOW_COPY_AND_ASSIGN(AudioBusRefCounted); | 156 DISALLOW_COPY_AND_ASSIGN(AudioBusRefCounted); |
153 }; | 157 }; |
154 | 158 |
155 } // namespace media | 159 } // namespace media |
156 | 160 |
157 #endif // MEDIA_BASE_AUDIO_BUS_H_ | 161 #endif // MEDIA_BASE_AUDIO_BUS_H_ |
OLD | NEW |