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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 | 357 |
358 size_t BlockLength() const { | 358 size_t BlockLength() const { |
359 return kHeaderLength + 4 * ij_items_.size(); | 359 return kHeaderLength + 4 * ij_items_.size(); |
360 } | 360 } |
361 | 361 |
362 std::vector<uint32_t> ij_items_; | 362 std::vector<uint32_t> ij_items_; |
363 | 363 |
364 RTC_DISALLOW_COPY_AND_ASSIGN(Ij); | 364 RTC_DISALLOW_COPY_AND_ASSIGN(Ij); |
365 }; | 365 }; |
366 | 366 |
367 // Source Description (SDES) (RFC 3550). | |
368 // | |
369 // 0 1 2 3 | |
370 // 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 | |
371 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
372 // header |V=2|P| SC | PT=SDES=202 | length | | |
373 // +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ | |
374 // chunk | SSRC/CSRC_1 | | |
375 // 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
376 // | SDES items | | |
377 // | ... | | |
378 // +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ | |
379 // chunk | SSRC/CSRC_2 | | |
380 // 2 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
381 // | SDES items | | |
382 // | ... | | |
383 // +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ | |
384 // | |
385 // Canonical End-Point Identifier SDES Item (CNAME) | |
386 // | |
387 // 0 1 2 3 | |
388 // 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 | |
389 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
390 // | CNAME=1 | length | user and domain name ... | |
391 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
392 | |
393 class Sdes : public RtcpPacket { | |
394 public: | |
395 Sdes() : RtcpPacket() {} | |
396 | |
397 virtual ~Sdes() {} | |
398 | |
399 bool WithCName(uint32_t ssrc, const std::string& cname); | |
400 | |
401 struct Chunk { | |
402 uint32_t ssrc; | |
403 std::string name; | |
404 int null_octets; | |
405 }; | |
406 | |
407 protected: | |
408 bool Create(uint8_t* packet, | |
409 size_t* index, | |
410 size_t max_length, | |
411 RtcpPacket::PacketReadyCallback* callback) const override; | |
412 | |
413 private: | |
414 static const int kMaxNumberOfChunks = 0x1f; | |
415 | |
416 size_t BlockLength() const; | |
417 | |
418 std::vector<Chunk> chunks_; | |
419 | |
420 RTC_DISALLOW_COPY_AND_ASSIGN(Sdes); | |
421 }; | |
422 | |
423 // | 367 // |
424 // Bye packet (BYE) (RFC 3550). | 368 // Bye packet (BYE) (RFC 3550). |
425 // | 369 // |
426 // 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 | 370 // 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 |
427 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 371 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
428 // |V=2|P| SC | PT=BYE=203 | length | | 372 // |V=2|P| SC | PT=BYE=203 | length | |
429 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 373 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
430 // | SSRC/CSRC | | 374 // | SSRC/CSRC | |
431 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 375 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
432 // : ... : | 376 // : ... : |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1157 | 1101 |
1158 private: | 1102 private: |
1159 const size_t buffer_length_; | 1103 const size_t buffer_length_; |
1160 size_t length_; | 1104 size_t length_; |
1161 rtc::scoped_ptr<uint8_t[]> buffer_; | 1105 rtc::scoped_ptr<uint8_t[]> buffer_; |
1162 }; | 1106 }; |
1163 | 1107 |
1164 } // namespace rtcp | 1108 } // namespace rtcp |
1165 } // namespace webrtc | 1109 } // namespace webrtc |
1166 #endif // WEBRTC_MODULES_RTP_RTCP_RTCP_PACKET_H_ | 1110 #endif // WEBRTC_MODULES_RTP_RTCP_RTCP_PACKET_H_ |
OLD | NEW |