| 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_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_ | 11 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_ |
| 12 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_ | 12 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_ |
| 13 | 13 |
| 14 #include <list> | 14 #include <list> |
| 15 #include <map> | 15 #include <map> |
| 16 #include <utility> | 16 #include <utility> |
| 17 #include <vector> | 17 #include <vector> |
| 18 | 18 |
| 19 #include "webrtc/base/random.h" |
| 19 #include "webrtc/base/thread_annotations.h" | 20 #include "webrtc/base/thread_annotations.h" |
| 20 #include "webrtc/common_types.h" | 21 #include "webrtc/common_types.h" |
| 21 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" | 22 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
| 22 #include "webrtc/modules/rtp_rtcp/source/bitrate.h" | 23 #include "webrtc/modules/rtp_rtcp/source/bitrate.h" |
| 23 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extension.h" | 24 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extension.h" |
| 24 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_history.h" | 25 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_history.h" |
| 25 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_config.h" | 26 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_config.h" |
| 26 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" | 27 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" |
| 27 #include "webrtc/modules/rtp_rtcp/source/ssrc_database.h" | 28 #include "webrtc/modules/rtp_rtcp/source/ssrc_database.h" |
| 28 #include "webrtc/transport.h" | 29 #include "webrtc/transport.h" |
| 29 | 30 |
| 30 #define MAX_INIT_RTP_SEQ_NUMBER 32767 // 2^15 -1. | |
| 31 | |
| 32 namespace webrtc { | 31 namespace webrtc { |
| 33 | 32 |
| 34 class BitrateAggregator; | 33 class BitrateAggregator; |
| 35 class CriticalSectionWrapper; | 34 class CriticalSectionWrapper; |
| 36 class RTPSenderAudio; | 35 class RTPSenderAudio; |
| 37 class RTPSenderVideo; | 36 class RTPSenderVideo; |
| 38 | 37 |
| 39 class RTPSenderInterface { | 38 class RTPSenderInterface { |
| 40 public: | 39 public: |
| 41 RTPSenderInterface() {} | 40 RTPSenderInterface() {} |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 | 379 |
| 381 void UpdateRtpStats(const uint8_t* buffer, | 380 void UpdateRtpStats(const uint8_t* buffer, |
| 382 size_t packet_length, | 381 size_t packet_length, |
| 383 const RTPHeader& header, | 382 const RTPHeader& header, |
| 384 bool is_rtx, | 383 bool is_rtx, |
| 385 bool is_retransmit); | 384 bool is_retransmit); |
| 386 bool IsFecPacket(const uint8_t* buffer, const RTPHeader& header) const; | 385 bool IsFecPacket(const uint8_t* buffer, const RTPHeader& header) const; |
| 387 | 386 |
| 388 Clock* clock_; | 387 Clock* clock_; |
| 389 int64_t clock_delta_ms_; | 388 int64_t clock_delta_ms_; |
| 389 Random random_ GUARDED_BY(send_critsect_); |
| 390 | 390 |
| 391 rtc::scoped_ptr<BitrateAggregator> bitrates_; | 391 rtc::scoped_ptr<BitrateAggregator> bitrates_; |
| 392 Bitrate total_bitrate_sent_; | 392 Bitrate total_bitrate_sent_; |
| 393 | 393 |
| 394 const bool audio_configured_; | 394 const bool audio_configured_; |
| 395 rtc::scoped_ptr<RTPSenderAudio> audio_; | 395 rtc::scoped_ptr<RTPSenderAudio> audio_; |
| 396 rtc::scoped_ptr<RTPSenderVideo> video_; | 396 rtc::scoped_ptr<RTPSenderVideo> video_; |
| 397 | 397 |
| 398 RtpPacketSender* const paced_sender_; | 398 RtpPacketSender* const paced_sender_; |
| 399 TransportSequenceNumberAllocator* const transport_sequence_number_allocator_; | 399 TransportSequenceNumberAllocator* const transport_sequence_number_allocator_; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 // SetTargetBitrateKbps or GetTargetBitrateKbps. Also remember | 462 // SetTargetBitrateKbps or GetTargetBitrateKbps. Also remember |
| 463 // that by the time the function returns there is no guarantee | 463 // that by the time the function returns there is no guarantee |
| 464 // that the target bitrate is still valid. | 464 // that the target bitrate is still valid. |
| 465 rtc::scoped_ptr<CriticalSectionWrapper> target_bitrate_critsect_; | 465 rtc::scoped_ptr<CriticalSectionWrapper> target_bitrate_critsect_; |
| 466 uint32_t target_bitrate_ GUARDED_BY(target_bitrate_critsect_); | 466 uint32_t target_bitrate_ GUARDED_BY(target_bitrate_critsect_); |
| 467 }; | 467 }; |
| 468 | 468 |
| 469 } // namespace webrtc | 469 } // namespace webrtc |
| 470 | 470 |
| 471 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_ | 471 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_ |
| OLD | NEW |