OLD | NEW |
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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 size_t length, | 409 size_t length, |
410 uint8_t* buffer, | 410 uint8_t* buffer, |
411 size_t* pos) { | 411 size_t* pos) { |
412 assert(length <= 0xffff); | 412 assert(length <= 0xffff); |
413 const uint8_t kVersion = 2; | 413 const uint8_t kVersion = 2; |
414 AssignUWord8(buffer, pos, (kVersion << 6) + count_or_format); | 414 AssignUWord8(buffer, pos, (kVersion << 6) + count_or_format); |
415 AssignUWord8(buffer, pos, packet_type); | 415 AssignUWord8(buffer, pos, packet_type); |
416 AssignUWord16(buffer, pos, length); | 416 AssignUWord16(buffer, pos, length); |
417 } | 417 } |
418 | 418 |
419 bool Empty::Create(uint8_t* packet, | |
420 size_t* index, | |
421 size_t max_length, | |
422 RtcpPacket::PacketReadyCallback* callback) const { | |
423 return true; | |
424 } | |
425 | |
426 size_t Empty::BlockLength() const { | |
427 return 0; | |
428 } | |
429 | |
430 bool SenderReport::Create(uint8_t* packet, | 419 bool SenderReport::Create(uint8_t* packet, |
431 size_t* index, | 420 size_t* index, |
432 size_t max_length, | 421 size_t max_length, |
433 RtcpPacket::PacketReadyCallback* callback) const { | 422 RtcpPacket::PacketReadyCallback* callback) const { |
434 while (*index + BlockLength() > max_length) { | 423 while (*index + BlockLength() > max_length) { |
435 if (!OnBufferFull(packet, index, callback)) | 424 if (!OnBufferFull(packet, index, callback)) |
436 return false; | 425 return false; |
437 } | 426 } |
438 CreateHeader(sr_.NumberOfReportBlocks, PT_SR, HeaderLength(), packet, index); | 427 CreateHeader(sr_.NumberOfReportBlocks, PT_SR, HeaderLength(), packet, index); |
439 CreateSenderReport(sr_, packet, index); | 428 CreateSenderReport(sr_, packet, index); |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 return length_; | 665 return length_; |
677 } | 666 } |
678 | 667 |
679 void RawPacket::SetLength(size_t length) { | 668 void RawPacket::SetLength(size_t length) { |
680 assert(length <= buffer_length_); | 669 assert(length <= buffer_length_); |
681 length_ = length; | 670 length_ = length; |
682 } | 671 } |
683 | 672 |
684 } // namespace rtcp | 673 } // namespace rtcp |
685 } // namespace webrtc | 674 } // namespace webrtc |
OLD | NEW |