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 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
677 PacketOptions options; | 677 PacketOptions options; |
678 if (using_transport_seq) { | 678 if (using_transport_seq) { |
679 options.packet_id = | 679 options.packet_id = |
680 UpdateTransportSequenceNumber(padding_packet, length, rtp_header); | 680 UpdateTransportSequenceNumber(padding_packet, length, rtp_header); |
681 } | 681 } |
682 | 682 |
683 if (!SendPacketToNetwork(padding_packet, length, options)) | 683 if (!SendPacketToNetwork(padding_packet, length, options)) |
684 break; | 684 break; |
685 | 685 |
686 if (using_transport_seq && transport_feedback_observer_) { | 686 if (using_transport_seq && transport_feedback_observer_) { |
687 transport_feedback_observer_->OnSentPacket( | 687 transport_feedback_observer_->AddPacket(options.packet_id, length, true); |
688 PacketInfo(0, now_ms, options.packet_id, length, true)); | |
689 } | 688 } |
690 | 689 |
691 bytes_sent += padding_bytes_in_packet; | 690 bytes_sent += padding_bytes_in_packet; |
692 UpdateRtpStats(padding_packet, length, rtp_header, over_rtx, false); | 691 UpdateRtpStats(padding_packet, length, rtp_header, over_rtx, false); |
693 } | 692 } |
694 | 693 |
695 return bytes_sent; | 694 return bytes_sent; |
696 } | 695 } |
697 | 696 |
698 void RTPSender::SetStorePacketsStatus(bool enable, uint16_t number_to_store) { | 697 void RTPSender::SetStorePacketsStatus(bool enable, uint16_t number_to_store) { |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
940 options.packet_id = | 939 options.packet_id = |
941 UpdateTransportSequenceNumber(buffer_to_send_ptr, length, rtp_header); | 940 UpdateTransportSequenceNumber(buffer_to_send_ptr, length, rtp_header); |
942 } | 941 } |
943 | 942 |
944 bool ret = SendPacketToNetwork(buffer_to_send_ptr, length, options); | 943 bool ret = SendPacketToNetwork(buffer_to_send_ptr, length, options); |
945 if (ret) { | 944 if (ret) { |
946 CriticalSectionScoped lock(send_critsect_.get()); | 945 CriticalSectionScoped lock(send_critsect_.get()); |
947 media_has_been_sent_ = true; | 946 media_has_been_sent_ = true; |
948 } | 947 } |
949 if (using_transport_seq && transport_feedback_observer_) { | 948 if (using_transport_seq && transport_feedback_observer_) { |
950 transport_feedback_observer_->OnSentPacket( | 949 transport_feedback_observer_->AddPacket(options.packet_id, length, true); |
951 PacketInfo(0, now_ms, options.packet_id, length, true)); | |
952 } | 950 } |
953 UpdateRtpStats(buffer_to_send_ptr, length, rtp_header, send_over_rtx, | 951 UpdateRtpStats(buffer_to_send_ptr, length, rtp_header, send_over_rtx, |
954 is_retransmit); | 952 is_retransmit); |
955 return ret; | 953 return ret; |
956 } | 954 } |
957 | 955 |
958 void RTPSender::UpdateRtpStats(const uint8_t* buffer, | 956 void RTPSender::UpdateRtpStats(const uint8_t* buffer, |
959 size_t packet_length, | 957 size_t packet_length, |
960 const RTPHeader& header, | 958 const RTPHeader& header, |
961 bool is_rtx, | 959 bool is_rtx, |
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1904 CriticalSectionScoped lock(send_critsect_.get()); | 1902 CriticalSectionScoped lock(send_critsect_.get()); |
1905 | 1903 |
1906 RtpState state; | 1904 RtpState state; |
1907 state.sequence_number = sequence_number_rtx_; | 1905 state.sequence_number = sequence_number_rtx_; |
1908 state.start_timestamp = start_timestamp_; | 1906 state.start_timestamp = start_timestamp_; |
1909 | 1907 |
1910 return state; | 1908 return state; |
1911 } | 1909 } |
1912 | 1910 |
1913 } // namespace webrtc | 1911 } // namespace webrtc |
OLD | NEW |