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

Unified Diff: webrtc/audio/audio_send_stream.cc

Issue 1403363003: Move VoiceEngineObserver into AudioSendStream so that we detect typing noises and return properly i… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: more includes Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/audio/audio_send_stream.h ('k') | webrtc/audio/typing_noise_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/audio/audio_send_stream.cc
diff --git a/webrtc/audio/audio_send_stream.cc b/webrtc/audio/audio_send_stream.cc
index ccfdca546dcf5c9699b85f7745b21c4c2ade671f..08174f5e6bc339133d228a557056398575af4346 100644
--- a/webrtc/audio/audio_send_stream.cc
+++ b/webrtc/audio/audio_send_stream.cc
@@ -13,6 +13,7 @@
#include <string>
#include "webrtc/audio/conversion.h"
+#include "webrtc/audio/scoped_voe_interface.h"
#include "webrtc/base/checks.h"
#include "webrtc/base/logging.h"
#include "webrtc/voice_engine/include/voe_audio_processing.h"
@@ -48,19 +49,23 @@ std::string AudioSendStream::Config::ToString() const {
}
namespace internal {
+
+VoiceEngines AudioSendStream::gVoiceEngines;
+
AudioSendStream::AudioSendStream(const webrtc::AudioSendStream::Config& config,
VoiceEngine* voice_engine)
: config_(config),
- voice_engine_(voice_engine),
- voe_base_(voice_engine) {
+ voice_engine_(voice_engine) {
LOG(LS_INFO) << "AudioSendStream: " << config_.ToString();
RTC_DCHECK_NE(config.voe_channel_id, -1);
RTC_DCHECK(voice_engine_);
+ gVoiceEngines.RegisterVoiceEngine(voice_engine);
}
AudioSendStream::~AudioSendStream() {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
LOG(LS_INFO) << "~AudioSendStream: " << config_.ToString();
+ gVoiceEngines.DeregisterVoiceEngine(voice_engine_);
}
webrtc::AudioSendStream::Stats AudioSendStream::GetStats() const {
@@ -148,8 +153,8 @@ webrtc::AudioSendStream::Stats AudioSendStream::GetStats() const {
}
}
- // TODO(solenberg): Collect typing noise warnings here too!
- // bool typing_noise_detected = typing_noise_detected_;
+ stats.typing_noise_detected =
+ gVoiceEngines.GetTypingNoiseDetected(voice_engine_);
return stats;
}
« no previous file with comments | « webrtc/audio/audio_send_stream.h ('k') | webrtc/audio/typing_noise_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698