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 |
11 #ifndef WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_ | 11 #ifndef WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_ |
12 #define WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_ | 12 #define WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_ |
13 | 13 |
14 #include <map> | 14 #include <map> |
15 #include <memory> | 15 #include <memory> |
16 #include <string> | 16 #include <string> |
17 #include <vector> | 17 #include <vector> |
18 | 18 |
| 19 #include "webrtc/api/audio_codecs/audio_encoder_factory.h" |
19 #include "webrtc/api/rtpreceiverinterface.h" | 20 #include "webrtc/api/rtpreceiverinterface.h" |
20 #include "webrtc/base/buffer.h" | 21 #include "webrtc/base/buffer.h" |
21 #include "webrtc/base/constructormagic.h" | 22 #include "webrtc/base/constructormagic.h" |
22 #include "webrtc/base/networkroute.h" | 23 #include "webrtc/base/networkroute.h" |
23 #include "webrtc/base/scoped_ref_ptr.h" | 24 #include "webrtc/base/scoped_ref_ptr.h" |
24 #include "webrtc/base/thread_checker.h" | 25 #include "webrtc/base/thread_checker.h" |
25 #include "webrtc/call/audio_state.h" | 26 #include "webrtc/call/audio_state.h" |
26 #include "webrtc/call/call.h" | 27 #include "webrtc/call/call.h" |
27 #include "webrtc/config.h" | 28 #include "webrtc/config.h" |
28 #include "webrtc/media/base/rtputils.h" | 29 #include "webrtc/media/base/rtputils.h" |
29 #include "webrtc/media/engine/apm_helpers.h" | 30 #include "webrtc/media/engine/apm_helpers.h" |
30 #include "webrtc/media/engine/webrtccommon.h" | 31 #include "webrtc/media/engine/webrtccommon.h" |
31 #include "webrtc/media/engine/webrtcvoe.h" | 32 #include "webrtc/media/engine/webrtcvoe.h" |
32 #include "webrtc/modules/audio_coding/codecs/audio_encoder_factory.h" | |
33 #include "webrtc/modules/audio_processing/include/audio_processing.h" | 33 #include "webrtc/modules/audio_processing/include/audio_processing.h" |
34 #include "webrtc/pc/channel.h" | 34 #include "webrtc/pc/channel.h" |
35 | 35 |
36 namespace webrtc { | 36 namespace webrtc { |
37 namespace voe { | 37 namespace voe { |
38 class TransmitMixer; | 38 class TransmitMixer; |
39 } // namespace voe | 39 } // namespace voe |
40 } // namespace webrtc | 40 } // namespace webrtc |
41 | 41 |
42 namespace cricket { | 42 namespace cricket { |
43 | 43 |
44 class AudioDeviceModule; | 44 class AudioDeviceModule; |
45 class AudioMixer; | 45 class AudioMixer; |
46 class AudioSource; | 46 class AudioSource; |
47 class VoEWrapper; | 47 class VoEWrapper; |
48 class WebRtcVoiceMediaChannel; | 48 class WebRtcVoiceMediaChannel; |
49 | 49 |
50 // WebRtcVoiceEngine is a class to be used with CompositeMediaEngine. | 50 // WebRtcVoiceEngine is a class to be used with CompositeMediaEngine. |
51 // It uses the WebRtc VoiceEngine library for audio handling. | 51 // It uses the WebRtc VoiceEngine library for audio handling. |
52 class WebRtcVoiceEngine final : public webrtc::TraceCallback { | 52 class WebRtcVoiceEngine final : public webrtc::TraceCallback { |
53 friend class WebRtcVoiceMediaChannel; | 53 friend class WebRtcVoiceMediaChannel; |
54 public: | 54 public: |
55 WebRtcVoiceEngine( | 55 WebRtcVoiceEngine( |
56 webrtc::AudioDeviceModule* adm, | 56 webrtc::AudioDeviceModule* adm, |
| 57 const rtc::scoped_refptr<webrtc::AudioEncoderFactory>& encoder_factory, |
57 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& decoder_factory, | 58 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& decoder_factory, |
58 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer); | 59 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer); |
59 // Dependency injection for testing. | 60 // Dependency injection for testing. |
60 WebRtcVoiceEngine( | 61 WebRtcVoiceEngine( |
61 webrtc::AudioDeviceModule* adm, | 62 webrtc::AudioDeviceModule* adm, |
| 63 const rtc::scoped_refptr<webrtc::AudioEncoderFactory>& encoder_factory, |
62 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& decoder_factory, | 64 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& decoder_factory, |
63 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer, | 65 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer, |
64 VoEWrapper* voe_wrapper); | 66 VoEWrapper* voe_wrapper); |
65 ~WebRtcVoiceEngine() override; | 67 ~WebRtcVoiceEngine() override; |
66 | 68 |
67 rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const; | 69 rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const; |
68 VoiceMediaChannel* CreateChannel(webrtc::Call* call, | 70 VoiceMediaChannel* CreateChannel(webrtc::Call* call, |
69 const MediaConfig& config, | 71 const MediaConfig& config, |
70 const AudioOptions& options); | 72 const AudioOptions& options); |
71 | 73 |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 std::vector<webrtc::RtpExtension> recv_rtp_extensions_; | 294 std::vector<webrtc::RtpExtension> recv_rtp_extensions_; |
293 | 295 |
294 rtc::Optional<webrtc::AudioSendStream::Config::SendCodecSpec> | 296 rtc::Optional<webrtc::AudioSendStream::Config::SendCodecSpec> |
295 send_codec_spec_; | 297 send_codec_spec_; |
296 | 298 |
297 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcVoiceMediaChannel); | 299 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcVoiceMediaChannel); |
298 }; | 300 }; |
299 } // namespace cricket | 301 } // namespace cricket |
300 | 302 |
301 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_ | 303 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_ |
OLD | NEW |