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 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1094 return rtp_header_length; | 1094 return rtp_header_length; |
1095 } | 1095 } |
1096 | 1096 |
1097 uint16_t RTPSender::AllocateSequenceNumber(uint16_t packets_to_send) { | 1097 uint16_t RTPSender::AllocateSequenceNumber(uint16_t packets_to_send) { |
1098 CriticalSectionScoped cs(send_critsect_.get()); | 1098 CriticalSectionScoped cs(send_critsect_.get()); |
1099 uint16_t first_allocated_sequence_number = sequence_number_; | 1099 uint16_t first_allocated_sequence_number = sequence_number_; |
1100 sequence_number_ += packets_to_send; | 1100 sequence_number_ += packets_to_send; |
1101 return first_allocated_sequence_number; | 1101 return first_allocated_sequence_number; |
1102 } | 1102 } |
1103 | 1103 |
1104 void RTPSender::ResetDataCounters() { | |
1105 uint32_t ssrc; | |
1106 uint32_t ssrc_rtx; | |
1107 bool report_rtx; | |
1108 { | |
1109 CriticalSectionScoped ssrc_lock(send_critsect_.get()); | |
1110 ssrc = ssrc_; | |
1111 ssrc_rtx = ssrc_rtx_; | |
1112 report_rtx = rtx_ != kRtxOff; | |
1113 } | |
1114 CriticalSectionScoped lock(statistics_crit_.get()); | |
1115 rtp_stats_ = StreamDataCounters(); | |
1116 rtx_rtp_stats_ = StreamDataCounters(); | |
1117 if (rtp_stats_callback_) { | |
1118 rtp_stats_callback_->DataCountersUpdated(rtp_stats_, ssrc); | |
1119 if (report_rtx) | |
1120 rtp_stats_callback_->DataCountersUpdated(rtx_rtp_stats_, ssrc_rtx); | |
1121 } | |
1122 } | |
1123 | |
1124 void RTPSender::GetDataCounters(StreamDataCounters* rtp_stats, | 1104 void RTPSender::GetDataCounters(StreamDataCounters* rtp_stats, |
1125 StreamDataCounters* rtx_stats) const { | 1105 StreamDataCounters* rtx_stats) const { |
1126 CriticalSectionScoped lock(statistics_crit_.get()); | 1106 CriticalSectionScoped lock(statistics_crit_.get()); |
1127 *rtp_stats = rtp_stats_; | 1107 *rtp_stats = rtp_stats_; |
1128 *rtx_stats = rtx_rtp_stats_; | 1108 *rtx_stats = rtx_rtp_stats_; |
1129 } | 1109 } |
1130 | 1110 |
1131 size_t RTPSender::CreateRtpHeader(uint8_t* header, | 1111 size_t RTPSender::CreateRtpHeader(uint8_t* header, |
1132 int8_t payload_type, | 1112 int8_t payload_type, |
1133 uint32_t ssrc, | 1113 uint32_t ssrc, |
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1877 CriticalSectionScoped lock(send_critsect_.get()); | 1857 CriticalSectionScoped lock(send_critsect_.get()); |
1878 | 1858 |
1879 RtpState state; | 1859 RtpState state; |
1880 state.sequence_number = sequence_number_rtx_; | 1860 state.sequence_number = sequence_number_rtx_; |
1881 state.start_timestamp = start_timestamp_; | 1861 state.start_timestamp = start_timestamp_; |
1882 | 1862 |
1883 return state; | 1863 return state; |
1884 } | 1864 } |
1885 | 1865 |
1886 } // namespace webrtc | 1866 } // namespace webrtc |
OLD | NEW |