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

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

Issue 1195633003: Add a silent audio sink to consume WebAudio data on silence detection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ifdef android only constants Created 5 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
« no previous file with comments | « content/renderer/media/renderer_webaudiodevice_impl.cc ('k') | media/base/audio_bus.cc » ('j') | 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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_
OLDNEW
« no previous file with comments | « content/renderer/media/renderer_webaudiodevice_impl.cc ('k') | media/base/audio_bus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698