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

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

Issue 2918333002: Reland of Only compare sequence numbers from the same SSRC in ForwardErrorCorrection. (Closed)
Patch Set: Let ForwardErrorCorrection be aware of its SSRCs. Created 3 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 payload_type_(payload_type), 73 payload_type_(payload_type),
74 // Reset RTP state if this is not the first time we are operating. 74 // Reset RTP state if this is not the first time we are operating.
75 // Otherwise, randomize the initial timestamp offset and RTP sequence 75 // Otherwise, randomize the initial timestamp offset and RTP sequence
76 // numbers. (This is not intended to be cryptographically strong.) 76 // numbers. (This is not intended to be cryptographically strong.)
77 timestamp_offset_(rtp_state ? rtp_state->start_timestamp 77 timestamp_offset_(rtp_state ? rtp_state->start_timestamp
78 : random_.Rand<uint32_t>()), 78 : random_.Rand<uint32_t>()),
79 ssrc_(ssrc), 79 ssrc_(ssrc),
80 protected_media_ssrc_(protected_media_ssrc), 80 protected_media_ssrc_(protected_media_ssrc),
81 seq_num_(rtp_state ? rtp_state->sequence_number 81 seq_num_(rtp_state ? rtp_state->sequence_number
82 : random_.Rand(1, kMaxInitRtpSeqNumber)), 82 : random_.Rand(1, kMaxInitRtpSeqNumber)),
83 ulpfec_generator_(ForwardErrorCorrection::CreateFlexfec()), 83 ulpfec_generator_(
84 ForwardErrorCorrection::CreateFlexfec(ssrc, protected_media_ssrc)),
84 rtp_header_extension_map_(RegisterBweExtensions(rtp_header_extensions)), 85 rtp_header_extension_map_(RegisterBweExtensions(rtp_header_extensions)),
85 header_extensions_size_( 86 header_extensions_size_(
86 rtp_header_extension_map_.GetTotalLengthInBytes(extension_sizes)) { 87 rtp_header_extension_map_.GetTotalLengthInBytes(extension_sizes)) {
87 // This object should not have been instantiated if FlexFEC is disabled. 88 // This object should not have been instantiated if FlexFEC is disabled.
88 RTC_DCHECK_GE(payload_type, 0); 89 RTC_DCHECK_GE(payload_type, 0);
89 RTC_DCHECK_LE(payload_type, 127); 90 RTC_DCHECK_LE(payload_type, 127);
90 } 91 }
91 92
92 FlexfecSender::~FlexfecSender() = default; 93 FlexfecSender::~FlexfecSender() = default;
93 94
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 } 160 }
160 161
161 RtpState FlexfecSender::GetRtpState() { 162 RtpState FlexfecSender::GetRtpState() {
162 RtpState rtp_state; 163 RtpState rtp_state;
163 rtp_state.sequence_number = seq_num_; 164 rtp_state.sequence_number = seq_num_;
164 rtp_state.start_timestamp = timestamp_offset_; 165 rtp_state.start_timestamp = timestamp_offset_;
165 return rtp_state; 166 return rtp_state;
166 } 167 }
167 168
168 } // namespace webrtc 169 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698