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 28 matching lines...) Expand all Loading... |
39 class WebRtcVoiceMediaChannel; | 39 class WebRtcVoiceMediaChannel; |
40 | 40 |
41 // WebRtcVoiceEngine is a class to be used with CompositeMediaEngine. | 41 // WebRtcVoiceEngine is a class to be used with CompositeMediaEngine. |
42 // It uses the WebRtc VoiceEngine library for audio handling. | 42 // It uses the WebRtc VoiceEngine library for audio handling. |
43 class WebRtcVoiceEngine final : public webrtc::TraceCallback { | 43 class WebRtcVoiceEngine final : public webrtc::TraceCallback { |
44 friend class WebRtcVoiceMediaChannel; | 44 friend class WebRtcVoiceMediaChannel; |
45 public: | 45 public: |
46 // Exposed for the WVoE/MC unit test. | 46 // Exposed for the WVoE/MC unit test. |
47 static bool ToCodecInst(const AudioCodec& in, webrtc::CodecInst* out); | 47 static bool ToCodecInst(const AudioCodec& in, webrtc::CodecInst* out); |
48 | 48 |
49 explicit WebRtcVoiceEngine(webrtc::AudioDeviceModule* adm); | 49 WebRtcVoiceEngine( |
| 50 webrtc::AudioDeviceModule* adm, |
| 51 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& decoder_factory); |
50 // Dependency injection for testing. | 52 // Dependency injection for testing. |
51 WebRtcVoiceEngine(webrtc::AudioDeviceModule* adm, VoEWrapper* voe_wrapper); | 53 WebRtcVoiceEngine( |
| 54 webrtc::AudioDeviceModule* adm, |
| 55 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& decoder_factory, |
| 56 VoEWrapper* voe_wrapper); |
52 ~WebRtcVoiceEngine() override; | 57 ~WebRtcVoiceEngine() override; |
53 | 58 |
54 rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const; | 59 rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const; |
55 VoiceMediaChannel* CreateChannel(webrtc::Call* call, | 60 VoiceMediaChannel* CreateChannel(webrtc::Call* call, |
56 const MediaConfig& config, | 61 const MediaConfig& config, |
57 const AudioOptions& options); | 62 const AudioOptions& options); |
58 | 63 |
59 bool GetOutputVolume(int* level); | 64 bool GetOutputVolume(int* level); |
60 bool SetOutputVolume(int level); | 65 bool SetOutputVolume(int level); |
61 int GetInputLevel(); | 66 int GetInputLevel(); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 110 |
106 void StartAecDump(const std::string& filename); | 111 void StartAecDump(const std::string& filename); |
107 int CreateVoEChannel(); | 112 int CreateVoEChannel(); |
108 webrtc::AudioDeviceModule* adm(); | 113 webrtc::AudioDeviceModule* adm(); |
109 | 114 |
110 rtc::ThreadChecker signal_thread_checker_; | 115 rtc::ThreadChecker signal_thread_checker_; |
111 rtc::ThreadChecker worker_thread_checker_; | 116 rtc::ThreadChecker worker_thread_checker_; |
112 | 117 |
113 // The audio device manager. | 118 // The audio device manager. |
114 rtc::scoped_refptr<webrtc::AudioDeviceModule> adm_; | 119 rtc::scoped_refptr<webrtc::AudioDeviceModule> adm_; |
| 120 rtc::scoped_refptr<webrtc::AudioDecoderFactory> decoder_factory_; |
115 // The primary instance of WebRtc VoiceEngine. | 121 // The primary instance of WebRtc VoiceEngine. |
116 std::unique_ptr<VoEWrapper> voe_wrapper_; | 122 std::unique_ptr<VoEWrapper> voe_wrapper_; |
117 rtc::scoped_refptr<webrtc::AudioState> audio_state_; | 123 rtc::scoped_refptr<webrtc::AudioState> audio_state_; |
118 std::vector<AudioCodec> codecs_; | 124 std::vector<AudioCodec> codecs_; |
119 std::vector<WebRtcVoiceMediaChannel*> channels_; | 125 std::vector<WebRtcVoiceMediaChannel*> channels_; |
120 webrtc::Config voe_config_; | 126 webrtc::Config voe_config_; |
121 bool is_dumping_aec_ = false; | 127 bool is_dumping_aec_ = false; |
122 | 128 |
123 webrtc::AgcConfig default_agc_config_; | 129 webrtc::AgcConfig default_agc_config_; |
124 // Cache received extended_filter_aec, delay_agnostic_aec, experimental_ns and | 130 // Cache received extended_filter_aec, delay_agnostic_aec, experimental_ns and |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 int cng_payload_type = -1; | 298 int cng_payload_type = -1; |
293 int cng_plfreq = -1; | 299 int cng_plfreq = -1; |
294 webrtc::CodecInst codec_inst; | 300 webrtc::CodecInst codec_inst; |
295 } send_codec_spec_; | 301 } send_codec_spec_; |
296 | 302 |
297 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcVoiceMediaChannel); | 303 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcVoiceMediaChannel); |
298 }; | 304 }; |
299 } // namespace cricket | 305 } // namespace cricket |
300 | 306 |
301 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_ | 307 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_ |
OLD | NEW |