OLD | NEW |
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 |
11 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/compound_packet.h" | 11 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/compound_packet.h" |
12 | 12 |
13 #include "webrtc/base/checks.h" | 13 #include "webrtc/base/checks.h" |
14 | 14 |
15 namespace webrtc { | 15 namespace webrtc { |
16 namespace rtcp { | 16 namespace rtcp { |
17 | 17 |
| 18 CompoundPacket::CompoundPacket() = default; |
| 19 |
| 20 CompoundPacket::~CompoundPacket() = default; |
| 21 |
18 void CompoundPacket::Append(RtcpPacket* packet) { | 22 void CompoundPacket::Append(RtcpPacket* packet) { |
19 RTC_CHECK(packet); | 23 RTC_CHECK(packet); |
20 appended_packets_.push_back(packet); | 24 appended_packets_.push_back(packet); |
21 } | 25 } |
22 | 26 |
23 bool CompoundPacket::Create(uint8_t* packet, | 27 bool CompoundPacket::Create(uint8_t* packet, |
24 size_t* index, | 28 size_t* index, |
25 size_t max_length, | 29 size_t max_length, |
26 RtcpPacket::PacketReadyCallback* callback) const { | 30 RtcpPacket::PacketReadyCallback* callback) const { |
27 for (RtcpPacket* appended : appended_packets_) { | 31 for (RtcpPacket* appended : appended_packets_) { |
28 if (!appended->Create(packet, index, max_length, callback)) | 32 if (!appended->Create(packet, index, max_length, callback)) |
29 return false; | 33 return false; |
30 } | 34 } |
31 return true; | 35 return true; |
32 } | 36 } |
33 | 37 |
34 size_t CompoundPacket::BlockLength() const { | 38 size_t CompoundPacket::BlockLength() const { |
35 size_t block_length = 0; | 39 size_t block_length = 0; |
36 for (RtcpPacket* appended : appended_packets_) { | 40 for (RtcpPacket* appended : appended_packets_) { |
37 block_length += appended->BlockLength(); | 41 block_length += appended->BlockLength(); |
38 } | 42 } |
39 return block_length; | 43 return block_length; |
40 } | 44 } |
41 | 45 |
42 } // namespace rtcp | 46 } // namespace rtcp |
43 } // namespace webrtc | 47 } // namespace webrtc |
OLD | NEW |