Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(391)

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtcp_packet.h

Issue 1575023002: [rtp_rtcp] rtcp::Tmmbr moved into own file (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/modules/rtp_rtcp/rtp_rtcp.gypi ('k') | webrtc/modules/rtp_rtcp/source/rtcp_packet.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 private: 419 private:
420 size_t BlockLength() const { 420 size_t BlockLength() const {
421 const size_t kFciLength = 8; 421 const size_t kFciLength = 8;
422 return kCommonFbFmtLength + kFciLength; 422 return kCommonFbFmtLength + kFciLength;
423 } 423 }
424 424
425 RTCPUtility::RTCPPacketPSFBFIR fir_; 425 RTCPUtility::RTCPPacketPSFBFIR fir_;
426 RTCPUtility::RTCPPacketPSFBFIRItem fir_item_; 426 RTCPUtility::RTCPPacketPSFBFIRItem fir_item_;
427 }; 427 };
428 428
429 // Temporary Maximum Media Stream Bit Rate Request (TMMBR) (RFC 5104).
430 //
431 // FCI:
432 //
433 // 0 1 2 3
434 // 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
435 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
436 // | SSRC |
437 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
438 // | MxTBR Exp | MxTBR Mantissa |Measured Overhead|
439 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
440
441 class Tmmbr : public RtcpPacket {
442 public:
443 Tmmbr() : RtcpPacket() {
444 memset(&tmmbr_, 0, sizeof(tmmbr_));
445 memset(&tmmbr_item_, 0, sizeof(tmmbr_item_));
446 }
447
448 virtual ~Tmmbr() {}
449
450 void From(uint32_t ssrc) {
451 tmmbr_.SenderSSRC = ssrc;
452 }
453 void To(uint32_t ssrc) {
454 tmmbr_item_.SSRC = ssrc;
455 }
456 void WithBitrateKbps(uint32_t bitrate_kbps) {
457 tmmbr_item_.MaxTotalMediaBitRate = bitrate_kbps;
458 }
459 void WithOverhead(uint16_t overhead) {
460 assert(overhead <= 0x1ff);
461 tmmbr_item_.MeasuredOverhead = overhead;
462 }
463
464 protected:
465 bool Create(uint8_t* packet,
466 size_t* index,
467 size_t max_length,
468 RtcpPacket::PacketReadyCallback* callback) const override;
469
470 private:
471 size_t BlockLength() const {
472 const size_t kFciLen = 8;
473 return kCommonFbFmtLength + kFciLen;
474 }
475
476 RTCPUtility::RTCPPacketRTPFBTMMBR tmmbr_;
477 RTCPUtility::RTCPPacketRTPFBTMMBRItem tmmbr_item_;
478
479 RTC_DISALLOW_COPY_AND_ASSIGN(Tmmbr);
480 };
481
482 // Receiver Estimated Max Bitrate (REMB) (draft-alvestrand-rmcat-remb). 429 // Receiver Estimated Max Bitrate (REMB) (draft-alvestrand-rmcat-remb).
483 // 430 //
484 // 0 1 2 3 431 // 0 1 2 3
485 // 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 432 // 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
486 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 433 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
487 // |V=2|P| FMT=15 | PT=206 | length | 434 // |V=2|P| FMT=15 | PT=206 | length |
488 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 435 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
489 // | SSRC of packet sender | 436 // | SSRC of packet sender |
490 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 437 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
491 // | SSRC of media source | 438 // | SSRC of media source |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 568
622 private: 569 private:
623 const size_t buffer_length_; 570 const size_t buffer_length_;
624 size_t length_; 571 size_t length_;
625 rtc::scoped_ptr<uint8_t[]> buffer_; 572 rtc::scoped_ptr<uint8_t[]> buffer_;
626 }; 573 };
627 574
628 } // namespace rtcp 575 } // namespace rtcp
629 } // namespace webrtc 576 } // namespace webrtc
630 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_H_ 577 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_H_
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/rtp_rtcp.gypi ('k') | webrtc/modules/rtp_rtcp/source/rtcp_packet.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698