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

Side by Side Diff: webrtc/modules/audio_device/audio_device_buffer.h

Issue 2482053003: AudioDeviceBuffer now uses 16-bit buffers (Closed)
Patch Set: Created 4 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 size_t rec_channels_; 147 size_t rec_channels_;
148 size_t play_channels_; 148 size_t play_channels_;
149 149
150 // Keeps track of if playout/recording are active or not. A combination 150 // Keeps track of if playout/recording are active or not. A combination
151 // of these states are used to determine when to start and stop the timer. 151 // of these states are used to determine when to start and stop the timer.
152 // Only used on the creating thread and not used to control any media flow. 152 // Only used on the creating thread and not used to control any media flow.
153 bool playing_ ACCESS_ON(main_thread_checker_); 153 bool playing_ ACCESS_ON(main_thread_checker_);
154 bool recording_ ACCESS_ON(main_thread_checker_); 154 bool recording_ ACCESS_ON(main_thread_checker_);
155 155
156 // Buffer used for audio samples to be played out. Size can be changed 156 // Buffer used for audio samples to be played out. Size can be changed
157 // dynamically. 157 // dynamically. Each sample (or audio sample frame) has a size given by
158 rtc::Buffer play_buffer_ ACCESS_ON(playout_thread_checker_); 158 // #channels * sizeof(uint16_t) bytes since WebRTC uses 16-bit PCM audio.
159 rtc::BufferT<uint16_t> play_buffer_ ACCESS_ON(playout_thread_checker_);
159 160
160 // Byte buffer used for recorded audio samples. Size can be changed 161 // Byte buffer used for recorded audio samples. Size can be changed
161 // dynamically. 162 // dynamically.
162 rtc::Buffer rec_buffer_ ACCESS_ON(recording_thread_checker_); 163 rtc::BufferT<uint16_t> rec_buffer_ ACCESS_ON(recording_thread_checker_);
163 164
164 // AGC parameters. 165 // AGC parameters.
165 #if !defined(WEBRTC_WIN) 166 #if !defined(WEBRTC_WIN)
166 uint32_t current_mic_level_ ACCESS_ON(recording_thread_checker_); 167 uint32_t current_mic_level_ ACCESS_ON(recording_thread_checker_);
167 #else 168 #else
168 // Windows uses a dedicated thread for volume APIs. 169 // Windows uses a dedicated thread for volume APIs.
169 uint32_t current_mic_level_; 170 uint32_t current_mic_level_;
170 #endif 171 #endif
171 uint32_t new_mic_level_ ACCESS_ON(recording_thread_checker_); 172 uint32_t new_mic_level_ ACCESS_ON(recording_thread_checker_);
172 173
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 uint64_t rec_start_time_ ACCESS_ON(main_thread_checker_); 232 uint64_t rec_start_time_ ACCESS_ON(main_thread_checker_);
232 233
233 // Set to true at construction and modified to false as soon as one audio- 234 // Set to true at construction and modified to false as soon as one audio-
234 // level estimate larger than zero is detected. 235 // level estimate larger than zero is detected.
235 bool only_silence_recorded_; 236 bool only_silence_recorded_;
236 }; 237 };
237 238
238 } // namespace webrtc 239 } // namespace webrtc
239 240
240 #endif // WEBRTC_MODULES_AUDIO_DEVICE_AUDIO_DEVICE_BUFFER_H_ 241 #endif // WEBRTC_MODULES_AUDIO_DEVICE_AUDIO_DEVICE_BUFFER_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/audio_device/audio_device_buffer.cc » ('j') | webrtc/modules/audio_device/audio_device_buffer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698