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 "webrtc/base/criticalsection.h" |
14 #include "webrtc/base/scoped_ptr.h" | 15 #include "webrtc/base/scoped_ptr.h" |
| 16 #include "webrtc/base/thread_checker.h" |
| 17 #include "webrtc/call/congestion_controller.h" |
15 #include "webrtc/common_audio/resampler/include/push_resampler.h" | 18 #include "webrtc/common_audio/resampler/include/push_resampler.h" |
16 #include "webrtc/common_types.h" | 19 #include "webrtc/common_types.h" |
17 #include "webrtc/modules/audio_coding/include/audio_coding_module.h" | 20 #include "webrtc/modules/audio_coding/include/audio_coding_module.h" |
18 #include "webrtc/modules/audio_conference_mixer/include/audio_conference_mixer_d
efines.h" | 21 #include "webrtc/modules/audio_conference_mixer/include/audio_conference_mixer_d
efines.h" |
19 #include "webrtc/modules/audio_processing/rms_level.h" | 22 #include "webrtc/modules/audio_processing/rms_level.h" |
20 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" | 23 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" |
| 24 #include "webrtc/modules/pacing/paced_sender.h" |
| 25 #include "webrtc/modules/pacing/packet_router.h" |
21 #include "webrtc/modules/rtp_rtcp/include/remote_ntp_time_estimator.h" | 26 #include "webrtc/modules/rtp_rtcp/include/remote_ntp_time_estimator.h" |
22 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" | 27 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" |
23 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" | 28 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" |
24 #include "webrtc/modules/utility/include/file_player.h" | 29 #include "webrtc/modules/utility/include/file_player.h" |
25 #include "webrtc/modules/utility/include/file_recorder.h" | 30 #include "webrtc/modules/utility/include/file_recorder.h" |
26 #include "webrtc/voice_engine/dtmf_inband.h" | 31 #include "webrtc/voice_engine/dtmf_inband.h" |
27 #include "webrtc/voice_engine/dtmf_inband_queue.h" | 32 #include "webrtc/voice_engine/dtmf_inband_queue.h" |
28 #include "webrtc/voice_engine/include/voe_audio_processing.h" | 33 #include "webrtc/voice_engine/include/voe_audio_processing.h" |
29 #include "webrtc/voice_engine/include/voe_network.h" | 34 #include "webrtc/voice_engine/include/voe_network.h" |
30 #include "webrtc/voice_engine/level_indicator.h" | 35 #include "webrtc/voice_engine/level_indicator.h" |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 #endif | 319 #endif |
315 | 320 |
316 // VoERTP_RTCP | 321 // VoERTP_RTCP |
317 int SetLocalSSRC(unsigned int ssrc); | 322 int SetLocalSSRC(unsigned int ssrc); |
318 int GetLocalSSRC(unsigned int& ssrc); | 323 int GetLocalSSRC(unsigned int& ssrc); |
319 int GetRemoteSSRC(unsigned int& ssrc); | 324 int GetRemoteSSRC(unsigned int& ssrc); |
320 int SetSendAudioLevelIndicationStatus(bool enable, unsigned char id); | 325 int SetSendAudioLevelIndicationStatus(bool enable, unsigned char id); |
321 int SetReceiveAudioLevelIndicationStatus(bool enable, unsigned char id); | 326 int SetReceiveAudioLevelIndicationStatus(bool enable, unsigned char id); |
322 int SetSendAbsoluteSenderTimeStatus(bool enable, unsigned char id); | 327 int SetSendAbsoluteSenderTimeStatus(bool enable, unsigned char id); |
323 int SetReceiveAbsoluteSenderTimeStatus(bool enable, unsigned char id); | 328 int SetReceiveAbsoluteSenderTimeStatus(bool enable, unsigned char id); |
| 329 void SetSendTransportSequenceNumber(int id); |
| 330 |
| 331 void SetCongestionControlObjects( |
| 332 RtpPacketSender* rtp_packet_sender, |
| 333 TransportFeedbackObserver* transport_feedback_observer, |
| 334 PacketRouter* packet_router); |
| 335 |
324 void SetRTCPStatus(bool enable); | 336 void SetRTCPStatus(bool enable); |
325 int GetRTCPStatus(bool& enabled); | 337 int GetRTCPStatus(bool& enabled); |
326 int SetRTCP_CNAME(const char cName[256]); | 338 int SetRTCP_CNAME(const char cName[256]); |
327 int GetRemoteRTCP_CNAME(char cName[256]); | 339 int GetRemoteRTCP_CNAME(char cName[256]); |
328 int GetRemoteRTCPData(unsigned int& NTPHigh, unsigned int& NTPLow, | 340 int GetRemoteRTCPData(unsigned int& NTPHigh, unsigned int& NTPLow, |
329 unsigned int& timestamp, | 341 unsigned int& timestamp, |
330 unsigned int& playoutTimestamp, unsigned int* jitter, | 342 unsigned int& playoutTimestamp, unsigned int* jitter, |
331 unsigned short* fractionLost); | 343 unsigned short* fractionLost); |
332 int SendApplicationDefinedRTCPPacket(unsigned char subType, | 344 int SendApplicationDefinedRTCPPacket(unsigned char subType, |
333 unsigned int name, const char* data, | 345 unsigned int name, const char* data, |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 associate_send_channel_ = channel; | 461 associate_send_channel_ = channel; |
450 } | 462 } |
451 | 463 |
452 // Disassociate a send channel if it was associated. | 464 // Disassociate a send channel if it was associated. |
453 void DisassociateSendChannel(int channel_id); | 465 void DisassociateSendChannel(int channel_id); |
454 | 466 |
455 protected: | 467 protected: |
456 void OnIncomingFractionLoss(int fraction_lost); | 468 void OnIncomingFractionLoss(int fraction_lost); |
457 | 469 |
458 private: | 470 private: |
| 471 RtpRtcp* CreateRtpRtcp( |
| 472 RtpPacketSender* packet_sender, |
| 473 TransportSequenceNumberAllocator* sequence_number_allocator, |
| 474 TransportFeedbackObserver* transport_feedback_callback); |
459 bool ReceivePacket(const uint8_t* packet, size_t packet_length, | 475 bool ReceivePacket(const uint8_t* packet, size_t packet_length, |
460 const RTPHeader& header, bool in_order); | 476 const RTPHeader& header, bool in_order); |
461 bool HandleRtxPacket(const uint8_t* packet, | 477 bool HandleRtxPacket(const uint8_t* packet, |
462 size_t packet_length, | 478 size_t packet_length, |
463 const RTPHeader& header); | 479 const RTPHeader& header); |
464 bool IsPacketInOrder(const RTPHeader& header) const; | 480 bool IsPacketInOrder(const RTPHeader& header) const; |
465 bool IsPacketRetransmitted(const RTPHeader& header, bool in_order) const; | 481 bool IsPacketRetransmitted(const RTPHeader& header, bool in_order) const; |
466 int ResendPackets(const uint16_t* sequence_numbers, int length); | 482 int ResendPackets(const uint16_t* sequence_numbers, int length); |
467 int InsertInbandDtmfTone(); | 483 int InsertInbandDtmfTone(); |
468 int32_t MixOrReplaceAudioWithFile(int mixingFrequency); | 484 int32_t MixOrReplaceAudioWithFile(int mixingFrequency); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 bool _RxVadDetection; | 593 bool _RxVadDetection; |
578 bool _rxAgcIsEnabled; | 594 bool _rxAgcIsEnabled; |
579 bool _rxNsIsEnabled; | 595 bool _rxNsIsEnabled; |
580 bool restored_packet_in_use_; | 596 bool restored_packet_in_use_; |
581 // RtcpBandwidthObserver | 597 // RtcpBandwidthObserver |
582 rtc::scoped_ptr<VoERtcpObserver> rtcp_observer_; | 598 rtc::scoped_ptr<VoERtcpObserver> rtcp_observer_; |
583 rtc::scoped_ptr<NetworkPredictor> network_predictor_; | 599 rtc::scoped_ptr<NetworkPredictor> network_predictor_; |
584 // An associated send channel. | 600 // An associated send channel. |
585 rtc::scoped_ptr<CriticalSectionWrapper> assoc_send_channel_lock_; | 601 rtc::scoped_ptr<CriticalSectionWrapper> assoc_send_channel_lock_; |
586 ChannelOwner associate_send_channel_ GUARDED_BY(assoc_send_channel_lock_); | 602 ChannelOwner associate_send_channel_ GUARDED_BY(assoc_send_channel_lock_); |
| 603 |
| 604 PacketRouter* packet_router_; |
587 }; | 605 }; |
588 | 606 |
589 } // namespace voe | 607 } // namespace voe |
590 } // namespace webrtc | 608 } // namespace webrtc |
591 | 609 |
592 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_H_ | 610 #endif // WEBRTC_VOICE_ENGINE_CHANNEL_H_ |
OLD | NEW |