| 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/base/buffer.h" | 20 #include "webrtc/base/buffer.h" |
| 20 #include "webrtc/base/constructormagic.h" | 21 #include "webrtc/base/constructormagic.h" |
| 21 #include "webrtc/base/networkroute.h" | 22 #include "webrtc/base/networkroute.h" |
| 22 #include "webrtc/base/scoped_ref_ptr.h" | 23 #include "webrtc/base/scoped_ref_ptr.h" |
| 23 #include "webrtc/base/thread_checker.h" | 24 #include "webrtc/base/thread_checker.h" |
| 24 #include "webrtc/call/audio_state.h" | 25 #include "webrtc/call/audio_state.h" |
| 25 #include "webrtc/call/call.h" | 26 #include "webrtc/call/call.h" |
| 26 #include "webrtc/config.h" | 27 #include "webrtc/config.h" |
| 27 #include "webrtc/media/base/rtputils.h" | 28 #include "webrtc/media/base/rtputils.h" |
| 28 #include "webrtc/media/engine/apm_helpers.h" | 29 #include "webrtc/media/engine/apm_helpers.h" |
| 29 #include "webrtc/media/engine/webrtccommon.h" | 30 #include "webrtc/media/engine/webrtccommon.h" |
| 30 #include "webrtc/media/engine/webrtcvoe.h" | 31 #include "webrtc/media/engine/webrtcvoe.h" |
| 31 #include "webrtc/modules/audio_coding/codecs/audio_encoder_factory.h" | |
| 32 #include "webrtc/modules/audio_processing/include/audio_processing.h" | 32 #include "webrtc/modules/audio_processing/include/audio_processing.h" |
| 33 #include "webrtc/pc/channel.h" | 33 #include "webrtc/pc/channel.h" |
| 34 | 34 |
| 35 namespace webrtc { | 35 namespace webrtc { |
| 36 namespace voe { | 36 namespace voe { |
| 37 class TransmitMixer; | 37 class TransmitMixer; |
| 38 } // namespace voe | 38 } // namespace voe |
| 39 } // namespace webrtc | 39 } // namespace webrtc |
| 40 | 40 |
| 41 namespace cricket { | 41 namespace cricket { |
| 42 | 42 |
| 43 class AudioDeviceModule; | 43 class AudioDeviceModule; |
| 44 class AudioMixer; | 44 class AudioMixer; |
| 45 class AudioSource; | 45 class AudioSource; |
| 46 class VoEWrapper; | 46 class VoEWrapper; |
| 47 class WebRtcVoiceMediaChannel; | 47 class WebRtcVoiceMediaChannel; |
| 48 | 48 |
| 49 // WebRtcVoiceEngine is a class to be used with CompositeMediaEngine. | 49 // WebRtcVoiceEngine is a class to be used with CompositeMediaEngine. |
| 50 // It uses the WebRtc VoiceEngine library for audio handling. | 50 // It uses the WebRtc VoiceEngine library for audio handling. |
| 51 class WebRtcVoiceEngine final : public webrtc::TraceCallback { | 51 class WebRtcVoiceEngine final : public webrtc::TraceCallback { |
| 52 friend class WebRtcVoiceMediaChannel; | 52 friend class WebRtcVoiceMediaChannel; |
| 53 public: | 53 public: |
| 54 // Exposed for the WVoE/MC unit test. | 54 // Exposed for the WVoE/MC unit test. |
| 55 static bool ToCodecInst(const AudioCodec& in, webrtc::CodecInst* out); | 55 static bool ToCodecInst(const AudioCodec& in, webrtc::CodecInst* out); |
| 56 | 56 |
| 57 WebRtcVoiceEngine( | 57 WebRtcVoiceEngine( |
| 58 webrtc::AudioDeviceModule* adm, | 58 webrtc::AudioDeviceModule* adm, |
| 59 const rtc::scoped_refptr<webrtc::AudioEncoderFactory>& encoder_factory, |
| 59 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& decoder_factory, | 60 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& decoder_factory, |
| 60 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer); | 61 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer); |
| 61 // Dependency injection for testing. | 62 // Dependency injection for testing. |
| 62 WebRtcVoiceEngine( | 63 WebRtcVoiceEngine( |
| 63 webrtc::AudioDeviceModule* adm, | 64 webrtc::AudioDeviceModule* adm, |
| 65 const rtc::scoped_refptr<webrtc::AudioEncoderFactory>& encoder_factory, |
| 64 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& decoder_factory, | 66 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& decoder_factory, |
| 65 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer, | 67 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer, |
| 66 VoEWrapper* voe_wrapper); | 68 VoEWrapper* voe_wrapper); |
| 67 ~WebRtcVoiceEngine() override; | 69 ~WebRtcVoiceEngine() override; |
| 68 | 70 |
| 69 rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const; | 71 rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const; |
| 70 VoiceMediaChannel* CreateChannel(webrtc::Call* call, | 72 VoiceMediaChannel* CreateChannel(webrtc::Call* call, |
| 71 const MediaConfig& config, | 73 const MediaConfig& config, |
| 72 const AudioOptions& options); | 74 const AudioOptions& options); |
| 73 | 75 |
| (...skipping 218 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 |