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

Unified Diff: webrtc/modules/rtp_rtcp/source/rtcp_packet/sli.cc

Issue 2023803002: [rtcp] Fir/Sli/Rpsi updated not to use RTCPUtility (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 7 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/sli.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_packet/sli.cc b/webrtc/modules/rtp_rtcp/source/rtcp_packet/sli.cc
index 829f3a9db98aa8f6c6e1c8a0c24507c9780242ba..03689b374d0ceb14d68701c037c522389d22e884 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_packet/sli.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_packet/sli.cc
@@ -13,11 +13,11 @@
#include "webrtc/base/checks.h"
#include "webrtc/base/logging.h"
#include "webrtc/modules/rtp_rtcp/source/byte_io.h"
-
-using webrtc::RTCPUtility::RtcpCommonHeader;
+#include "webrtc/modules/rtp_rtcp/source/rtcp_packet/common_header.h"
namespace webrtc {
namespace rtcp {
+constexpr uint8_t Sli::kFeedbackMessageType;
// RFC 4585: Feedback format.
//
// Common packet format:
@@ -58,24 +58,24 @@ void Sli::Macroblocks::Create(uint8_t* buffer) const {
ByteWriter<uint32_t>::WriteBigEndian(buffer, item_);
}
-bool Sli::Parse(const RtcpCommonHeader& header, const uint8_t* payload) {
- RTC_DCHECK(header.packet_type == kPacketType);
- RTC_DCHECK(header.count_or_format == kFeedbackMessageType);
+bool Sli::Parse(const CommonHeader& packet) {
+ RTC_DCHECK_EQ(packet.type(), kPacketType);
+ RTC_DCHECK_EQ(packet.fmt(), kFeedbackMessageType);
- if (header.payload_size_bytes <
+ if (packet.payload_size_bytes() <
kCommonFeedbackLength + Macroblocks::kLength) {
LOG(LS_WARNING) << "Packet is too small to be a valid SLI packet";
return false;
}
size_t number_of_items =
- (header.payload_size_bytes - kCommonFeedbackLength) /
+ (packet.payload_size_bytes() - kCommonFeedbackLength) /
Macroblocks::kLength;
- ParseCommonFeedback(payload);
+ ParseCommonFeedback(packet.payload());
items_.resize(number_of_items);
- const uint8_t* next_item = payload + kCommonFeedbackLength;
+ const uint8_t* next_item = packet.payload() + kCommonFeedbackLength;
for (Macroblocks& item : items_) {
item.Parse(next_item);
next_item += Macroblocks::kLength;
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_packet/sli.h ('k') | webrtc/modules/rtp_rtcp/source/rtcp_packet/sli_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698