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_packet.cc

Issue 2553863003: Parse FlexFEC RTP headers in Call and add integration with BWE. (Closed)
Patch Set: Add basic CongestionController unit test, based on nisse's suggestion. Created 4 years 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 bool Packet::Parse(const uint8_t* buffer, size_t buffer_size) { 79 bool Packet::Parse(const uint8_t* buffer, size_t buffer_size) {
80 if (!ParseBuffer(buffer, buffer_size)) { 80 if (!ParseBuffer(buffer, buffer_size)) {
81 Clear(); 81 Clear();
82 return false; 82 return false;
83 } 83 }
84 buffer_.SetData(buffer, buffer_size); 84 buffer_.SetData(buffer, buffer_size);
85 RTC_DCHECK_EQ(size(), buffer_size); 85 RTC_DCHECK_EQ(size(), buffer_size);
86 return true; 86 return true;
87 } 87 }
88 88
89 bool Packet::Parse(rtc::ArrayView<const uint8_t> packet) {
90 return Parse(packet.data(), packet.size());
91 }
92
89 bool Packet::Parse(rtc::CopyOnWriteBuffer buffer) { 93 bool Packet::Parse(rtc::CopyOnWriteBuffer buffer) {
90 if (!ParseBuffer(buffer.cdata(), buffer.size())) { 94 if (!ParseBuffer(buffer.cdata(), buffer.size())) {
91 Clear(); 95 Clear();
92 return false; 96 return false;
93 } 97 }
94 size_t buffer_size = buffer.size(); 98 size_t buffer_size = buffer.size();
95 buffer_ = std::move(buffer); 99 buffer_ = std::move(buffer);
96 RTC_DCHECK_EQ(size(), buffer_size); 100 RTC_DCHECK_EQ(size(), buffer_size);
97 return true; 101 return true;
98 } 102 }
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 uint8_t* Packet::WriteAt(size_t offset) { 548 uint8_t* Packet::WriteAt(size_t offset) {
545 return buffer_.data() + offset; 549 return buffer_.data() + offset;
546 } 550 }
547 551
548 void Packet::WriteAt(size_t offset, uint8_t byte) { 552 void Packet::WriteAt(size_t offset, uint8_t byte) {
549 buffer_.data()[offset] = byte; 553 buffer_.data()[offset] = byte;
550 } 554 }
551 555
552 } // namespace rtp 556 } // namespace rtp
553 } // namespace webrtc 557 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_packet.h ('k') | webrtc/test/fuzzers/flexfec_receiver_fuzzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698