OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2004 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 |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "webrtc/base/thread_checker.h" | 23 #include "webrtc/base/thread_checker.h" |
24 #include "webrtc/call/audio_state.h" | 24 #include "webrtc/call/audio_state.h" |
25 #include "webrtc/call/call.h" | 25 #include "webrtc/call/call.h" |
26 #include "webrtc/config.h" | 26 #include "webrtc/config.h" |
27 #include "webrtc/media/base/rtputils.h" | 27 #include "webrtc/media/base/rtputils.h" |
28 #include "webrtc/media/engine/webrtccommon.h" | 28 #include "webrtc/media/engine/webrtccommon.h" |
29 #include "webrtc/media/engine/webrtcvoe.h" | 29 #include "webrtc/media/engine/webrtcvoe.h" |
30 #include "webrtc/modules/audio_processing/include/audio_processing.h" | 30 #include "webrtc/modules/audio_processing/include/audio_processing.h" |
31 #include "webrtc/pc/channel.h" | 31 #include "webrtc/pc/channel.h" |
32 | 32 |
| 33 namespace webrtc { |
| 34 namespace voe { |
| 35 class TransmitMixer; |
| 36 } // namespace voe |
| 37 } // namespace webrtc |
| 38 |
33 namespace cricket { | 39 namespace cricket { |
34 | 40 |
35 class AudioDeviceModule; | 41 class AudioDeviceModule; |
36 class AudioMixer; | 42 class AudioMixer; |
37 class AudioSource; | 43 class AudioSource; |
38 class VoEWrapper; | 44 class VoEWrapper; |
39 class WebRtcVoiceMediaChannel; | 45 class WebRtcVoiceMediaChannel; |
40 | 46 |
41 // WebRtcVoiceEngine is a class to be used with CompositeMediaEngine. | 47 // WebRtcVoiceEngine is a class to be used with CompositeMediaEngine. |
42 // It uses the WebRtc VoiceEngine library for audio handling. | 48 // It uses the WebRtc VoiceEngine library for audio handling. |
(...skipping 25 matching lines...) Expand all Loading... |
68 const std::vector<AudioCodec>& send_codecs() const; | 74 const std::vector<AudioCodec>& send_codecs() const; |
69 const std::vector<AudioCodec>& recv_codecs() const; | 75 const std::vector<AudioCodec>& recv_codecs() const; |
70 RtpCapabilities GetCapabilities() const; | 76 RtpCapabilities GetCapabilities() const; |
71 | 77 |
72 // For tracking WebRtc channels. Needed because we have to pause them | 78 // For tracking WebRtc channels. Needed because we have to pause them |
73 // all when switching devices. | 79 // all when switching devices. |
74 // May only be called by WebRtcVoiceMediaChannel. | 80 // May only be called by WebRtcVoiceMediaChannel. |
75 void RegisterChannel(WebRtcVoiceMediaChannel* channel); | 81 void RegisterChannel(WebRtcVoiceMediaChannel* channel); |
76 void UnregisterChannel(WebRtcVoiceMediaChannel* channel); | 82 void UnregisterChannel(WebRtcVoiceMediaChannel* channel); |
77 | 83 |
78 // Called by WebRtcVoiceMediaChannel to set a gain offset from | |
79 // the default AGC target level. | |
80 bool AdjustAgcLevel(int delta); | |
81 | |
82 VoEWrapper* voe() { return voe_wrapper_.get(); } | 84 VoEWrapper* voe() { return voe_wrapper_.get(); } |
83 int GetLastEngineError(); | 85 int GetLastEngineError(); |
84 | 86 |
85 // Starts AEC dump using an existing file. A maximum file size in bytes can be | 87 // Starts AEC dump using an existing file. A maximum file size in bytes can be |
86 // specified. When the maximum file size is reached, logging is stopped and | 88 // specified. When the maximum file size is reached, logging is stopped and |
87 // the file is closed. If max_size_bytes is set to <= 0, no limit will be | 89 // the file is closed. If max_size_bytes is set to <= 0, no limit will be |
88 // used. | 90 // used. |
89 bool StartAecDump(rtc::PlatformFile file, int64_t max_size_bytes); | 91 bool StartAecDump(rtc::PlatformFile file, int64_t max_size_bytes); |
90 | 92 |
91 // Stops AEC dump. | 93 // Stops AEC dump. |
(...skipping 10 matching lines...) Expand all Loading... |
102 bool ApplyOptions(const AudioOptions& options); | 104 bool ApplyOptions(const AudioOptions& options); |
103 void SetDefaultDevices(); | 105 void SetDefaultDevices(); |
104 | 106 |
105 // webrtc::TraceCallback: | 107 // webrtc::TraceCallback: |
106 void Print(webrtc::TraceLevel level, const char* trace, int length) override; | 108 void Print(webrtc::TraceLevel level, const char* trace, int length) override; |
107 | 109 |
108 void StartAecDump(const std::string& filename); | 110 void StartAecDump(const std::string& filename); |
109 int CreateVoEChannel(); | 111 int CreateVoEChannel(); |
110 webrtc::AudioDeviceModule* adm(); | 112 webrtc::AudioDeviceModule* adm(); |
111 webrtc::AudioProcessing* apm(); | 113 webrtc::AudioProcessing* apm(); |
| 114 webrtc::voe::TransmitMixer* transmit_mixer(); |
112 | 115 |
113 AudioCodecs CollectRecvCodecs() const; | 116 AudioCodecs CollectRecvCodecs() const; |
114 | 117 |
115 rtc::ThreadChecker signal_thread_checker_; | 118 rtc::ThreadChecker signal_thread_checker_; |
116 rtc::ThreadChecker worker_thread_checker_; | 119 rtc::ThreadChecker worker_thread_checker_; |
117 | 120 |
118 // The audio device manager. | 121 // The audio device manager. |
119 rtc::scoped_refptr<webrtc::AudioDeviceModule> adm_; | 122 rtc::scoped_refptr<webrtc::AudioDeviceModule> adm_; |
120 rtc::scoped_refptr<webrtc::AudioDecoderFactory> decoder_factory_; | 123 rtc::scoped_refptr<webrtc::AudioDecoderFactory> decoder_factory_; |
121 // Reference to the APM, owned by VoE. | 124 // Reference to the APM, owned by VoE. |
122 webrtc::AudioProcessing* apm_ = nullptr; | 125 webrtc::AudioProcessing* apm_ = nullptr; |
| 126 // Reference to the TransmitMixer, owned by VoE. |
| 127 webrtc::voe::TransmitMixer* transmit_mixer_ = nullptr; |
123 // The primary instance of WebRtc VoiceEngine. | 128 // The primary instance of WebRtc VoiceEngine. |
124 std::unique_ptr<VoEWrapper> voe_wrapper_; | 129 std::unique_ptr<VoEWrapper> voe_wrapper_; |
125 rtc::scoped_refptr<webrtc::AudioState> audio_state_; | 130 rtc::scoped_refptr<webrtc::AudioState> audio_state_; |
126 std::vector<AudioCodec> send_codecs_; | 131 std::vector<AudioCodec> send_codecs_; |
127 std::vector<AudioCodec> recv_codecs_; | 132 std::vector<AudioCodec> recv_codecs_; |
128 std::vector<WebRtcVoiceMediaChannel*> channels_; | 133 std::vector<WebRtcVoiceMediaChannel*> channels_; |
129 webrtc::VoEBase::ChannelConfig channel_config_; | 134 webrtc::VoEBase::ChannelConfig channel_config_; |
130 bool is_dumping_aec_ = false; | 135 bool is_dumping_aec_ = false; |
131 | 136 |
132 webrtc::AgcConfig default_agc_config_; | 137 webrtc::AgcConfig default_agc_config_; |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 std::map<uint32_t, WebRtcAudioReceiveStream*> recv_streams_; | 281 std::map<uint32_t, WebRtcAudioReceiveStream*> recv_streams_; |
277 std::vector<webrtc::RtpExtension> recv_rtp_extensions_; | 282 std::vector<webrtc::RtpExtension> recv_rtp_extensions_; |
278 | 283 |
279 webrtc::AudioSendStream::Config::SendCodecSpec send_codec_spec_; | 284 webrtc::AudioSendStream::Config::SendCodecSpec send_codec_spec_; |
280 | 285 |
281 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcVoiceMediaChannel); | 286 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcVoiceMediaChannel); |
282 }; | 287 }; |
283 } // namespace cricket | 288 } // namespace cricket |
284 | 289 |
285 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_ | 290 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_ |
OLD | NEW |