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

Unified Diff: webrtc/modules/rtp_rtcp/source/rtcp_packet.h

Issue 1496883002: rtcp::Rrtr block moved into own file and got Parse function (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 5 years 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/rtp_rtcp/source/rtcp_packet.h
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_packet.h b/webrtc/modules/rtp_rtcp/source/rtcp_packet.h
index 1f5e22316dc43823efa05191ea2873a5b669ff23..7ea05b1a29ef416f57f690f0c633505033f5ecc9 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_packet.h
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_packet.h
@@ -18,6 +18,7 @@
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/rtp_rtcp/source/rtcp_packet/report_block.h"
+#include "webrtc/modules/rtp_rtcp/source/rtcp_packet/rrtr.h"
#include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
#include "webrtc/typedefs.h"
@@ -30,7 +31,6 @@ static const int kReportBlockLength = 24;
class Dlrr;
class RawPacket;
-class Rrtr;
class VoipMetric;
// Class for building RTCP packets.
@@ -670,10 +670,7 @@ class Xr : public RtcpPacket {
return kXrHeaderLength + RrtrLength() + DlrrLength() + VoipMetricLength();
}
- size_t RrtrLength() const {
- const size_t kRrtrBlockLength = 12;
- return kRrtrBlockLength * rrtr_blocks_.size();
- }
+ size_t RrtrLength() const { return Rrtr::kLength * rrtr_blocks_.size(); }
size_t DlrrLength() const;
@@ -683,46 +680,13 @@ class Xr : public RtcpPacket {
}
RTCPUtility::RTCPPacketXR xr_header_;
- std::vector<RTCPUtility::RTCPPacketXRReceiverReferenceTimeItem> rrtr_blocks_;
+ std::vector<Rrtr> rrtr_blocks_;
std::vector<DlrrBlock> dlrr_blocks_;
std::vector<RTCPUtility::RTCPPacketXRVOIPMetricItem> voip_metric_blocks_;
RTC_DISALLOW_COPY_AND_ASSIGN(Xr);
};
-// Receiver Reference Time Report Block (RFC 3611).
-//
-// 0 1 2 3
-// 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
-// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-// | BT=4 | reserved | block length = 2 |
-// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-// | NTP timestamp, most significant word |
-// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-// | NTP timestamp, least significant word |
-// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
-class Rrtr {
- public:
- Rrtr() {
- memset(&rrtr_block_, 0, sizeof(rrtr_block_));
- }
- ~Rrtr() {}
-
- void WithNtpSec(uint32_t sec) {
- rrtr_block_.NTPMostSignificant = sec;
- }
- void WithNtpFrac(uint32_t frac) {
- rrtr_block_.NTPLeastSignificant = frac;
- }
-
- private:
- friend class Xr;
- RTCPUtility::RTCPPacketXRReceiverReferenceTimeItem rrtr_block_;
-
- RTC_DISALLOW_COPY_AND_ASSIGN(Rrtr);
-};
-
// DLRR Report Block (RFC 3611).
//
// 0 1 2 3
« 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