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

Side by Side Diff: webrtc/audio/audio_state.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: that's all folks! (incl rebase), or is it? 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/audio_send_stream_unittest.cc ('k') | webrtc/audio/audio_state.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_AUDIO_STATE_H_
12 #define WEBRTC_AUDIO_AUDIO_STATE_H_
13
14 #include "webrtc/audio_state.h"
15 #include "webrtc/audio/scoped_voe_interface.h"
16 #include "webrtc/base/constructormagic.h"
17 #include "webrtc/base/criticalsection.h"
18 #include "webrtc/base/thread_checker.h"
19 #include "webrtc/voice_engine/include/voe_base.h"
20
21 namespace webrtc {
22 namespace internal {
23
24 class AudioState final : public webrtc::AudioState,
25 public webrtc::VoiceEngineObserver {
26 public:
27 explicit AudioState(const AudioState::Config& config);
28 ~AudioState() override;
29
30 VoiceEngine* voice_engine();
31 bool typing_noise_detected() const;
32
33 private:
34 // rtc::RefCountInterface implementation.
35 int AddRef() const override;
36 int Release() const override;
37
38 // webrtc::VoiceEngineObserver implementation.
39 void CallbackOnError(int channel_id, int err_code) override;
40
41 rtc::ThreadChecker thread_checker_;
42 rtc::ThreadChecker process_thread_checker_;
43 const webrtc::AudioState::Config config_;
44
45 // We hold one interface pointer to the VoE to make sure it is kept alive.
46 ScopedVoEInterface<VoEBase> voe_base_;
47
48 // The critical section isn't strictly needed in this case, but xSAN bots may
49 // trigger on unprotected cross-thread access.
50 mutable rtc::CriticalSection crit_sect_;
51 bool typing_noise_detected_ GUARDED_BY(crit_sect_) = false;
52
53 // Reference count; implementation copied from rtc::RefCountedObject.
54 mutable volatile int ref_count_ = 0;
55
56 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioState);
57 };
58 } // namespace internal
59 } // namespace webrtc
60
61 #endif // WEBRTC_AUDIO_AUDIO_STATE_H_
OLDNEW
« no previous file with comments | « webrtc/audio/audio_send_stream_unittest.cc ('k') | webrtc/audio/audio_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698