| 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 <string> | 16 #include <string> |
| 16 #include <vector> | 17 #include <vector> |
| 17 | 18 |
| 18 #include "webrtc/audio_state.h" | 19 #include "webrtc/audio_state.h" |
| 19 #include "webrtc/base/buffer.h" | 20 #include "webrtc/base/buffer.h" |
| 20 #include "webrtc/base/scoped_ptr.h" | |
| 21 #include "webrtc/base/stream.h" | 21 #include "webrtc/base/stream.h" |
| 22 #include "webrtc/base/thread_checker.h" | 22 #include "webrtc/base/thread_checker.h" |
| 23 #include "webrtc/call.h" | 23 #include "webrtc/call.h" |
| 24 #include "webrtc/common.h" | 24 #include "webrtc/common.h" |
| 25 #include "webrtc/config.h" | 25 #include "webrtc/config.h" |
| 26 #include "webrtc/media/base/rtputils.h" | 26 #include "webrtc/media/base/rtputils.h" |
| 27 #include "webrtc/media/engine/webrtccommon.h" | 27 #include "webrtc/media/engine/webrtccommon.h" |
| 28 #include "webrtc/media/engine/webrtcvoe.h" | 28 #include "webrtc/media/engine/webrtcvoe.h" |
| 29 #include "webrtc/pc/channel.h" | 29 #include "webrtc/pc/channel.h" |
| 30 | 30 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 // webrtc::TraceCallback: | 106 // webrtc::TraceCallback: |
| 107 void Print(webrtc::TraceLevel level, const char* trace, int length) override; | 107 void Print(webrtc::TraceLevel level, const char* trace, int length) override; |
| 108 | 108 |
| 109 void StartAecDump(const std::string& filename); | 109 void StartAecDump(const std::string& filename); |
| 110 int CreateVoEChannel(); | 110 int CreateVoEChannel(); |
| 111 | 111 |
| 112 rtc::ThreadChecker signal_thread_checker_; | 112 rtc::ThreadChecker signal_thread_checker_; |
| 113 rtc::ThreadChecker worker_thread_checker_; | 113 rtc::ThreadChecker worker_thread_checker_; |
| 114 | 114 |
| 115 // The primary instance of WebRtc VoiceEngine. | 115 // The primary instance of WebRtc VoiceEngine. |
| 116 rtc::scoped_ptr<VoEWrapper> voe_wrapper_; | 116 std::unique_ptr<VoEWrapper> voe_wrapper_; |
| 117 rtc::scoped_refptr<webrtc::AudioState> audio_state_; | 117 rtc::scoped_refptr<webrtc::AudioState> audio_state_; |
| 118 // The external audio device manager | 118 // The external audio device manager |
| 119 webrtc::AudioDeviceModule* adm_ = nullptr; | 119 webrtc::AudioDeviceModule* adm_ = nullptr; |
| 120 std::vector<AudioCodec> codecs_; | 120 std::vector<AudioCodec> codecs_; |
| 121 std::vector<WebRtcVoiceMediaChannel*> channels_; | 121 std::vector<WebRtcVoiceMediaChannel*> channels_; |
| 122 webrtc::Config voe_config_; | 122 webrtc::Config voe_config_; |
| 123 bool initialized_ = false; | 123 bool initialized_ = false; |
| 124 bool is_dumping_aec_ = false; | 124 bool is_dumping_aec_ = false; |
| 125 | 125 |
| 126 webrtc::AgcConfig default_agc_config_; | 126 webrtc::AgcConfig default_agc_config_; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 | 181 |
| 182 void OnPacketReceived(rtc::Buffer* packet, | 182 void OnPacketReceived(rtc::Buffer* packet, |
| 183 const rtc::PacketTime& packet_time) override; | 183 const rtc::PacketTime& packet_time) override; |
| 184 void OnRtcpReceived(rtc::Buffer* packet, | 184 void OnRtcpReceived(rtc::Buffer* packet, |
| 185 const rtc::PacketTime& packet_time) override; | 185 const rtc::PacketTime& packet_time) override; |
| 186 void OnReadyToSend(bool ready) override {} | 186 void OnReadyToSend(bool ready) override {} |
| 187 bool GetStats(VoiceMediaInfo* info) override; | 187 bool GetStats(VoiceMediaInfo* info) override; |
| 188 | 188 |
| 189 void SetRawAudioSink( | 189 void SetRawAudioSink( |
| 190 uint32_t ssrc, | 190 uint32_t ssrc, |
| 191 rtc::scoped_ptr<webrtc::AudioSinkInterface> sink) override; | 191 std::unique_ptr<webrtc::AudioSinkInterface> sink) override; |
| 192 | 192 |
| 193 // implements Transport interface | 193 // implements Transport interface |
| 194 bool SendRtp(const uint8_t* data, | 194 bool SendRtp(const uint8_t* data, |
| 195 size_t len, | 195 size_t len, |
| 196 const webrtc::PacketOptions& options) override { | 196 const webrtc::PacketOptions& options) override { |
| 197 rtc::Buffer packet(reinterpret_cast<const uint8_t*>(data), len, | 197 rtc::Buffer packet(reinterpret_cast<const uint8_t*>(data), len, |
| 198 kMaxRtpPacketLen); | 198 kMaxRtpPacketLen); |
| 199 rtc::PacketOptions rtc_options; | 199 rtc::PacketOptions rtc_options; |
| 200 rtc_options.packet_id = options.packet_id; | 200 rtc_options.packet_id = options.packet_id; |
| 201 return VoiceMediaChannel::SendPacket(&packet, rtc_options); | 201 return VoiceMediaChannel::SendPacket(&packet, rtc_options); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 return default_recv_ssrc_ == static_cast<int64_t>(ssrc); | 233 return default_recv_ssrc_ == static_cast<int64_t>(ssrc); |
| 234 } | 234 } |
| 235 bool SetSendCodecs(int channel, const std::vector<AudioCodec>& codecs); | 235 bool SetSendCodecs(int channel, const std::vector<AudioCodec>& codecs); |
| 236 bool SetSendBitrateInternal(int bps); | 236 bool SetSendBitrateInternal(int bps); |
| 237 | 237 |
| 238 rtc::ThreadChecker worker_thread_checker_; | 238 rtc::ThreadChecker worker_thread_checker_; |
| 239 | 239 |
| 240 WebRtcVoiceEngine* const engine_ = nullptr; | 240 WebRtcVoiceEngine* const engine_ = nullptr; |
| 241 std::vector<AudioCodec> recv_codecs_; | 241 std::vector<AudioCodec> recv_codecs_; |
| 242 std::vector<AudioCodec> send_codecs_; | 242 std::vector<AudioCodec> send_codecs_; |
| 243 rtc::scoped_ptr<webrtc::CodecInst> send_codec_; | 243 std::unique_ptr<webrtc::CodecInst> send_codec_; |
| 244 bool send_bitrate_setting_ = false; | 244 bool send_bitrate_setting_ = false; |
| 245 int send_bitrate_bps_ = 0; | 245 int send_bitrate_bps_ = 0; |
| 246 AudioOptions options_; | 246 AudioOptions options_; |
| 247 rtc::Optional<int> dtmf_payload_type_; | 247 rtc::Optional<int> dtmf_payload_type_; |
| 248 bool desired_playout_ = false; | 248 bool desired_playout_ = false; |
| 249 bool nack_enabled_ = false; | 249 bool nack_enabled_ = false; |
| 250 bool transport_cc_enabled_ = false; | 250 bool transport_cc_enabled_ = false; |
| 251 bool playout_ = false; | 251 bool playout_ = false; |
| 252 SendFlags desired_send_ = SEND_NOTHING; | 252 SendFlags desired_send_ = SEND_NOTHING; |
| 253 SendFlags send_ = SEND_NOTHING; | 253 SendFlags send_ = SEND_NOTHING; |
| 254 webrtc::Call* const call_ = nullptr; | 254 webrtc::Call* const call_ = nullptr; |
| 255 | 255 |
| 256 // SSRC of unsignalled receive stream, or -1 if there isn't one. | 256 // SSRC of unsignalled receive stream, or -1 if there isn't one. |
| 257 int64_t default_recv_ssrc_ = -1; | 257 int64_t default_recv_ssrc_ = -1; |
| 258 // Volume for unsignalled stream, which may be set before the stream exists. | 258 // Volume for unsignalled stream, which may be set before the stream exists. |
| 259 double default_recv_volume_ = 1.0; | 259 double default_recv_volume_ = 1.0; |
| 260 // Sink for unsignalled stream, which may be set before the stream exists. | 260 // Sink for unsignalled stream, which may be set before the stream exists. |
| 261 rtc::scoped_ptr<webrtc::AudioSinkInterface> default_sink_; | 261 std::unique_ptr<webrtc::AudioSinkInterface> default_sink_; |
| 262 // Default SSRC to use for RTCP receiver reports in case of no signaled | 262 // Default SSRC to use for RTCP receiver reports in case of no signaled |
| 263 // send streams. See: https://code.google.com/p/webrtc/issues/detail?id=4740 | 263 // send streams. See: https://code.google.com/p/webrtc/issues/detail?id=4740 |
| 264 // and https://code.google.com/p/chromium/issues/detail?id=547661 | 264 // and https://code.google.com/p/chromium/issues/detail?id=547661 |
| 265 uint32_t receiver_reports_ssrc_ = 0xFA17FA17u; | 265 uint32_t receiver_reports_ssrc_ = 0xFA17FA17u; |
| 266 | 266 |
| 267 class WebRtcAudioSendStream; | 267 class WebRtcAudioSendStream; |
| 268 std::map<uint32_t, WebRtcAudioSendStream*> send_streams_; | 268 std::map<uint32_t, WebRtcAudioSendStream*> send_streams_; |
| 269 std::vector<webrtc::RtpExtension> send_rtp_extensions_; | 269 std::vector<webrtc::RtpExtension> send_rtp_extensions_; |
| 270 | 270 |
| 271 class WebRtcAudioReceiveStream; | 271 class WebRtcAudioReceiveStream; |
| 272 std::map<uint32_t, WebRtcAudioReceiveStream*> recv_streams_; | 272 std::map<uint32_t, WebRtcAudioReceiveStream*> recv_streams_; |
| 273 std::vector<webrtc::RtpExtension> recv_rtp_extensions_; | 273 std::vector<webrtc::RtpExtension> recv_rtp_extensions_; |
| 274 | 274 |
| 275 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcVoiceMediaChannel); | 275 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcVoiceMediaChannel); |
| 276 }; | 276 }; |
| 277 } // namespace cricket | 277 } // namespace cricket |
| 278 | 278 |
| 279 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_ | 279 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_ |
| OLD | NEW |