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

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

Issue 1340573002: Refactor RTPPacketHistory to use a packet struct. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: remove max packet size as a parameter Created 5 years, 3 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 | « webrtc/modules/rtp_rtcp/source/rtp_packet_history_unittest.cc ('k') | no next file » | 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 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after
1019 if (capture_time_ms > 0) { 1019 if (capture_time_ms > 0) {
1020 UpdateTransmissionTimeOffset(buffer, payload_length + rtp_header_length, 1020 UpdateTransmissionTimeOffset(buffer, payload_length + rtp_header_length,
1021 rtp_header, now_ms - capture_time_ms); 1021 rtp_header, now_ms - capture_time_ms);
1022 } 1022 }
1023 1023
1024 UpdateAbsoluteSendTime(buffer, payload_length + rtp_header_length, 1024 UpdateAbsoluteSendTime(buffer, payload_length + rtp_header_length,
1025 rtp_header, now_ms); 1025 rtp_header, now_ms);
1026 1026
1027 // Used for NACK and to spread out the transmission of packets. 1027 // Used for NACK and to spread out the transmission of packets.
1028 if (packet_history_.PutRTPPacket(buffer, rtp_header_length + payload_length, 1028 if (packet_history_.PutRTPPacket(buffer, rtp_header_length + payload_length,
1029 max_payload_length_, capture_time_ms, 1029 capture_time_ms, storage) != 0) {
1030 storage) != 0) {
1031 return -1; 1030 return -1;
1032 } 1031 }
1033 1032
1034 if (paced_sender_ && storage != kDontStore) { 1033 if (paced_sender_ && storage != kDontStore) {
1035 // Correct offset between implementations of millisecond time stamps in 1034 // Correct offset between implementations of millisecond time stamps in
1036 // TickTime and Clock. 1035 // TickTime and Clock.
1037 int64_t corrected_time_ms = capture_time_ms + clock_delta_ms_; 1036 int64_t corrected_time_ms = capture_time_ms + clock_delta_ms_;
1038 if (!paced_sender_->SendPacket(priority, rtp_header.ssrc, 1037 if (!paced_sender_->SendPacket(priority, rtp_header.ssrc,
1039 rtp_header.sequenceNumber, corrected_time_ms, 1038 rtp_header.sequenceNumber, corrected_time_ms,
1040 payload_length, false)) { 1039 payload_length, false)) {
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after
1898 CriticalSectionScoped lock(send_critsect_.get()); 1897 CriticalSectionScoped lock(send_critsect_.get());
1899 1898
1900 RtpState state; 1899 RtpState state;
1901 state.sequence_number = sequence_number_rtx_; 1900 state.sequence_number = sequence_number_rtx_;
1902 state.start_timestamp = start_timestamp_; 1901 state.start_timestamp = start_timestamp_;
1903 1902
1904 return state; 1903 return state;
1905 } 1904 }
1906 1905
1907 } // namespace webrtc 1906 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_packet_history_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698