OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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_VOICE_ENGINE_CHANNEL_H_ | 11 #ifndef WEBRTC_VOICE_ENGINE_CHANNEL_H_ |
12 #define WEBRTC_VOICE_ENGINE_CHANNEL_H_ | 12 #define WEBRTC_VOICE_ENGINE_CHANNEL_H_ |
13 | 13 |
14 #include <memory> | 14 #include <memory> |
15 | 15 |
16 #include "webrtc/audio/audio_sink.h" | 16 #include "webrtc/audio/audio_sink.h" |
17 #include "webrtc/base/criticalsection.h" | 17 #include "webrtc/base/criticalsection.h" |
| 18 #include "webrtc/call/rtc_event_log_proxy.h" |
18 #include "webrtc/common_audio/resampler/include/push_resampler.h" | 19 #include "webrtc/common_audio/resampler/include/push_resampler.h" |
19 #include "webrtc/common_types.h" | 20 #include "webrtc/common_types.h" |
20 #include "webrtc/modules/audio_coding/include/audio_coding_module.h" | 21 #include "webrtc/modules/audio_coding/include/audio_coding_module.h" |
21 #include "webrtc/modules/audio_conference_mixer/include/audio_conference_mixer_d
efines.h" | 22 #include "webrtc/modules/audio_conference_mixer/include/audio_conference_mixer_d
efines.h" |
22 #include "webrtc/modules/audio_processing/rms_level.h" | 23 #include "webrtc/modules/audio_processing/rms_level.h" |
23 #include "webrtc/modules/rtp_rtcp/include/remote_ntp_time_estimator.h" | 24 #include "webrtc/modules/rtp_rtcp/include/remote_ntp_time_estimator.h" |
24 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" | 25 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" |
25 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" | 26 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" |
26 #include "webrtc/modules/utility/include/file_player.h" | 27 #include "webrtc/modules/utility/include/file_player.h" |
27 #include "webrtc/modules/utility/include/file_recorder.h" | 28 #include "webrtc/modules/utility/include/file_recorder.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 { | 172 { |
172 public: | 173 public: |
173 friend class VoERtcpObserver; | 174 friend class VoERtcpObserver; |
174 | 175 |
175 enum { KNumSocketThreads = 1 }; | 176 enum { KNumSocketThreads = 1 }; |
176 enum { KNumberOfSocketBuffers = 8 }; | 177 enum { KNumberOfSocketBuffers = 8 }; |
177 virtual ~Channel(); | 178 virtual ~Channel(); |
178 static int32_t CreateChannel(Channel*& channel, | 179 static int32_t CreateChannel(Channel*& channel, |
179 int32_t channelId, | 180 int32_t channelId, |
180 uint32_t instanceId, | 181 uint32_t instanceId, |
181 RtcEventLog* const event_log, | |
182 const Config& config); | 182 const Config& config); |
183 Channel(int32_t channelId, | 183 Channel(int32_t channelId, |
184 uint32_t instanceId, | 184 uint32_t instanceId, |
185 RtcEventLog* const event_log, | |
186 const Config& config); | 185 const Config& config); |
187 int32_t Init(); | 186 int32_t Init(); |
188 int32_t SetEngineInformation(Statistics& engineStatistics, | 187 int32_t SetEngineInformation(Statistics& engineStatistics, |
189 OutputMixer& outputMixer, | 188 OutputMixer& outputMixer, |
190 TransmitMixer& transmitMixer, | 189 TransmitMixer& transmitMixer, |
191 ProcessThread& moduleProcessThread, | 190 ProcessThread& moduleProcessThread, |
192 AudioDeviceModule& audioDeviceModule, | 191 AudioDeviceModule& audioDeviceModule, |
193 VoiceEngineObserver* voiceEngineObserver, | 192 VoiceEngineObserver* voiceEngineObserver, |
194 rtc::CriticalSection* callbackCritSect); | 193 rtc::CriticalSection* callbackCritSect); |
195 int32_t UpdateLocalTimeStamp(); | 194 int32_t UpdateLocalTimeStamp(); |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 // Used for obtaining RTT for a receive-only channel. | 447 // Used for obtaining RTT for a receive-only channel. |
449 void set_associate_send_channel(const ChannelOwner& channel) { | 448 void set_associate_send_channel(const ChannelOwner& channel) { |
450 assert(_channelId != channel.channel()->ChannelId()); | 449 assert(_channelId != channel.channel()->ChannelId()); |
451 rtc::CritScope lock(&assoc_send_channel_lock_); | 450 rtc::CritScope lock(&assoc_send_channel_lock_); |
452 associate_send_channel_ = channel; | 451 associate_send_channel_ = channel; |
453 } | 452 } |
454 | 453 |
455 // Disassociate a send channel if it was associated. | 454 // Disassociate a send channel if it was associated. |
456 void DisassociateSendChannel(int channel_id); | 455 void DisassociateSendChannel(int channel_id); |
457 | 456 |
| 457 // Set a RtcEventLog logging object. |
| 458 void SetRtcEventLog(RtcEventLog* event_log) { |
| 459 event_log_.SetEventLog(event_log); |
| 460 } |
| 461 |
458 protected: | 462 protected: |
459 void OnIncomingFractionLoss(int fraction_lost); | 463 void OnIncomingFractionLoss(int fraction_lost); |
460 | 464 |
461 private: | 465 private: |
462 bool ReceivePacket(const uint8_t* packet, | 466 bool ReceivePacket(const uint8_t* packet, |
463 size_t packet_length, | 467 size_t packet_length, |
464 const RTPHeader& header, | 468 const RTPHeader& header, |
465 bool in_order); | 469 bool in_order); |
466 bool HandleRtxPacket(const uint8_t* packet, | 470 bool HandleRtxPacket(const uint8_t* packet, |
467 size_t packet_length, | 471 size_t packet_length, |
(...skipping 17 matching lines...) Expand all Loading... |
485 int64_t GetRTT(bool allow_associate_channel) const; | 489 int64_t GetRTT(bool allow_associate_channel) const; |
486 | 490 |
487 rtc::CriticalSection _fileCritSect; | 491 rtc::CriticalSection _fileCritSect; |
488 rtc::CriticalSection _callbackCritSect; | 492 rtc::CriticalSection _callbackCritSect; |
489 rtc::CriticalSection volume_settings_critsect_; | 493 rtc::CriticalSection volume_settings_critsect_; |
490 uint32_t _instanceId; | 494 uint32_t _instanceId; |
491 int32_t _channelId; | 495 int32_t _channelId; |
492 | 496 |
493 ChannelState channel_state_; | 497 ChannelState channel_state_; |
494 | 498 |
495 RtcEventLog* const event_log_; | 499 RtcEventLogProxy event_log_; |
496 | 500 |
497 std::unique_ptr<RtpHeaderParser> rtp_header_parser_; | 501 std::unique_ptr<RtpHeaderParser> rtp_header_parser_; |
498 std::unique_ptr<RTPPayloadRegistry> rtp_payload_registry_; | 502 std::unique_ptr<RTPPayloadRegistry> rtp_payload_registry_; |
499 std::unique_ptr<ReceiveStatistics> rtp_receive_statistics_; | 503 std::unique_ptr<ReceiveStatistics> rtp_receive_statistics_; |
500 std::unique_ptr<StatisticsProxy> statistics_proxy_; | 504 std::unique_ptr<StatisticsProxy> statistics_proxy_; |
501 std::unique_ptr<RtpReceiver> rtp_receiver_; | 505 std::unique_ptr<RtpReceiver> rtp_receiver_; |
502 TelephoneEventHandler* telephone_event_handler_; | 506 TelephoneEventHandler* telephone_event_handler_; |
503 std::unique_ptr<RtpRtcp> _rtpRtcpModule; | 507 std::unique_ptr<RtpRtcp> _rtpRtcpModule; |
504 std::unique_ptr<AudioCodingModule> audio_coding_; | 508 std::unique_ptr<AudioCodingModule> audio_coding_; |
505 std::unique_ptr<AudioSinkInterface> audio_sink_; | 509 std::unique_ptr<AudioSinkInterface> audio_sink_; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 PacketRouter* packet_router_ = nullptr; | 599 PacketRouter* packet_router_ = nullptr; |
596 std::unique_ptr<TransportFeedbackProxy> feedback_observer_proxy_; | 600 std::unique_ptr<TransportFeedbackProxy> feedback_observer_proxy_; |
597 std::unique_ptr<TransportSequenceNumberProxy> seq_num_allocator_proxy_; | 601 std::unique_ptr<TransportSequenceNumberProxy> seq_num_allocator_proxy_; |
598 std::unique_ptr<RtpPacketSenderProxy> rtp_packet_sender_proxy_; | 602 std::unique_ptr<RtpPacketSenderProxy> rtp_packet_sender_proxy_; |
599 }; | 603 }; |
600 | 604 |
601 } // namespace voe | 605 } // namespace voe |
602 } // namespace webrtc | 606 } // namespace webrtc |
603 | 607 |
604 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_H_ | 608 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_H_ |
OLD | NEW |