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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 private: | 346 private: |
347 size_t BlockLength() const { | 347 size_t BlockLength() const { |
348 const size_t kFciLength = 8; | 348 const size_t kFciLength = 8; |
349 return kCommonFbFmtLength + kFciLength; | 349 return kCommonFbFmtLength + kFciLength; |
350 } | 350 } |
351 | 351 |
352 RTCPUtility::RTCPPacketPSFBFIR fir_; | 352 RTCPUtility::RTCPPacketPSFBFIR fir_; |
353 RTCPUtility::RTCPPacketPSFBFIRItem fir_item_; | 353 RTCPUtility::RTCPPacketPSFBFIRItem fir_item_; |
354 }; | 354 }; |
355 | 355 |
356 // Receiver Estimated Max Bitrate (REMB) (draft-alvestrand-rmcat-remb). | |
357 // | |
358 // 0 1 2 3 | |
359 // 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 | |
360 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
361 // |V=2|P| FMT=15 | PT=206 | length | | |
362 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
363 // | SSRC of packet sender | | |
364 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
365 // | SSRC of media source | | |
366 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
367 // | Unique identifier 'R' 'E' 'M' 'B' | | |
368 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
369 // | Num SSRC | BR Exp | BR Mantissa | | |
370 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
371 // | SSRC feedback | | |
372 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
373 // | ... | |
374 | |
375 class Remb : public RtcpPacket { | |
376 public: | |
377 Remb() : RtcpPacket() { | |
378 memset(&remb_, 0, sizeof(remb_)); | |
379 memset(&remb_item_, 0, sizeof(remb_item_)); | |
380 } | |
381 | |
382 virtual ~Remb() {} | |
383 | |
384 void From(uint32_t ssrc) { | |
385 remb_.SenderSSRC = ssrc; | |
386 } | |
387 void AppliesTo(uint32_t ssrc); | |
388 | |
389 void WithBitrateBps(uint32_t bitrate_bps) { | |
390 remb_item_.BitRate = bitrate_bps; | |
391 } | |
392 | |
393 protected: | |
394 bool Create(uint8_t* packet, | |
395 size_t* index, | |
396 size_t max_length, | |
397 RtcpPacket::PacketReadyCallback* callback) const override; | |
398 | |
399 private: | |
400 static const int kMaxNumberOfSsrcs = 0xff; | |
401 | |
402 size_t BlockLength() const { | |
403 return (remb_item_.NumberOfSSRCs + 5) * 4; | |
404 } | |
405 | |
406 RTCPUtility::RTCPPacketPSFBAPP remb_; | |
407 RTCPUtility::RTCPPacketPSFBREMBItem remb_item_; | |
408 | |
409 RTC_DISALLOW_COPY_AND_ASSIGN(Remb); | |
410 }; | |
411 | |
412 // From RFC 3611: RTP Control Protocol Extended Reports (RTCP XR). | 356 // From RFC 3611: RTP Control Protocol Extended Reports (RTCP XR). |
413 // | 357 // |
414 // Format for XR packets: | 358 // Format for XR packets: |
415 // | 359 // |
416 // 0 1 2 3 | 360 // 0 1 2 3 |
417 // 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 | 361 // 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 |
418 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 362 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
419 // |V=2|P|reserved | PT=XR=207 | length | | 363 // |V=2|P|reserved | PT=XR=207 | length | |
420 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 364 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
421 // | SSRC | | 365 // | SSRC | |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 | 439 |
496 private: | 440 private: |
497 const size_t buffer_length_; | 441 const size_t buffer_length_; |
498 size_t length_; | 442 size_t length_; |
499 rtc::scoped_ptr<uint8_t[]> buffer_; | 443 rtc::scoped_ptr<uint8_t[]> buffer_; |
500 }; | 444 }; |
501 | 445 |
502 } // namespace rtcp | 446 } // namespace rtcp |
503 } // namespace webrtc | 447 } // namespace webrtc |
504 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_H_ | 448 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_H_ |
OLD | NEW |