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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 private: | 312 private: |
313 static const int kMaxNumberOfChunks = 0x1f; | 313 static const int kMaxNumberOfChunks = 0x1f; |
314 | 314 |
315 size_t BlockLength() const; | 315 size_t BlockLength() const; |
316 | 316 |
317 std::vector<Chunk> chunks_; | 317 std::vector<Chunk> chunks_; |
318 | 318 |
319 RTC_DISALLOW_COPY_AND_ASSIGN(Sdes); | 319 RTC_DISALLOW_COPY_AND_ASSIGN(Sdes); |
320 }; | 320 }; |
321 | 321 |
322 // | |
323 // Bye packet (BYE) (RFC 3550). | |
324 // | |
325 // 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 | |
326 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
327 // |V=2|P| SC | PT=BYE=203 | length | | |
328 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
329 // | SSRC/CSRC | | |
330 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
331 // : ... : | |
332 // +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ | |
333 // (opt) | length | reason for leaving ... | |
334 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
335 | |
336 class Bye : public RtcpPacket { | |
337 public: | |
338 Bye() : RtcpPacket() { | |
339 memset(&bye_, 0, sizeof(bye_)); | |
340 } | |
341 | |
342 virtual ~Bye() {} | |
343 | |
344 void From(uint32_t ssrc) { | |
345 bye_.SenderSSRC = ssrc; | |
346 } | |
347 | |
348 bool WithCsrc(uint32_t csrc); | |
349 | |
350 // TODO(sprang): Add support for reason field? | |
351 | |
352 protected: | |
353 bool Create(uint8_t* packet, | |
354 size_t* index, | |
355 size_t max_length, | |
356 RtcpPacket::PacketReadyCallback* callback) const override; | |
357 | |
358 private: | |
359 static const int kMaxNumberOfCsrcs = 0x1f - 1; // First item is sender SSRC. | |
360 | |
361 size_t BlockLength() const { | |
362 size_t source_count = 1 + csrcs_.size(); | |
363 return kHeaderLength + 4 * source_count; | |
364 } | |
365 | |
366 RTCPUtility::RTCPPacketBYE bye_; | |
367 std::vector<uint32_t> csrcs_; | |
368 | |
369 RTC_DISALLOW_COPY_AND_ASSIGN(Bye); | |
370 }; | |
371 | |
372 // RFC 4585: Feedback format. | 322 // RFC 4585: Feedback format. |
373 // | 323 // |
374 // Common packet format: | 324 // Common packet format: |
375 // | 325 // |
376 // 0 1 2 3 | 326 // 0 1 2 3 |
377 // 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 | 327 // 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 |
378 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 328 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
379 // |V=2|P| FMT | PT | length | | 329 // |V=2|P| FMT | PT | length | |
380 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 330 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
381 // | SSRC of packet sender | | 331 // | SSRC of packet sender | |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
997 | 947 |
998 private: | 948 private: |
999 const size_t buffer_length_; | 949 const size_t buffer_length_; |
1000 size_t length_; | 950 size_t length_; |
1001 rtc::scoped_ptr<uint8_t[]> buffer_; | 951 rtc::scoped_ptr<uint8_t[]> buffer_; |
1002 }; | 952 }; |
1003 | 953 |
1004 } // namespace rtcp | 954 } // namespace rtcp |
1005 } // namespace webrtc | 955 } // namespace webrtc |
1006 #endif // WEBRTC_MODULES_RTP_RTCP_RTCP_PACKET_H_ | 956 #endif // WEBRTC_MODULES_RTP_RTCP_RTCP_PACKET_H_ |
OLD | NEW |