Chromium Code Reviews

Unified Diff: webrtc/audio/typing_noise_observer.h

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.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « webrtc/audio/audio_send_stream.cc ('k') | webrtc/audio/typing_noise_observer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/audio/typing_noise_observer.h
diff --git a/webrtc/audio/typing_noise_observer.h b/webrtc/audio/typing_noise_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..1809734e12312b932ccaddf67451fdff9868ec25
--- /dev/null
+++ b/webrtc/audio/typing_noise_observer.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef WEBRTC_AUDIO_TYPING_NOISE_OBSERVER_H_
+#define WEBRTC_AUDIO_TYPING_NOISE_OBSERVER_H_
+
+#include "webrtc/base/constructormagic.h"
+#include "webrtc/voice_engine/include/voe_base.h"
+
+namespace webrtc {
+namespace internal {
+
+// TODO(solenberg): Class comment + unit test.
+class TypingNoiseObserver final : public webrtc::VoiceEngineObserver {
+ public:
+ TypingNoiseObserver() {}
+
+ bool typing_noise_detected() const { return typing_noise_detected_; }
+
+ private:
+ // webrtc::VoiceEngineObserver implementation.
+ void CallbackOnError(int channel_id, int err_code) override;
+
+ // TODO(solenberg): I don't actually think it is worth adding a crit sect in
+ // this case, but reviewer may think differently...
+ // rtc::CriticalSection crit_sect_;
+ volatile bool typing_noise_detected_ = false;
+
+ RTC_DISALLOW_COPY_AND_ASSIGN(TypingNoiseObserver);
+};
+} // namespace internal
+} // namespace webrtc
+
+#endif // WEBRTC_AUDIO_TYPING_NOISE_OBSERVER_H_
« no previous file with comments | « webrtc/audio/audio_send_stream.cc ('k') | webrtc/audio/typing_noise_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine