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