Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtp_sender.cc

Issue 1385563005: Transport sequence number should be set also for retransmissions. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/video/end_to_end_tests.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
915 916
916 int64_t now_ms = clock_->TimeInMilliseconds(); 917 int64_t now_ms = clock_->TimeInMilliseconds();
917 int64_t diff_ms = now_ms - capture_time_ms; 918 int64_t diff_ms = now_ms - capture_time_ms;
918 UpdateTransmissionTimeOffset(buffer_to_send_ptr, length, rtp_header, 919 UpdateTransmissionTimeOffset(buffer_to_send_ptr, length, rtp_header,
919 diff_ms); 920 diff_ms);
920 UpdateAbsoluteSendTime(buffer_to_send_ptr, length, rtp_header, now_ms); 921 UpdateAbsoluteSendTime(buffer_to_send_ptr, length, rtp_header, now_ms);
921 922
922 // TODO(sprang): Potentially too much overhead in IsRegistered()? 923 // TODO(sprang): Potentially too much overhead in IsRegistered()?
923 bool using_transport_seq = rtp_header_extension_map_.IsRegistered( 924 bool using_transport_seq = rtp_header_extension_map_.IsRegistered(
924 kRtpExtensionTransportSequenceNumber) && 925 kRtpExtensionTransportSequenceNumber) &&
925 transport_sequence_number_allocator_ && 926 transport_sequence_number_allocator_;
926 !is_retransmit; 927
927 PacketOptions options; 928 PacketOptions options;
928 if (using_transport_seq) { 929 if (using_transport_seq) {
929 options.packet_id = 930 options.packet_id =
930 UpdateTransportSequenceNumber(buffer_to_send_ptr, length, rtp_header); 931 UpdateTransportSequenceNumber(buffer_to_send_ptr, length, rtp_header);
931 } 932 }
932 933
933 bool ret = SendPacketToNetwork(buffer_to_send_ptr, length, options); 934 bool ret = SendPacketToNetwork(buffer_to_send_ptr, length, options);
934 if (ret) { 935 if (ret) {
935 CriticalSectionScoped lock(send_critsect_.get()); 936 CriticalSectionScoped lock(send_critsect_.get());
936 media_has_been_sent_ = true; 937 media_has_been_sent_ = true;
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after
1904 CriticalSectionScoped lock(send_critsect_.get()); 1905 CriticalSectionScoped lock(send_critsect_.get());
1905 1906
1906 RtpState state; 1907 RtpState state;
1907 state.sequence_number = sequence_number_rtx_; 1908 state.sequence_number = sequence_number_rtx_;
1908 state.start_timestamp = start_timestamp_; 1909 state.start_timestamp = start_timestamp_;
1909 1910
1910 return state; 1911 return state;
1911 } 1912 }
1912 1913
1913 } // namespace webrtc 1914 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/video/end_to_end_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698