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 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 class VoERTPObserver; | 59 class VoERTPObserver; |
60 class VoiceEngineObserver; | 60 class VoiceEngineObserver; |
61 | 61 |
62 struct CallStatistics; | 62 struct CallStatistics; |
63 struct ReportBlock; | 63 struct ReportBlock; |
64 struct SenderInfo; | 64 struct SenderInfo; |
65 | 65 |
66 namespace voe { | 66 namespace voe { |
67 | 67 |
68 class OutputMixer; | 68 class OutputMixer; |
| 69 class RtcEventLogProxy; |
69 class RtpPacketSenderProxy; | 70 class RtpPacketSenderProxy; |
70 class Statistics; | 71 class Statistics; |
71 class StatisticsProxy; | 72 class StatisticsProxy; |
72 class TransportFeedbackProxy; | 73 class TransportFeedbackProxy; |
73 class TransmitMixer; | 74 class TransmitMixer; |
74 class TransportSequenceNumberProxy; | 75 class TransportSequenceNumberProxy; |
75 class VoERtcpObserver; | 76 class VoERtcpObserver; |
76 | 77 |
77 // Helper class to simplify locking scheme for members that are accessed from | 78 // Helper class to simplify locking scheme for members that are accessed from |
78 // multiple threads. | 79 // multiple threads. |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 { | 167 { |
167 public: | 168 public: |
168 friend class VoERtcpObserver; | 169 friend class VoERtcpObserver; |
169 | 170 |
170 enum { KNumSocketThreads = 1 }; | 171 enum { KNumSocketThreads = 1 }; |
171 enum { KNumberOfSocketBuffers = 8 }; | 172 enum { KNumberOfSocketBuffers = 8 }; |
172 virtual ~Channel(); | 173 virtual ~Channel(); |
173 static int32_t CreateChannel(Channel*& channel, | 174 static int32_t CreateChannel(Channel*& channel, |
174 int32_t channelId, | 175 int32_t channelId, |
175 uint32_t instanceId, | 176 uint32_t instanceId, |
176 RtcEventLog* const event_log, | |
177 const Config& config); | 177 const Config& config); |
178 static int32_t CreateChannel( | 178 static int32_t CreateChannel( |
179 Channel*& channel, | 179 Channel*& channel, |
180 int32_t channelId, | 180 int32_t channelId, |
181 uint32_t instanceId, | 181 uint32_t instanceId, |
182 RtcEventLog* const event_log, | |
183 const Config& config, | 182 const Config& config, |
184 const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory); | 183 const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory); |
185 Channel(int32_t channelId, | 184 Channel(int32_t channelId, |
186 uint32_t instanceId, | 185 uint32_t instanceId, |
187 RtcEventLog* const event_log, | |
188 const Config& config, | 186 const Config& config, |
189 const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory); | 187 const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory); |
190 int32_t Init(); | 188 int32_t Init(); |
191 int32_t SetEngineInformation(Statistics& engineStatistics, | 189 int32_t SetEngineInformation(Statistics& engineStatistics, |
192 OutputMixer& outputMixer, | 190 OutputMixer& outputMixer, |
193 TransmitMixer& transmitMixer, | 191 TransmitMixer& transmitMixer, |
194 ProcessThread& moduleProcessThread, | 192 ProcessThread& moduleProcessThread, |
195 AudioDeviceModule& audioDeviceModule, | 193 AudioDeviceModule& audioDeviceModule, |
196 VoiceEngineObserver* voiceEngineObserver, | 194 VoiceEngineObserver* voiceEngineObserver, |
197 rtc::CriticalSection* callbackCritSect); | 195 rtc::CriticalSection* callbackCritSect); |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 // Used for obtaining RTT for a receive-only channel. | 442 // Used for obtaining RTT for a receive-only channel. |
445 void set_associate_send_channel(const ChannelOwner& channel) { | 443 void set_associate_send_channel(const ChannelOwner& channel) { |
446 assert(_channelId != channel.channel()->ChannelId()); | 444 assert(_channelId != channel.channel()->ChannelId()); |
447 rtc::CritScope lock(&assoc_send_channel_lock_); | 445 rtc::CritScope lock(&assoc_send_channel_lock_); |
448 associate_send_channel_ = channel; | 446 associate_send_channel_ = channel; |
449 } | 447 } |
450 | 448 |
451 // Disassociate a send channel if it was associated. | 449 // Disassociate a send channel if it was associated. |
452 void DisassociateSendChannel(int channel_id); | 450 void DisassociateSendChannel(int channel_id); |
453 | 451 |
| 452 // Set a RtcEventLog logging object. |
| 453 void SetRtcEventLog(RtcEventLog* event_log); |
| 454 |
454 protected: | 455 protected: |
455 void OnIncomingFractionLoss(int fraction_lost); | 456 void OnIncomingFractionLoss(int fraction_lost); |
456 | 457 |
457 private: | 458 private: |
458 bool ReceivePacket(const uint8_t* packet, | 459 bool ReceivePacket(const uint8_t* packet, |
459 size_t packet_length, | 460 size_t packet_length, |
460 const RTPHeader& header, | 461 const RTPHeader& header, |
461 bool in_order); | 462 bool in_order); |
462 bool HandleRtxPacket(const uint8_t* packet, | 463 bool HandleRtxPacket(const uint8_t* packet, |
463 size_t packet_length, | 464 size_t packet_length, |
(...skipping 15 matching lines...) Expand all Loading... |
479 int64_t GetRTT(bool allow_associate_channel) const; | 480 int64_t GetRTT(bool allow_associate_channel) const; |
480 | 481 |
481 rtc::CriticalSection _fileCritSect; | 482 rtc::CriticalSection _fileCritSect; |
482 rtc::CriticalSection _callbackCritSect; | 483 rtc::CriticalSection _callbackCritSect; |
483 rtc::CriticalSection volume_settings_critsect_; | 484 rtc::CriticalSection volume_settings_critsect_; |
484 uint32_t _instanceId; | 485 uint32_t _instanceId; |
485 int32_t _channelId; | 486 int32_t _channelId; |
486 | 487 |
487 ChannelState channel_state_; | 488 ChannelState channel_state_; |
488 | 489 |
489 RtcEventLog* const event_log_; | 490 std::unique_ptr<voe::RtcEventLogProxy> event_log_proxy_; |
490 | 491 |
491 std::unique_ptr<RtpHeaderParser> rtp_header_parser_; | 492 std::unique_ptr<RtpHeaderParser> rtp_header_parser_; |
492 std::unique_ptr<RTPPayloadRegistry> rtp_payload_registry_; | 493 std::unique_ptr<RTPPayloadRegistry> rtp_payload_registry_; |
493 std::unique_ptr<ReceiveStatistics> rtp_receive_statistics_; | 494 std::unique_ptr<ReceiveStatistics> rtp_receive_statistics_; |
494 std::unique_ptr<StatisticsProxy> statistics_proxy_; | 495 std::unique_ptr<StatisticsProxy> statistics_proxy_; |
495 std::unique_ptr<RtpReceiver> rtp_receiver_; | 496 std::unique_ptr<RtpReceiver> rtp_receiver_; |
496 TelephoneEventHandler* telephone_event_handler_; | 497 TelephoneEventHandler* telephone_event_handler_; |
497 std::unique_ptr<RtpRtcp> _rtpRtcpModule; | 498 std::unique_ptr<RtpRtcp> _rtpRtcpModule; |
498 std::unique_ptr<AudioCodingModule> audio_coding_; | 499 std::unique_ptr<AudioCodingModule> audio_coding_; |
499 acm2::CodecManager codec_manager_; | 500 acm2::CodecManager codec_manager_; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 std::unique_ptr<RtpPacketSenderProxy> rtp_packet_sender_proxy_; | 590 std::unique_ptr<RtpPacketSenderProxy> rtp_packet_sender_proxy_; |
590 | 591 |
591 // TODO(ossu): Remove once GetAudioDecoderFactory() is no longer needed. | 592 // TODO(ossu): Remove once GetAudioDecoderFactory() is no longer needed. |
592 rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_; | 593 rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_; |
593 }; | 594 }; |
594 | 595 |
595 } // namespace voe | 596 } // namespace voe |
596 } // namespace webrtc | 597 } // namespace webrtc |
597 | 598 |
598 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_H_ | 599 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_H_ |
OLD | NEW |