OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 10 matching lines...) Expand all Loading... |
21 | 21 |
22 class App : public RtcpPacket { | 22 class App : public RtcpPacket { |
23 public: | 23 public: |
24 static constexpr uint8_t kPacketType = 204; | 24 static constexpr uint8_t kPacketType = 204; |
25 App() : sub_type_(0), ssrc_(0), name_(0) {} | 25 App() : sub_type_(0), ssrc_(0), name_(0) {} |
26 ~App() override {} | 26 ~App() override {} |
27 | 27 |
28 // Parse assumes header is already parsed and validated. | 28 // Parse assumes header is already parsed and validated. |
29 bool Parse(const CommonHeader& packet); | 29 bool Parse(const CommonHeader& packet); |
30 | 30 |
31 void From(uint32_t ssrc) { ssrc_ = ssrc; } | 31 void SetSsrc(uint32_t ssrc) { ssrc_ = ssrc; } |
32 void WithSubType(uint8_t subtype); | 32 void SetSubType(uint8_t subtype); |
33 void WithName(uint32_t name) { name_ = name; } | 33 void SetName(uint32_t name) { name_ = name; } |
34 void WithData(const uint8_t* data, size_t data_length); | 34 void SetData(const uint8_t* data, size_t data_length); |
35 | 35 |
36 uint8_t sub_type() const { return sub_type_; } | 36 uint8_t sub_type() const { return sub_type_; } |
37 uint32_t ssrc() const { return ssrc_; } | 37 uint32_t ssrc() const { return ssrc_; } |
38 uint32_t name() const { return name_; } | 38 uint32_t name() const { return name_; } |
39 size_t data_size() const { return data_.size(); } | 39 size_t data_size() const { return data_.size(); } |
40 const uint8_t* data() const { return data_.data(); } | 40 const uint8_t* data() const { return data_.data(); } |
41 | 41 |
42 protected: | 42 protected: |
43 bool Create(uint8_t* packet, | 43 bool Create(uint8_t* packet, |
44 size_t* index, | 44 size_t* index, |
(...skipping 11 matching lines...) Expand all Loading... |
56 uint32_t ssrc_; | 56 uint32_t ssrc_; |
57 uint32_t name_; | 57 uint32_t name_; |
58 rtc::Buffer data_; | 58 rtc::Buffer data_; |
59 | 59 |
60 RTC_DISALLOW_COPY_AND_ASSIGN(App); | 60 RTC_DISALLOW_COPY_AND_ASSIGN(App); |
61 }; | 61 }; |
62 | 62 |
63 } // namespace rtcp | 63 } // namespace rtcp |
64 } // namespace webrtc | 64 } // namespace webrtc |
65 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_APP_H_ | 65 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_APP_H_ |
OLD | NEW |