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 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 } | 688 } |
689 | 689 |
690 bool RTPSender::StorePackets() const { | 690 bool RTPSender::StorePackets() const { |
691 return packet_history_.StorePackets(); | 691 return packet_history_.StorePackets(); |
692 } | 692 } |
693 | 693 |
694 int32_t RTPSender::ReSendPacket(uint16_t packet_id, int64_t min_resend_time) { | 694 int32_t RTPSender::ReSendPacket(uint16_t packet_id, int64_t min_resend_time) { |
695 size_t length = IP_PACKET_SIZE; | 695 size_t length = IP_PACKET_SIZE; |
696 uint8_t data_buffer[IP_PACKET_SIZE]; | 696 uint8_t data_buffer[IP_PACKET_SIZE]; |
697 int64_t capture_time_ms; | 697 int64_t capture_time_ms; |
| 698 |
698 if (!packet_history_.GetPacketAndSetSendTime(packet_id, min_resend_time, true, | 699 if (!packet_history_.GetPacketAndSetSendTime(packet_id, min_resend_time, true, |
699 data_buffer, &length, | 700 data_buffer, &length, |
700 &capture_time_ms)) { | 701 &capture_time_ms)) { |
701 // Packet not found. | 702 // Packet not found. |
702 return 0; | 703 return 0; |
703 } | 704 } |
704 | 705 |
705 if (paced_sender_) { | 706 if (paced_sender_) { |
706 RtpUtility::RtpHeaderParser rtp_parser(data_buffer, length); | 707 RtpUtility::RtpHeaderParser rtp_parser(data_buffer, length); |
707 RTPHeader header; | 708 RTPHeader header; |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
913 | 914 |
914 int64_t now_ms = clock_->TimeInMilliseconds(); | 915 int64_t now_ms = clock_->TimeInMilliseconds(); |
915 int64_t diff_ms = now_ms - capture_time_ms; | 916 int64_t diff_ms = now_ms - capture_time_ms; |
916 UpdateTransmissionTimeOffset(buffer_to_send_ptr, length, rtp_header, | 917 UpdateTransmissionTimeOffset(buffer_to_send_ptr, length, rtp_header, |
917 diff_ms); | 918 diff_ms); |
918 UpdateAbsoluteSendTime(buffer_to_send_ptr, length, rtp_header, now_ms); | 919 UpdateAbsoluteSendTime(buffer_to_send_ptr, length, rtp_header, now_ms); |
919 | 920 |
920 // TODO(sprang): Potentially too much overhead in IsRegistered()? | 921 // TODO(sprang): Potentially too much overhead in IsRegistered()? |
921 bool using_transport_seq = rtp_header_extension_map_.IsRegistered( | 922 bool using_transport_seq = rtp_header_extension_map_.IsRegistered( |
922 kRtpExtensionTransportSequenceNumber) && | 923 kRtpExtensionTransportSequenceNumber) && |
923 transport_sequence_number_allocator_ && | 924 transport_sequence_number_allocator_; |
924 !is_retransmit; | 925 |
925 PacketOptions options; | 926 PacketOptions options; |
926 if (using_transport_seq) { | 927 if (using_transport_seq) { |
927 options.packet_id = | 928 options.packet_id = |
928 UpdateTransportSequenceNumber(buffer_to_send_ptr, length, rtp_header); | 929 UpdateTransportSequenceNumber(buffer_to_send_ptr, length, rtp_header); |
929 } | 930 } |
930 | 931 |
931 bool ret = SendPacketToNetwork(buffer_to_send_ptr, length, options); | 932 bool ret = SendPacketToNetwork(buffer_to_send_ptr, length, options); |
932 if (ret) { | 933 if (ret) { |
933 CriticalSectionScoped lock(send_critsect_.get()); | 934 CriticalSectionScoped lock(send_critsect_.get()); |
934 media_has_been_sent_ = true; | 935 media_has_been_sent_ = true; |
(...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1891 CriticalSectionScoped lock(send_critsect_.get()); | 1892 CriticalSectionScoped lock(send_critsect_.get()); |
1892 | 1893 |
1893 RtpState state; | 1894 RtpState state; |
1894 state.sequence_number = sequence_number_rtx_; | 1895 state.sequence_number = sequence_number_rtx_; |
1895 state.start_timestamp = start_timestamp_; | 1896 state.start_timestamp = start_timestamp_; |
1896 | 1897 |
1897 return state; | 1898 return state; |
1898 } | 1899 } |
1899 | 1900 |
1900 } // namespace webrtc | 1901 } // namespace webrtc |
OLD | NEW |