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 | |
699 if (!packet_history_.GetPacketAndSetSendTime(packet_id, min_resend_time, true, | 698 if (!packet_history_.GetPacketAndSetSendTime(packet_id, min_resend_time, true, |
700 data_buffer, &length, | 699 data_buffer, &length, |
701 &capture_time_ms)) { | 700 &capture_time_ms)) { |
702 // Packet not found. | 701 // Packet not found. |
703 return 0; | 702 return 0; |
704 } | 703 } |
705 | 704 |
706 if (paced_sender_) { | 705 if (paced_sender_) { |
707 RtpUtility::RtpHeaderParser rtp_parser(data_buffer, length); | 706 RtpUtility::RtpHeaderParser rtp_parser(data_buffer, length); |
708 RTPHeader header; | 707 RTPHeader header; |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 | 915 |
917 int64_t now_ms = clock_->TimeInMilliseconds(); | 916 int64_t now_ms = clock_->TimeInMilliseconds(); |
918 int64_t diff_ms = now_ms - capture_time_ms; | 917 int64_t diff_ms = now_ms - capture_time_ms; |
919 UpdateTransmissionTimeOffset(buffer_to_send_ptr, length, rtp_header, | 918 UpdateTransmissionTimeOffset(buffer_to_send_ptr, length, rtp_header, |
920 diff_ms); | 919 diff_ms); |
921 UpdateAbsoluteSendTime(buffer_to_send_ptr, length, rtp_header, now_ms); | 920 UpdateAbsoluteSendTime(buffer_to_send_ptr, length, rtp_header, now_ms); |
922 | 921 |
923 // TODO(sprang): Potentially too much overhead in IsRegistered()? | 922 // TODO(sprang): Potentially too much overhead in IsRegistered()? |
924 bool using_transport_seq = rtp_header_extension_map_.IsRegistered( | 923 bool using_transport_seq = rtp_header_extension_map_.IsRegistered( |
925 kRtpExtensionTransportSequenceNumber) && | 924 kRtpExtensionTransportSequenceNumber) && |
926 transport_sequence_number_allocator_; | 925 transport_sequence_number_allocator_ && |
927 | 926 !is_retransmit; |
928 PacketOptions options; | 927 PacketOptions options; |
929 if (using_transport_seq) { | 928 if (using_transport_seq) { |
930 options.packet_id = | 929 options.packet_id = |
931 UpdateTransportSequenceNumber(buffer_to_send_ptr, length, rtp_header); | 930 UpdateTransportSequenceNumber(buffer_to_send_ptr, length, rtp_header); |
932 } | 931 } |
933 | 932 |
934 bool ret = SendPacketToNetwork(buffer_to_send_ptr, length, options); | 933 bool ret = SendPacketToNetwork(buffer_to_send_ptr, length, options); |
935 if (ret) { | 934 if (ret) { |
936 CriticalSectionScoped lock(send_critsect_.get()); | 935 CriticalSectionScoped lock(send_critsect_.get()); |
937 media_has_been_sent_ = true; | 936 media_has_been_sent_ = true; |
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1905 CriticalSectionScoped lock(send_critsect_.get()); | 1904 CriticalSectionScoped lock(send_critsect_.get()); |
1906 | 1905 |
1907 RtpState state; | 1906 RtpState state; |
1908 state.sequence_number = sequence_number_rtx_; | 1907 state.sequence_number = sequence_number_rtx_; |
1909 state.start_timestamp = start_timestamp_; | 1908 state.start_timestamp = start_timestamp_; |
1910 | 1909 |
1911 return state; | 1910 return state; |
1912 } | 1911 } |
1913 | 1912 |
1914 } // namespace webrtc | 1913 } // namespace webrtc |
OLD | NEW |