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

Unified Diff: webrtc/audio/audio_state.cc

Issue 2454373002: Added an empty AudioTransportProxy to AudioState. (Closed)
Patch Set: No heap transport, WillOnce, comparison with constants. 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/audio/audio_state.cc
diff --git a/webrtc/audio/audio_state.cc b/webrtc/audio/audio_state.cc
index e63f97af2d4fb9fd3123f37532f0553382715984..f452e2196694e722f414a1f7fe16f56cb25074e4 100644
--- a/webrtc/audio/audio_state.cc
+++ b/webrtc/audio/audio_state.cc
@@ -13,16 +13,26 @@
#include "webrtc/base/atomicops.h"
#include "webrtc/base/checks.h"
#include "webrtc/base/logging.h"
+#include "webrtc/modules/audio_device/include/audio_device.h"
#include "webrtc/voice_engine/include/voe_errors.h"
namespace webrtc {
namespace internal {
AudioState::AudioState(const AudioState::Config& config)
- : config_(config), voe_base_(config.voice_engine) {
+ : config_(config),
+ voe_base_(config.voice_engine),
+ audio_transport_proxy_(voe_base_->audio_transport(),
+ voe_base_->audio_processing(),
+ config_.audio_mixer) {
process_thread_checker_.DetachFromThread();
// Only one AudioState should be created per VoiceEngine.
RTC_CHECK(voe_base_->RegisterVoiceEngineObserver(*this) != -1);
+
+ auto* const device = audio_device();
+ RTC_DCHECK(device);
+ device->RegisterAudioCallback(nullptr);
the sun 2016/11/09 09:41:52 Is this really necessary? In AudioDeviceBuffer::Re
aleloi 2016/11/09 16:37:00 It's needed in Chrome. WebRtcAudioDeviceImpl::Regi
+ device->RegisterAudioCallback(&audio_transport_proxy_);
}
AudioState::~AudioState() {
@@ -35,6 +45,15 @@ VoiceEngine* AudioState::voice_engine() {
return config_.voice_engine;
}
+AudioDeviceModule* AudioState::audio_device() {
the sun 2016/11/09 09:41:52 Only used in one place. Please make the call direc
aleloi 2016/11/09 16:37:00 Done.
+ RTC_DCHECK(thread_checker_.CalledOnValidThread());
+ return voe_base_->audio_device_module();
+}
+
+rtc::scoped_refptr<AudioMixer> AudioState::mixer() const {
+ return config_.audio_mixer;
+}
+
bool AudioState::typing_noise_detected() const {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
rtc::CritScope lock(&crit_sect_);

Powered by Google App Engine
This is Rietveld 408576698