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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
171 { | 171 { |
172 public: | 172 public: |
173 friend class VoERtcpObserver; | 173 friend class VoERtcpObserver; |
174 | 174 |
175 enum { KNumSocketThreads = 1 }; | 175 enum { KNumSocketThreads = 1 }; |
176 enum { KNumberOfSocketBuffers = 8 }; | 176 enum { KNumberOfSocketBuffers = 8 }; |
177 virtual ~Channel(); | 177 virtual ~Channel(); |
178 static int32_t CreateChannel(Channel*& channel, | 178 static int32_t CreateChannel(Channel*& channel, |
179 int32_t channelId, | 179 int32_t channelId, |
180 uint32_t instanceId, | 180 uint32_t instanceId, |
181 RtcEventLog* const event_log, | |
182 const Config& config); | 181 const Config& config); |
183 Channel(int32_t channelId, | 182 Channel(int32_t channelId, |
184 uint32_t instanceId, | 183 uint32_t instanceId, |
185 RtcEventLog* const event_log, | |
186 const Config& config); | 184 const Config& config); |
187 int32_t Init(); | 185 int32_t Init(); |
188 int32_t SetEngineInformation(Statistics& engineStatistics, | 186 int32_t SetEngineInformation(Statistics& engineStatistics, |
189 OutputMixer& outputMixer, | 187 OutputMixer& outputMixer, |
190 TransmitMixer& transmitMixer, | 188 TransmitMixer& transmitMixer, |
191 ProcessThread& moduleProcessThread, | 189 ProcessThread& moduleProcessThread, |
192 AudioDeviceModule& audioDeviceModule, | 190 AudioDeviceModule& audioDeviceModule, |
193 VoiceEngineObserver* voiceEngineObserver, | 191 VoiceEngineObserver* voiceEngineObserver, |
194 rtc::CriticalSection* callbackCritSect); | 192 rtc::CriticalSection* callbackCritSect); |
195 int32_t UpdateLocalTimeStamp(); | 193 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. | 446 // Used for obtaining RTT for a receive-only channel. |
449 void set_associate_send_channel(const ChannelOwner& channel) { | 447 void set_associate_send_channel(const ChannelOwner& channel) { |
450 assert(_channelId != channel.channel()->ChannelId()); | 448 assert(_channelId != channel.channel()->ChannelId()); |
451 rtc::CritScope lock(&assoc_send_channel_lock_); | 449 rtc::CritScope lock(&assoc_send_channel_lock_); |
452 associate_send_channel_ = channel; | 450 associate_send_channel_ = channel; |
453 } | 451 } |
454 | 452 |
455 // Disassociate a send channel if it was associated. | 453 // Disassociate a send channel if it was associated. |
456 void DisassociateSendChannel(int channel_id); | 454 void DisassociateSendChannel(int channel_id); |
457 | 455 |
456 // Set a RtcEventLog logging object. | |
457 void SetRtcEventLog(RtcEventLog* event_log) { | |
458 rtc::CritScope lock(&event_log_lock_); | |
459 event_log_ = 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 RtcEventLog* event_log_ GUARDED_BY(event_log_lock_); |
500 rtc::CriticalSection event_log_lock_; | |
the sun
2016/03/03 09:25:13
nit: declare the lock above the members it protect
ivoc
2016/03/10 13:15:36
The lock is gone due to the proxy object.
| |
496 | 501 |
497 std::unique_ptr<RtpHeaderParser> rtp_header_parser_; | 502 std::unique_ptr<RtpHeaderParser> rtp_header_parser_; |
498 std::unique_ptr<RTPPayloadRegistry> rtp_payload_registry_; | 503 std::unique_ptr<RTPPayloadRegistry> rtp_payload_registry_; |
499 std::unique_ptr<ReceiveStatistics> rtp_receive_statistics_; | 504 std::unique_ptr<ReceiveStatistics> rtp_receive_statistics_; |
500 std::unique_ptr<StatisticsProxy> statistics_proxy_; | 505 std::unique_ptr<StatisticsProxy> statistics_proxy_; |
501 std::unique_ptr<RtpReceiver> rtp_receiver_; | 506 std::unique_ptr<RtpReceiver> rtp_receiver_; |
502 TelephoneEventHandler* telephone_event_handler_; | 507 TelephoneEventHandler* telephone_event_handler_; |
503 std::unique_ptr<RtpRtcp> _rtpRtcpModule; | 508 std::unique_ptr<RtpRtcp> _rtpRtcpModule; |
504 std::unique_ptr<AudioCodingModule> audio_coding_; | 509 std::unique_ptr<AudioCodingModule> audio_coding_; |
505 std::unique_ptr<AudioSinkInterface> audio_sink_; | 510 std::unique_ptr<AudioSinkInterface> audio_sink_; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
595 PacketRouter* packet_router_ = nullptr; | 600 PacketRouter* packet_router_ = nullptr; |
596 std::unique_ptr<TransportFeedbackProxy> feedback_observer_proxy_; | 601 std::unique_ptr<TransportFeedbackProxy> feedback_observer_proxy_; |
597 std::unique_ptr<TransportSequenceNumberProxy> seq_num_allocator_proxy_; | 602 std::unique_ptr<TransportSequenceNumberProxy> seq_num_allocator_proxy_; |
598 std::unique_ptr<RtpPacketSenderProxy> rtp_packet_sender_proxy_; | 603 std::unique_ptr<RtpPacketSenderProxy> rtp_packet_sender_proxy_; |
599 }; | 604 }; |
600 | 605 |
601 } // namespace voe | 606 } // namespace voe |
602 } // namespace webrtc | 607 } // namespace webrtc |
603 | 608 |
604 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_H_ | 609 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_H_ |
OLD | NEW |