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

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

Issue 1544983002: [rtp_rtcp] rtcp::SenderReport moved into own file and got Parse function (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Added SenderReport::ClearReportBlocks to make SenderReport reusable 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 side-by-side diff with in-line comments
Download patch
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 5aa3340d00a50984ab5ca202994173f62099fc80..13c9e79d516db45927c4e1b396e1b6d21e222f1e 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_packet.h
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_packet.h
@@ -145,77 +145,6 @@ class Empty : public RtcpPacket {
RTC_DISALLOW_COPY_AND_ASSIGN(Empty);
};
-// RTCP sender report (RFC 3550).
-//
-// 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
-// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-// |V=2|P| RC | PT=SR=200 | length |
-// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-// | SSRC of sender |
-// +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
-// | NTP timestamp, most significant word |
-// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-// | NTP timestamp, least significant word |
-// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-// | RTP timestamp |
-// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-// | sender's packet count |
-// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-// | sender's octet count |
-// +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
-// | report block(s) |
-// | .... |
-
-class SenderReport : public RtcpPacket {
- public:
- SenderReport() : RtcpPacket() {
- memset(&sr_, 0, sizeof(sr_));
- }
-
- virtual ~SenderReport() {}
-
- void From(uint32_t ssrc) {
- sr_.SenderSSRC = ssrc;
- }
- void WithNtpSec(uint32_t sec) {
- sr_.NTPMostSignificant = sec;
- }
- void WithNtpFrac(uint32_t frac) {
- sr_.NTPLeastSignificant = frac;
- }
- void WithRtpTimestamp(uint32_t rtp_timestamp) {
- sr_.RTPTimestamp = rtp_timestamp;
- }
- void WithPacketCount(uint32_t packet_count) {
- sr_.SenderPacketCount = packet_count;
- }
- void WithOctetCount(uint32_t octet_count) {
- sr_.SenderOctetCount = octet_count;
- }
- bool WithReportBlock(const ReportBlock& block);
-
- protected:
- bool Create(uint8_t* packet,
- size_t* index,
- size_t max_length,
- RtcpPacket::PacketReadyCallback* callback) const override;
-
- private:
- static const int kMaxNumberOfReportBlocks = 0x1f;
-
- size_t BlockLength() const {
- const size_t kSrHeaderLength = 8;
- const size_t kSenderInfoLength = 20;
- return kSrHeaderLength + kSenderInfoLength +
- report_blocks_.size() * kReportBlockLength;
- }
-
- RTCPUtility::RTCPPacketSR sr_;
- std::vector<ReportBlock> report_blocks_;
-
- RTC_DISALLOW_COPY_AND_ASSIGN(SenderReport);
-};
-
// Source Description (SDES) (RFC 3550).
//
// 0 1 2 3

Powered by Google App Engine
This is Rietveld 408576698