Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(321)

Side by Side Diff: trunk/src/media/base/audio_bus.h

Issue 335343004: Revert 277794 "Modifies AudioInputCallback::OnData and use media..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « trunk/src/media/audio/win/wavein_input_win.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 void ZeroFramesPartial(int start_frame, int frames); 101 void ZeroFramesPartial(int start_frame, int frames);
102 102
103 // Scale internal channel values by |volume| >= 0. If an invalid value 103 // Scale internal channel values by |volume| >= 0. If an invalid value
104 // is provided, no adjustment is done. 104 // is provided, no adjustment is done.
105 void Scale(float volume); 105 void Scale(float volume);
106 106
107 // Swaps channels identified by |a| and |b|. The caller needs to make sure 107 // Swaps channels identified by |a| and |b|. The caller needs to make sure
108 // the channels are valid. 108 // the channels are valid.
109 void SwapChannels(int a, int b); 109 void SwapChannels(int a, int b);
110 110
111 virtual ~AudioBus(); 111 private:
112 friend struct base::DefaultDeleter<AudioBus>;
113 ~AudioBus();
112 114
113 private:
114 AudioBus(int channels, int frames); 115 AudioBus(int channels, int frames);
115 AudioBus(int channels, int frames, float* data); 116 AudioBus(int channels, int frames, float* data);
116 AudioBus(int frames, const std::vector<float*>& channel_data); 117 AudioBus(int frames, const std::vector<float*>& channel_data);
117 explicit AudioBus(int channels); 118 explicit AudioBus(int channels);
118 119
119 // Helper method for building |channel_data_| from a block of memory. |data| 120 // Helper method for building |channel_data_| from a block of memory. |data|
120 // must be at least BlockSize() bytes in size. 121 // must be at least BlockSize() bytes in size.
121 void BuildChannelData(int channels, int aligned_frame, float* data); 122 void BuildChannelData(int channels, int aligned_frame, float* data);
122 123
123 // Contiguous block of channel memory. 124 // Contiguous block of channel memory.
124 scoped_ptr<float, base::AlignedFreeDeleter> data_; 125 scoped_ptr<float, base::AlignedFreeDeleter> data_;
125 126
126 std::vector<float*> channel_data_; 127 std::vector<float*> channel_data_;
127 int frames_; 128 int frames_;
128 129
129 // Protect SetChannelData() and set_frames() for use by CreateWrapper(). 130 // Protect SetChannelData() and set_frames() for use by CreateWrapper().
130 bool can_set_channel_data_; 131 bool can_set_channel_data_;
131 132
132 DISALLOW_COPY_AND_ASSIGN(AudioBus); 133 DISALLOW_COPY_AND_ASSIGN(AudioBus);
133 }; 134 };
134 135
135 } // namespace media 136 } // namespace media
136 137
137 #endif // MEDIA_BASE_AUDIO_BUS_H_ 138 #endif // MEDIA_BASE_AUDIO_BUS_H_
OLDNEW
« no previous file with comments | « trunk/src/media/audio/win/wavein_input_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698