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

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

Issue 1453093002: Revert of Create rtc::AtomicInt POD struct. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 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
« no previous file with comments | « webrtc/base/refcount.h ('k') | webrtc/modules/audio_device/ios/audio_device_ios.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
11 #ifndef WEBRTC_MODULES_AUDIO_DEVICE_IOS_AUDIO_DEVICE_IOS_H_ 11 #ifndef WEBRTC_MODULES_AUDIO_DEVICE_IOS_AUDIO_DEVICE_IOS_H_
12 #define WEBRTC_MODULES_AUDIO_DEVICE_IOS_AUDIO_DEVICE_IOS_H_ 12 #define WEBRTC_MODULES_AUDIO_DEVICE_IOS_AUDIO_DEVICE_IOS_H_
13 13
14 #include <AudioUnit/AudioUnit.h> 14 #include <AudioUnit/AudioUnit.h>
15 15
16 #include "webrtc/base/atomicops.h"
17 #include "webrtc/base/scoped_ptr.h" 16 #include "webrtc/base/scoped_ptr.h"
18 #include "webrtc/base/thread_checker.h" 17 #include "webrtc/base/thread_checker.h"
19 #include "webrtc/modules/audio_device/audio_device_generic.h" 18 #include "webrtc/modules/audio_device/audio_device_generic.h"
20 19
21 namespace webrtc { 20 namespace webrtc {
22 21
23 class FineAudioBuffer; 22 class FineAudioBuffer;
24 23
25 // Implements full duplex 16-bit mono PCM audio support for iOS using a 24 // Implements full duplex 16-bit mono PCM audio support for iOS using a
26 // Voice-Processing (VP) I/O audio unit in Core Audio. The VP I/O audio unit 25 // Voice-Processing (VP) I/O audio unit in Core Audio. The VP I/O audio unit
(...skipping 20 matching lines...) Expand all
47 bool Initialized() const override { return initialized_; } 46 bool Initialized() const override { return initialized_; }
48 47
49 int32_t InitPlayout() override; 48 int32_t InitPlayout() override;
50 bool PlayoutIsInitialized() const override { return play_is_initialized_; } 49 bool PlayoutIsInitialized() const override { return play_is_initialized_; }
51 50
52 int32_t InitRecording() override; 51 int32_t InitRecording() override;
53 bool RecordingIsInitialized() const override { return rec_is_initialized_; } 52 bool RecordingIsInitialized() const override { return rec_is_initialized_; }
54 53
55 int32_t StartPlayout() override; 54 int32_t StartPlayout() override;
56 int32_t StopPlayout() override; 55 int32_t StopPlayout() override;
57 bool Playing() const override { 56 bool Playing() const override { return playing_; }
58 return rtc::AtomicInt::AcquireLoad(&playing_) != 0;
59 }
60 57
61 int32_t StartRecording() override; 58 int32_t StartRecording() override;
62 int32_t StopRecording() override; 59 int32_t StopRecording() override;
63 bool Recording() const override { 60 bool Recording() const override { return recording_; }
64 return rtc::AtomicInt::AcquireLoad(&recording_) != 0;
65 }
66 61
67 int32_t SetLoudspeakerStatus(bool enable) override; 62 int32_t SetLoudspeakerStatus(bool enable) override;
68 int32_t GetLoudspeakerStatus(bool& enabled) const override; 63 int32_t GetLoudspeakerStatus(bool& enabled) const override;
69 64
70 // These methods returns hard-coded delay values and not dynamic delay 65 // These methods returns hard-coded delay values and not dynamic delay
71 // estimates. The reason is that iOS supports a built-in AEC and the WebRTC 66 // estimates. The reason is that iOS supports a built-in AEC and the WebRTC
72 // AEC will always be disabled in the Libjingle layer to avoid running two 67 // AEC will always be disabled in the Libjingle layer to avoid running two
73 // AEC implementations at the same time. And, it saves resources to avoid 68 // AEC implementations at the same time. And, it saves resources to avoid
74 // updating these delay values continuously. 69 // updating these delay values continuously.
75 // TODO(henrika): it would be possible to mark these two methods as not 70 // TODO(henrika): it would be possible to mark these two methods as not
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 261
267 // Provides a mechanism for encapsulating one or more buffers of audio data. 262 // Provides a mechanism for encapsulating one or more buffers of audio data.
268 // Only used on the recording side. 263 // Only used on the recording side.
269 AudioBufferList audio_record_buffer_list_; 264 AudioBufferList audio_record_buffer_list_;
270 265
271 // Temporary storage for recorded data. AudioUnitRender() renders into this 266 // Temporary storage for recorded data. AudioUnitRender() renders into this
272 // array as soon as a frame of the desired buffer size has been recorded. 267 // array as soon as a frame of the desired buffer size has been recorded.
273 rtc::scoped_ptr<SInt8[]> record_audio_buffer_; 268 rtc::scoped_ptr<SInt8[]> record_audio_buffer_;
274 269
275 // Set to 1 when recording is active and 0 otherwise. 270 // Set to 1 when recording is active and 0 otherwise.
276 rtc::AtomicInt recording_; 271 volatile int recording_;
277 272
278 // Set to 1 when playout is active and 0 otherwise. 273 // Set to 1 when playout is active and 0 otherwise.
279 rtc::AtomicInt playing_; 274 volatile int playing_;
280 275
281 // Set to true after successful call to Init(), false otherwise. 276 // Set to true after successful call to Init(), false otherwise.
282 bool initialized_; 277 bool initialized_;
283 278
284 // Set to true after successful call to InitRecording(), false otherwise. 279 // Set to true after successful call to InitRecording(), false otherwise.
285 bool rec_is_initialized_; 280 bool rec_is_initialized_;
286 281
287 // Set to true after successful call to InitPlayout(), false otherwise. 282 // Set to true after successful call to InitPlayout(), false otherwise.
288 bool play_is_initialized_; 283 bool play_is_initialized_;
289 284
290 // Audio interruption observer instance. 285 // Audio interruption observer instance.
291 void* audio_interruption_observer_; 286 void* audio_interruption_observer_;
292 void* route_change_observer_; 287 void* route_change_observer_;
293 288
294 // Contains the audio data format specification for a stream of audio. 289 // Contains the audio data format specification for a stream of audio.
295 AudioStreamBasicDescription application_format_; 290 AudioStreamBasicDescription application_format_;
296 }; 291 };
297 292
298 } // namespace webrtc 293 } // namespace webrtc
299 294
300 #endif // WEBRTC_MODULES_AUDIO_DEVICE_IOS_AUDIO_DEVICE_IOS_H_ 295 #endif // WEBRTC_MODULES_AUDIO_DEVICE_IOS_AUDIO_DEVICE_IOS_H_
OLDNEW
« no previous file with comments | « webrtc/base/refcount.h ('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