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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
78 virtual void OnPacketReady(uint8_t* data, size_t length) = 0; | 78 virtual void OnPacketReady(uint8_t* data, size_t length) = 0; |
79 }; | 79 }; |
80 | 80 |
81 // Convenience method mostly used for test. Max length of IP_PACKET_SIZE is | 81 // Convenience method mostly used for test. Max length of IP_PACKET_SIZE is |
82 // used, will cause assertion error if fragmentation occurs. | 82 // used, will cause assertion error if fragmentation occurs. |
83 rtc::scoped_ptr<RawPacket> Build() const; | 83 rtc::scoped_ptr<RawPacket> Build() const; |
84 | 84 |
85 // Returns true if all calls to Create succeeded. A buffer of size | 85 // Returns true if all calls to Create succeeded. A buffer of size |
86 // IP_PACKET_SIZE will be allocated and reused between calls to callback. | 86 // IP_PACKET_SIZE will be allocated and reused between calls to callback. |
87 bool Build(PacketReadyCallback* callback) const; | 87 bool Build(PacketReadyCallback* callback) const; |
88 | |
åsapersson
2015/12/03 15:53:57
prefer keeping new line
sprang_webrtc
2015/12/03 16:02:22
Done.
| |
89 // Returns true if all calls to Create succeeded. Provided buffer reference | 88 // Returns true if all calls to Create succeeded. Provided buffer reference |
90 // will be used for all calls to callback. | 89 // will be used for all calls to callback. |
91 bool BuildExternalBuffer(uint8_t* buffer, | 90 bool BuildExternalBuffer(uint8_t* buffer, |
92 size_t max_length, | 91 size_t max_length, |
93 PacketReadyCallback* callback) const; | 92 PacketReadyCallback* callback) const; |
94 | 93 |
95 // Size of this packet in bytes (including headers, excluding nested packets). | 94 // Size of this packet in bytes (including headers, excluding nested packets). |
96 virtual size_t BlockLength() const = 0; | 95 virtual size_t BlockLength() const = 0; |
97 | 96 |
98 protected: | 97 protected: |
(...skipping 10 matching lines...) Expand all Loading... | |
109 uint8_t* buffer, | 108 uint8_t* buffer, |
110 size_t* pos); | 109 size_t* pos); |
111 | 110 |
112 bool OnBufferFull(uint8_t* packet, | 111 bool OnBufferFull(uint8_t* packet, |
113 size_t* index, | 112 size_t* index, |
114 RtcpPacket::PacketReadyCallback* callback) const; | 113 RtcpPacket::PacketReadyCallback* callback) const; |
115 | 114 |
116 size_t HeaderLength() const; | 115 size_t HeaderLength() const; |
117 | 116 |
118 static const size_t kHeaderLength = 4; | 117 static const size_t kHeaderLength = 4; |
118 std::vector<RtcpPacket*> appended_packets_; | |
119 | 119 |
120 private: | 120 private: |
121 bool CreateAndAddAppended(uint8_t* packet, | 121 bool CreateAndAddAppended(uint8_t* packet, |
122 size_t* index, | 122 size_t* index, |
123 size_t max_length, | 123 size_t max_length, |
124 PacketReadyCallback* callback) const; | 124 PacketReadyCallback* callback) const; |
125 | |
126 std::vector<RtcpPacket*> appended_packets_; | |
127 }; | 125 }; |
128 | 126 |
129 // TODO(sprang): Move RtcpPacket subclasses out to separate files. | 127 // TODO(sprang): Move RtcpPacket subclasses out to separate files. |
130 | 128 |
131 class Empty : public RtcpPacket { | 129 class Empty : public RtcpPacket { |
132 public: | 130 public: |
133 Empty() : RtcpPacket() {} | 131 Empty() : RtcpPacket() {} |
134 | 132 |
135 virtual ~Empty() {} | 133 virtual ~Empty() {} |
136 | 134 |
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
947 | 945 |
948 private: | 946 private: |
949 const size_t buffer_length_; | 947 const size_t buffer_length_; |
950 size_t length_; | 948 size_t length_; |
951 rtc::scoped_ptr<uint8_t[]> buffer_; | 949 rtc::scoped_ptr<uint8_t[]> buffer_; |
952 }; | 950 }; |
953 | 951 |
954 } // namespace rtcp | 952 } // namespace rtcp |
955 } // namespace webrtc | 953 } // namespace webrtc |
956 #endif // WEBRTC_MODULES_RTP_RTCP_RTCP_PACKET_H_ | 954 #endif // WEBRTC_MODULES_RTP_RTCP_RTCP_PACKET_H_ |
OLD | NEW |