AudioDeviceImpl cleanup

(Making new attempt to land https://webrtc-review.googlesource.com/c/src/+/7601)

TBR=solenberg

Bug: NONE
Change-Id: I0651c47066dbc413b03c899b437d8ac18844a1e6
Reviewed-on: https://webrtc-review.googlesource.com/8380
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20246}
This commit is contained in:
henrika 2017-10-11 13:16:17 +02:00 committed by Commit Bot
parent c5bb00b6bf
commit 4af7366961
3 changed files with 306 additions and 768 deletions

View file

@ -68,6 +68,7 @@ AudioDeviceBuffer::AudioDeviceBuffer()
phase_ = 0.0;
LOG(WARNING) << "AUDIO_DEVICE_PLAYS_SINUS_TONE is defined!";
#endif
WebRtcSpl_Init();
playout_thread_checker_.DetachFromThread();
recording_thread_checker_.DetachFromThread();
}

File diff suppressed because it is too large Load diff

View file

@ -8,8 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef AUDIO_DEVICE_AUDIO_DEVICE_IMPL_H_
#define AUDIO_DEVICE_AUDIO_DEVICE_IMPL_H_
#ifndef MODULES_AUDIO_DEVICE_AUDIO_DEVICE_IMPL_H_
#define MODULES_AUDIO_DEVICE_AUDIO_DEVICE_IMPL_H_
#if defined(WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE)
@ -160,37 +160,33 @@ class AudioDeviceModuleImpl : public AudioDeviceModule {
int GetRecordAudioParameters(AudioParameters* params) const override;
#endif // WEBRTC_IOS
int32_t Id() { return _id; }
int32_t Id() const { return id_; }
#if defined(WEBRTC_ANDROID)
// Only use this acccessor for test purposes on Android.
AudioManager* GetAndroidAudioManagerForTest() {
return _audioManagerAndroid.get();
return audio_manager_android_.get();
}
#endif
AudioDeviceBuffer* GetAudioDeviceBuffer() { return &_audioDeviceBuffer; }
AudioDeviceBuffer* GetAudioDeviceBuffer() { return &audio_device_buffer_; }
private:
PlatformType Platform() const;
AudioLayer PlatformAudioLayer() const;
rtc::CriticalSection _critSect;
rtc::CriticalSection _critSectAudioCb;
AudioDeviceGeneric* _ptrAudioDevice;
AudioDeviceBuffer _audioDeviceBuffer;
const int32_t id_;
AudioLayer audio_layer_;
PlatformType platform_type_ = kPlatformNotSupported;
bool initialized_ = false;
#if defined(WEBRTC_ANDROID)
std::unique_ptr<AudioManager> _audioManagerAndroid;
// Should be declared first to ensure that it outlives other resources.
std::unique_ptr<AudioManager> audio_manager_android_;
#endif
int32_t _id;
AudioLayer _platformAudioLayer;
PlatformType _platformType;
bool _initialized;
mutable ErrorCode _lastError;
AudioDeviceBuffer audio_device_buffer_;
std::unique_ptr<AudioDeviceGeneric> audio_device_;
};
} // namespace webrtc
#endif // defined(WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE)
#endif // MODULES_INTERFACE_AUDIO_DEVICE_IMPL_H_
#endif // MODULES_AUDIO_DEVICE_AUDIO_DEVICE_IMPL_H_