| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 // WebRtcVoiceEngine is a class to be used with CompositeMediaEngine. | 51 // WebRtcVoiceEngine is a class to be used with CompositeMediaEngine. |
| 52 // It uses the WebRtc VoiceEngine library for audio handling. | 52 // It uses the WebRtc VoiceEngine library for audio handling. |
| 53 class WebRtcVoiceEngine final : public webrtc::TraceCallback { | 53 class WebRtcVoiceEngine final : public webrtc::TraceCallback { |
| 54 friend class WebRtcVoiceMediaChannel; | 54 friend class WebRtcVoiceMediaChannel; |
| 55 public: | 55 public: |
| 56 WebRtcVoiceEngine( | 56 WebRtcVoiceEngine( |
| 57 webrtc::AudioDeviceModule* adm, | 57 webrtc::AudioDeviceModule* adm, |
| 58 const rtc::scoped_refptr<webrtc::AudioEncoderFactory>& encoder_factory, | 58 const rtc::scoped_refptr<webrtc::AudioEncoderFactory>& encoder_factory, |
| 59 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& decoder_factory, | 59 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& decoder_factory, |
| 60 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer); | 60 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer, |
| 61 rtc::scoped_refptr<webrtc::AudioProcessing> audio_processing); |
| 61 // Dependency injection for testing. | 62 // Dependency injection for testing. |
| 62 WebRtcVoiceEngine( | 63 WebRtcVoiceEngine( |
| 63 webrtc::AudioDeviceModule* adm, | 64 webrtc::AudioDeviceModule* adm, |
| 64 const rtc::scoped_refptr<webrtc::AudioEncoderFactory>& encoder_factory, | 65 const rtc::scoped_refptr<webrtc::AudioEncoderFactory>& encoder_factory, |
| 65 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& decoder_factory, | 66 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& decoder_factory, |
| 66 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer, | 67 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer, |
| 68 rtc::scoped_refptr<webrtc::AudioProcessing> audio_processing, |
| 67 VoEWrapper* voe_wrapper); | 69 VoEWrapper* voe_wrapper); |
| 68 ~WebRtcVoiceEngine() override; | 70 ~WebRtcVoiceEngine() override; |
| 69 | 71 |
| 70 // Does initialization that needs to occur on the worker thread. | 72 // Does initialization that needs to occur on the worker thread. |
| 71 void Init(); | 73 void Init(); |
| 72 | 74 |
| 73 rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const; | 75 rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const; |
| 74 VoiceMediaChannel* CreateChannel(webrtc::Call* call, | 76 VoiceMediaChannel* CreateChannel(webrtc::Call* call, |
| 75 const MediaConfig& config, | 77 const MediaConfig& config, |
| 76 const AudioOptions& options); | 78 const AudioOptions& options); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 128 |
| 127 rtc::ThreadChecker signal_thread_checker_; | 129 rtc::ThreadChecker signal_thread_checker_; |
| 128 rtc::ThreadChecker worker_thread_checker_; | 130 rtc::ThreadChecker worker_thread_checker_; |
| 129 | 131 |
| 130 // The audio device manager. | 132 // The audio device manager. |
| 131 rtc::scoped_refptr<webrtc::AudioDeviceModule> adm_; | 133 rtc::scoped_refptr<webrtc::AudioDeviceModule> adm_; |
| 132 rtc::scoped_refptr<webrtc::AudioEncoderFactory> encoder_factory_; | 134 rtc::scoped_refptr<webrtc::AudioEncoderFactory> encoder_factory_; |
| 133 rtc::scoped_refptr<webrtc::AudioDecoderFactory> decoder_factory_; | 135 rtc::scoped_refptr<webrtc::AudioDecoderFactory> decoder_factory_; |
| 134 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer_; | 136 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer_; |
| 135 // Reference to the APM, owned by VoE. | 137 // Reference to the APM, owned by VoE. |
| 136 webrtc::AudioProcessing* apm_ = nullptr; | 138 rtc::scoped_refptr<webrtc::AudioProcessing> apm_; |
| 137 // Reference to the TransmitMixer, owned by VoE. | 139 // Reference to the TransmitMixer, owned by VoE. |
| 138 webrtc::voe::TransmitMixer* transmit_mixer_ = nullptr; | 140 webrtc::voe::TransmitMixer* transmit_mixer_ = nullptr; |
| 139 // The primary instance of WebRtc VoiceEngine. | 141 // The primary instance of WebRtc VoiceEngine. |
| 140 std::unique_ptr<VoEWrapper> voe_wrapper_; | 142 std::unique_ptr<VoEWrapper> voe_wrapper_; |
| 141 rtc::scoped_refptr<webrtc::AudioState> audio_state_; | 143 rtc::scoped_refptr<webrtc::AudioState> audio_state_; |
| 142 std::vector<AudioCodec> send_codecs_; | 144 std::vector<AudioCodec> send_codecs_; |
| 143 std::vector<AudioCodec> recv_codecs_; | 145 std::vector<AudioCodec> recv_codecs_; |
| 144 std::vector<WebRtcVoiceMediaChannel*> channels_; | 146 std::vector<WebRtcVoiceMediaChannel*> channels_; |
| 145 webrtc::VoEBase::ChannelConfig channel_config_; | 147 webrtc::VoEBase::ChannelConfig channel_config_; |
| 146 bool is_dumping_aec_ = false; | 148 bool is_dumping_aec_ = false; |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 std::vector<webrtc::RtpExtension> recv_rtp_extensions_; | 305 std::vector<webrtc::RtpExtension> recv_rtp_extensions_; |
| 304 | 306 |
| 305 rtc::Optional<webrtc::AudioSendStream::Config::SendCodecSpec> | 307 rtc::Optional<webrtc::AudioSendStream::Config::SendCodecSpec> |
| 306 send_codec_spec_; | 308 send_codec_spec_; |
| 307 | 309 |
| 308 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcVoiceMediaChannel); | 310 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcVoiceMediaChannel); |
| 309 }; | 311 }; |
| 310 } // namespace cricket | 312 } // namespace cricket |
| 311 | 313 |
| 312 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_ | 314 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_ |
| OLD | NEW |