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

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

Issue 1309833002: Send RTCP packets via RtcpPacket callback (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Cleanup Created 5 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) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 CreateAndAddAppended(packet->MutableBuffer(), &length, packet->BufferLength(), 606 CreateAndAddAppended(packet->MutableBuffer(), &length, packet->BufferLength(),
607 &verifier); 607 &verifier);
608 OnBufferFull(packet->MutableBuffer(), &length, &verifier); 608 OnBufferFull(packet->MutableBuffer(), &length, &verifier);
609 return packet; 609 return packet;
610 } 610 }
611 611
612 bool RtcpPacket::Build(PacketReadyCallback* callback) const { 612 bool RtcpPacket::Build(PacketReadyCallback* callback) const {
613 uint8_t buffer[IP_PACKET_SIZE]; 613 uint8_t buffer[IP_PACKET_SIZE];
614 return BuildExternalBuffer(buffer, IP_PACKET_SIZE, callback); 614 return BuildExternalBuffer(buffer, IP_PACKET_SIZE, callback);
615 } 615 }
616
åsapersson 2015/12/03 15:53:57 prefer keeping new line
sprang_webrtc 2015/12/03 16:02:22 Done.
617 bool RtcpPacket::BuildExternalBuffer(uint8_t* buffer, 616 bool RtcpPacket::BuildExternalBuffer(uint8_t* buffer,
618 size_t max_length, 617 size_t max_length,
619 PacketReadyCallback* callback) const { 618 PacketReadyCallback* callback) const {
620 size_t index = 0; 619 size_t index = 0;
621 if (!CreateAndAddAppended(buffer, &index, max_length, callback)) 620 if (!CreateAndAddAppended(buffer, &index, max_length, callback))
622 return false; 621 return false;
623 return OnBufferFull(buffer, &index, callback); 622 return OnBufferFull(buffer, &index, callback);
624 } 623 }
625 624
626 bool RtcpPacket::CreateAndAddAppended(uint8_t* packet, 625 bool RtcpPacket::CreateAndAddAppended(uint8_t* packet,
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
1085 return length_; 1084 return length_;
1086 } 1085 }
1087 1086
1088 void RawPacket::SetLength(size_t length) { 1087 void RawPacket::SetLength(size_t length) {
1089 assert(length <= buffer_length_); 1088 assert(length <= buffer_length_);
1090 length_ = length; 1089 length_ = length;
1091 } 1090 }
1092 1091
1093 } // namespace rtcp 1092 } // namespace rtcp
1094 } // namespace webrtc 1093 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698