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

Side by Side Diff: webrtc/modules/audio_device/ios/audio_device_ios.h

Issue 2894873002: Improved audio buffer handling for iOS (Closed)
Patch Set: rebased Created 3 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
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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 // Example: native buffer size can be 128 audio frames at 16kHz sample rate. 253 // Example: native buffer size can be 128 audio frames at 16kHz sample rate.
254 // WebRTC will provide 480 audio frames per 10ms but iOS asks for 128 254 // WebRTC will provide 480 audio frames per 10ms but iOS asks for 128
255 // in each callback (one every 8ms). This class can then ask for 128 and the 255 // in each callback (one every 8ms). This class can then ask for 128 and the
256 // FineAudioBuffer will ask WebRTC for new data only when needed and also 256 // FineAudioBuffer will ask WebRTC for new data only when needed and also
257 // cache non-utilized audio between callbacks. On the recording side, iOS 257 // cache non-utilized audio between callbacks. On the recording side, iOS
258 // can provide audio data frames of size 128 and these are accumulated until 258 // can provide audio data frames of size 128 and these are accumulated until
259 // enough data to supply one 10ms call exists. This 10ms chunk is then sent 259 // enough data to supply one 10ms call exists. This 10ms chunk is then sent
260 // to WebRTC and the remaining part is stored. 260 // to WebRTC and the remaining part is stored.
261 std::unique_ptr<FineAudioBuffer> fine_audio_buffer_; 261 std::unique_ptr<FineAudioBuffer> fine_audio_buffer_;
262 262
263 // Extra audio buffer to be used by the playout side for rendering audio.
264 // The buffer size is given by FineAudioBuffer::RequiredBufferSizeBytes().
265 std::unique_ptr<int8_t[]> playout_audio_buffer_;
266
267 // Provides a mechanism for encapsulating one or more buffers of audio data. 263 // Provides a mechanism for encapsulating one or more buffers of audio data.
268 // Only used on the recording side. 264 // Only used on the recording side.
269 AudioBufferList audio_record_buffer_list_; 265 AudioBufferList audio_record_buffer_list_;
270 266
271 // Temporary storage for recorded data. AudioUnitRender() renders into this 267 // Temporary storage for recorded data. AudioUnitRender() renders into this
272 // array as soon as a frame of the desired buffer size has been recorded. 268 // array as soon as a frame of the desired buffer size has been recorded.
273 std::unique_ptr<int8_t[]> record_audio_buffer_; 269 std::unique_ptr<int8_t[]> record_audio_buffer_;
274 270
275 // Set to 1 when recording is active and 0 otherwise. 271 // Set to 1 when recording is active and 0 otherwise.
276 volatile int recording_; 272 volatile int recording_;
(...skipping 17 matching lines...) Expand all
294 // Set to true if we've activated the audio session. 290 // Set to true if we've activated the audio session.
295 bool has_configured_session_; 291 bool has_configured_session_;
296 292
297 // Exposes private members for testing purposes only. 293 // Exposes private members for testing purposes only.
298 FRIEND_TEST_ALL_PREFIXES(AudioDeviceTest, testInterruptedAudioSession); 294 FRIEND_TEST_ALL_PREFIXES(AudioDeviceTest, testInterruptedAudioSession);
299 }; 295 };
300 296
301 } // namespace webrtc 297 } // namespace webrtc
302 298
303 #endif // WEBRTC_MODULES_AUDIO_DEVICE_IOS_AUDIO_DEVICE_IOS_H_ 299 #endif // WEBRTC_MODULES_AUDIO_DEVICE_IOS_AUDIO_DEVICE_IOS_H_
OLDNEW
« no previous file with comments | « webrtc/modules/audio_device/fine_audio_buffer_unittest.cc ('k') | webrtc/modules/audio_device/ios/audio_device_ios.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698