OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_AUDIO_AUDIO_SEND_STREAM_H_ | 11 #ifndef WEBRTC_AUDIO_AUDIO_SEND_STREAM_H_ |
12 #define WEBRTC_AUDIO_AUDIO_SEND_STREAM_H_ | 12 #define WEBRTC_AUDIO_AUDIO_SEND_STREAM_H_ |
13 | 13 |
14 #include "webrtc/audio_send_stream.h" | 14 #include "webrtc/audio_send_stream.h" |
15 #include "webrtc/audio/scoped_voe_interface.h" | 15 #include "webrtc/audio/voice_engines.h" |
16 #include "webrtc/base/thread_checker.h" | 16 #include "webrtc/base/thread_checker.h" |
17 #include "webrtc/voice_engine/include/voe_base.h" | |
18 | 17 |
19 namespace webrtc { | 18 namespace webrtc { |
20 | 19 |
21 class VoiceEngine; | 20 class VoiceEngine; |
22 | 21 |
23 namespace internal { | 22 namespace internal { |
24 | 23 |
25 class AudioSendStream final : public webrtc::AudioSendStream { | 24 class AudioSendStream final : public webrtc::AudioSendStream { |
26 public: | 25 public: |
27 AudioSendStream(const webrtc::AudioSendStream::Config& config, | 26 AudioSendStream(const webrtc::AudioSendStream::Config& config, |
28 VoiceEngine* voice_engine); | 27 VoiceEngine* voice_engine); |
29 ~AudioSendStream() override; | 28 ~AudioSendStream() override; |
30 | 29 |
31 // webrtc::SendStream implementation. | 30 // webrtc::SendStream implementation. |
32 void Start() override; | 31 void Start() override; |
33 void Stop() override; | 32 void Stop() override; |
34 void SignalNetworkState(NetworkState state) override; | 33 void SignalNetworkState(NetworkState state) override; |
35 bool DeliverRtcp(const uint8_t* packet, size_t length) override; | 34 bool DeliverRtcp(const uint8_t* packet, size_t length) override; |
36 | 35 |
37 // webrtc::AudioSendStream implementation. | 36 // webrtc::AudioSendStream implementation. |
38 webrtc::AudioSendStream::Stats GetStats() const override; | 37 webrtc::AudioSendStream::Stats GetStats() const override; |
39 | 38 |
40 const webrtc::AudioSendStream::Config& config() const; | 39 const webrtc::AudioSendStream::Config& config() const; |
41 | 40 |
42 private: | 41 private: |
43 rtc::ThreadChecker thread_checker_; | 42 rtc::ThreadChecker thread_checker_; |
44 const webrtc::AudioSendStream::Config config_; | 43 const webrtc::AudioSendStream::Config config_; |
45 VoiceEngine* voice_engine_; | 44 VoiceEngine* voice_engine_; |
46 // We hold one interface pointer to the VoE to make sure it is kept alive. | 45 |
47 ScopedVoEInterface<VoEBase> voe_base_; | 46 static VoiceEngines gVoiceEngines; |
48 | 47 |
49 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioSendStream); | 48 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioSendStream); |
50 }; | 49 }; |
51 } // namespace internal | 50 } // namespace internal |
52 } // namespace webrtc | 51 } // namespace webrtc |
53 | 52 |
54 #endif // WEBRTC_AUDIO_AUDIO_SEND_STREAM_H_ | 53 #endif // WEBRTC_AUDIO_AUDIO_SEND_STREAM_H_ |
OLD | NEW |