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

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

Issue 2506373004: RtpPacket::payload() return rtc::ArrayView instead of raw pointer (Closed)
Patch Set: Created 4 years, 1 month 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) 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 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 rtx_packet->SetSsrc(ssrc_rtx_); 1209 rtx_packet->SetSsrc(ssrc_rtx_);
1210 } 1210 }
1211 1211
1212 uint8_t* rtx_payload = 1212 uint8_t* rtx_payload =
1213 rtx_packet->AllocatePayload(packet.payload_size() + kRtxHeaderSize); 1213 rtx_packet->AllocatePayload(packet.payload_size() + kRtxHeaderSize);
1214 RTC_DCHECK(rtx_payload); 1214 RTC_DCHECK(rtx_payload);
1215 // Add OSN (original sequence number). 1215 // Add OSN (original sequence number).
1216 ByteWriter<uint16_t>::WriteBigEndian(rtx_payload, packet.SequenceNumber()); 1216 ByteWriter<uint16_t>::WriteBigEndian(rtx_payload, packet.SequenceNumber());
1217 1217
1218 // Add original payload data. 1218 // Add original payload data.
1219 memcpy(rtx_payload + kRtxHeaderSize, packet.payload(), packet.payload_size()); 1219 auto payload = packet.payload();
1220 memcpy(rtx_payload + kRtxHeaderSize, payload.data(), payload.size());
1220 1221
1221 return rtx_packet; 1222 return rtx_packet;
1222 } 1223 }
1223 1224
1224 void RTPSender::RegisterRtpStatisticsCallback( 1225 void RTPSender::RegisterRtpStatisticsCallback(
1225 StreamDataCountersCallback* callback) { 1226 StreamDataCountersCallback* callback) {
1226 rtc::CritScope cs(&statistics_crit_); 1227 rtc::CritScope cs(&statistics_crit_);
1227 rtp_stats_callback_ = callback; 1228 rtp_stats_callback_ = callback;
1228 } 1229 }
1229 1230
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
1314 return; 1315 return;
1315 } 1316 }
1316 rtp_overhead_bytes_per_packet_ = packet.headers_size(); 1317 rtp_overhead_bytes_per_packet_ = packet.headers_size();
1317 overhead_bytes_per_packet = 1318 overhead_bytes_per_packet =
1318 rtp_overhead_bytes_per_packet_ + transport_overhead_bytes_per_packet_; 1319 rtp_overhead_bytes_per_packet_ + transport_overhead_bytes_per_packet_;
1319 } 1320 }
1320 overhead_observer_->OnOverheadChanged(overhead_bytes_per_packet); 1321 overhead_observer_->OnOverheadChanged(overhead_bytes_per_packet);
1321 } 1322 }
1322 1323
1323 } // namespace webrtc 1324 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698