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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 return kSrHeaderLength + kSenderInfoLength + | 210 return kSrHeaderLength + kSenderInfoLength + |
211 report_blocks_.size() * kReportBlockLength; | 211 report_blocks_.size() * kReportBlockLength; |
212 } | 212 } |
213 | 213 |
214 RTCPUtility::RTCPPacketSR sr_; | 214 RTCPUtility::RTCPPacketSR sr_; |
215 std::vector<ReportBlock> report_blocks_; | 215 std::vector<ReportBlock> report_blocks_; |
216 | 216 |
217 RTC_DISALLOW_COPY_AND_ASSIGN(SenderReport); | 217 RTC_DISALLOW_COPY_AND_ASSIGN(SenderReport); |
218 }; | 218 }; |
219 | 219 |
220 // | |
221 // RTCP receiver report (RFC 3550). | |
222 // | |
223 // 0 1 2 3 | |
224 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | |
225 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
226 // |V=2|P| RC | PT=RR=201 | length | | |
227 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
228 // | SSRC of packet sender | | |
229 // +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ | |
230 // | report block(s) | | |
231 // | .... | | |
232 | |
233 class ReceiverReport : public RtcpPacket { | |
234 public: | |
235 ReceiverReport() : RtcpPacket() { | |
236 memset(&rr_, 0, sizeof(rr_)); | |
237 } | |
238 | |
239 virtual ~ReceiverReport() {} | |
240 | |
241 void From(uint32_t ssrc) { | |
242 rr_.SenderSSRC = ssrc; | |
243 } | |
244 bool WithReportBlock(const ReportBlock& block); | |
245 | |
246 protected: | |
247 bool Create(uint8_t* packet, | |
248 size_t* index, | |
249 size_t max_length, | |
250 RtcpPacket::PacketReadyCallback* callback) const override; | |
251 | |
252 private: | |
253 static const int kMaxNumberOfReportBlocks = 0x1F; | |
254 | |
255 size_t BlockLength() const { | |
256 const size_t kRrHeaderLength = 8; | |
257 return kRrHeaderLength + report_blocks_.size() * kReportBlockLength; | |
258 } | |
259 | |
260 RTCPUtility::RTCPPacketRR rr_; | |
261 std::vector<ReportBlock> report_blocks_; | |
262 | |
263 RTC_DISALLOW_COPY_AND_ASSIGN(ReceiverReport); | |
264 }; | |
265 | |
266 // Source Description (SDES) (RFC 3550). | 220 // Source Description (SDES) (RFC 3550). |
267 // | 221 // |
268 // 0 1 2 3 | 222 // 0 1 2 3 |
269 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | 223 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 |
270 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 224 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
271 // header |V=2|P| SC | PT=SDES=202 | length | | 225 // header |V=2|P| SC | PT=SDES=202 | length | |
272 // +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ | 226 // +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ |
273 // chunk | SSRC/CSRC_1 | | 227 // chunk | SSRC/CSRC_1 | |
274 // 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 228 // 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
275 // | SDES items | | 229 // | SDES items | |
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 | 1010 |
1057 private: | 1011 private: |
1058 const size_t buffer_length_; | 1012 const size_t buffer_length_; |
1059 size_t length_; | 1013 size_t length_; |
1060 rtc::scoped_ptr<uint8_t[]> buffer_; | 1014 rtc::scoped_ptr<uint8_t[]> buffer_; |
1061 }; | 1015 }; |
1062 | 1016 |
1063 } // namespace rtcp | 1017 } // namespace rtcp |
1064 } // namespace webrtc | 1018 } // namespace webrtc |
1065 #endif // WEBRTC_MODULES_RTP_RTCP_RTCP_PACKET_H_ | 1019 #endif // WEBRTC_MODULES_RTP_RTCP_RTCP_PACKET_H_ |
OLD | NEW |