| 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 bool RTPSender::IsRtpHeaderExtensionRegistered(RTPExtensionType type) { | 215 bool RTPSender::IsRtpHeaderExtensionRegistered(RTPExtensionType type) { |
| 216 rtc::CritScope lock(&send_critsect_); | 216 rtc::CritScope lock(&send_critsect_); |
| 217 return rtp_header_extension_map_.IsRegistered(type); | 217 return rtp_header_extension_map_.IsRegistered(type); |
| 218 } | 218 } |
| 219 | 219 |
| 220 int32_t RTPSender::DeregisterRtpHeaderExtension(RTPExtensionType type) { | 220 int32_t RTPSender::DeregisterRtpHeaderExtension(RTPExtensionType type) { |
| 221 rtc::CritScope lock(&send_critsect_); | 221 rtc::CritScope lock(&send_critsect_); |
| 222 return rtp_header_extension_map_.Deregister(type); | 222 return rtp_header_extension_map_.Deregister(type); |
| 223 } | 223 } |
| 224 | 224 |
| 225 size_t RTPSender::RtpHeaderExtensionLength() const { | |
| 226 rtc::CritScope lock(&send_critsect_); | |
| 227 return rtp_header_extension_map_.GetTotalLengthInBytes(); | |
| 228 } | |
| 229 | |
| 230 int32_t RTPSender::RegisterPayload( | 225 int32_t RTPSender::RegisterPayload( |
| 231 const char payload_name[RTP_PAYLOAD_NAME_SIZE], | 226 const char payload_name[RTP_PAYLOAD_NAME_SIZE], |
| 232 int8_t payload_number, | 227 int8_t payload_number, |
| 233 uint32_t frequency, | 228 uint32_t frequency, |
| 234 size_t channels, | 229 size_t channels, |
| 235 uint32_t rate) { | 230 uint32_t rate) { |
| 236 RTC_DCHECK_LT(strlen(payload_name), RTP_PAYLOAD_NAME_SIZE); | 231 RTC_DCHECK_LT(strlen(payload_name), RTP_PAYLOAD_NAME_SIZE); |
| 237 rtc::CritScope lock(&send_critsect_); | 232 rtc::CritScope lock(&send_critsect_); |
| 238 | 233 |
| 239 std::map<int8_t, RtpUtility::Payload*>::iterator it = | 234 std::map<int8_t, RtpUtility::Payload*>::iterator it = |
| (...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 971 | 966 |
| 972 rtc::CritScope lock(&statistics_crit_); | 967 rtc::CritScope lock(&statistics_crit_); |
| 973 bitrate_callback_->Notify(total_bitrate_sent_.Rate(now_ms).value_or(0), | 968 bitrate_callback_->Notify(total_bitrate_sent_.Rate(now_ms).value_or(0), |
| 974 nack_bitrate_sent_.Rate(now_ms).value_or(0), ssrc); | 969 nack_bitrate_sent_.Rate(now_ms).value_or(0), ssrc); |
| 975 } | 970 } |
| 976 | 971 |
| 977 size_t RTPSender::RtpHeaderLength() const { | 972 size_t RTPSender::RtpHeaderLength() const { |
| 978 rtc::CritScope lock(&send_critsect_); | 973 rtc::CritScope lock(&send_critsect_); |
| 979 size_t rtp_header_length = kRtpHeaderLength; | 974 size_t rtp_header_length = kRtpHeaderLength; |
| 980 rtp_header_length += sizeof(uint32_t) * csrcs_.size(); | 975 rtp_header_length += sizeof(uint32_t) * csrcs_.size(); |
| 981 rtp_header_length += RtpHeaderExtensionLength(); | 976 rtp_header_length += rtp_header_extension_map_.GetTotalLengthInBytes(); |
| 982 return rtp_header_length; | 977 return rtp_header_length; |
| 983 } | 978 } |
| 984 | 979 |
| 985 uint16_t RTPSender::AllocateSequenceNumber(uint16_t packets_to_send) { | 980 uint16_t RTPSender::AllocateSequenceNumber(uint16_t packets_to_send) { |
| 986 rtc::CritScope lock(&send_critsect_); | 981 rtc::CritScope lock(&send_critsect_); |
| 987 uint16_t first_allocated_sequence_number = sequence_number_; | 982 uint16_t first_allocated_sequence_number = sequence_number_; |
| 988 sequence_number_ += packets_to_send; | 983 sequence_number_ += packets_to_send; |
| 989 return first_allocated_sequence_number; | 984 return first_allocated_sequence_number; |
| 990 } | 985 } |
| 991 | 986 |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1315 return; | 1310 return; |
| 1316 } | 1311 } |
| 1317 rtp_overhead_bytes_per_packet_ = packet.headers_size(); | 1312 rtp_overhead_bytes_per_packet_ = packet.headers_size(); |
| 1318 overhead_bytes_per_packet = | 1313 overhead_bytes_per_packet = |
| 1319 rtp_overhead_bytes_per_packet_ + transport_overhead_bytes_per_packet_; | 1314 rtp_overhead_bytes_per_packet_ + transport_overhead_bytes_per_packet_; |
| 1320 } | 1315 } |
| 1321 overhead_observer_->OnOverheadChanged(overhead_bytes_per_packet); | 1316 overhead_observer_->OnOverheadChanged(overhead_bytes_per_packet); |
| 1322 } | 1317 } |
| 1323 | 1318 |
| 1324 } // namespace webrtc | 1319 } // namespace webrtc |
| OLD | NEW |