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

Side by Side Diff: webrtc/audio/voice_engines.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, 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/audio/typing_noise_observer.cc ('k') | webrtc/audio/voice_engines.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #ifndef WEBRTC_AUDIO_VOICE_ENGINES_H_
12 #define WEBRTC_AUDIO_VOICE_ENGINES_H_
13
14 #include <map>
15
16 #include "webrtc/base/basictypes.h"
17 #include "webrtc/base/constructormagic.h"
18 #include "webrtc/base/thread_checker.h"
19
20 namespace webrtc {
21
22 class VoEBase;
23 class VoiceEngine;
24
25 namespace internal {
26
27 class TypingNoiseObserver;
28
29 // TODO(solenberg): Class comment + unit test.
30 class VoiceEngines final {
31 public:
32 VoiceEngines();
33 ~VoiceEngines();
34 void RegisterVoiceEngine(VoiceEngine* voice_engine);
35 void DeregisterVoiceEngine(VoiceEngine* voice_engine);
36 bool GetTypingNoiseDetected(VoiceEngine* voice_engine) const;
37 private:
38 struct State {
39 // Need to keep a ref count so we know when to deregister the observer.
40 int32_t ref_count_ = 0;
41 // We hold one interface pointer to the VoE to make sure it is kept alive.
42 VoEBase* voe_base_ = nullptr;
43 TypingNoiseObserver* observer_ = nullptr;
44 };
45
46 rtc::ThreadChecker thread_checker_;
47 std::map<VoiceEngine*, State> voice_engines_;
48
49 RTC_DISALLOW_COPY_AND_ASSIGN(VoiceEngines);
50 };
51 } // namespace internal
52 } // namespace webrtc
53
54 #endif // WEBRTC_AUDIO_VOICE_ENGINES_H_
OLDNEW
« no previous file with comments | « webrtc/audio/typing_noise_observer.cc ('k') | webrtc/audio/voice_engines.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698