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

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

Issue 2010723002: [rtcp] Tmmbn/Tmmbr Parse 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/tmmbn.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_packet/tmmbn.cc b/webrtc/modules/rtp_rtcp/source/rtcp_packet/tmmbn.cc
index 730b40865d22d1d750a06c2a58421722ca1793e6..f5683fb8f2aa483c0706f1578160f95c14dca1f2 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_packet/tmmbn.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_packet/tmmbn.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 Tmmbn::kFeedbackMessageType;
// RFC 4585: Feedback format.
// Common packet format:
//
@@ -42,23 +42,23 @@ namespace rtcp {
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
// | MxTBR Exp | MxTBR Mantissa |Measured Overhead|
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-bool Tmmbn::Parse(const RtcpCommonHeader& header, const uint8_t* payload) {
- RTC_CHECK(header.packet_type == kPacketType);
- RTC_CHECK(header.count_or_format == kFeedbackMessageType);
+bool Tmmbn::Parse(const CommonHeader& packet) {
+ RTC_DCHECK_EQ(packet.type(), kPacketType);
+ RTC_DCHECK_EQ(packet.fmt(), kFeedbackMessageType);
- if (header.payload_size_bytes < kCommonFeedbackLength) {
- LOG(LS_WARNING) << "Payload length " << header.payload_size_bytes
+ if (packet.payload_size_bytes() < kCommonFeedbackLength) {
+ LOG(LS_WARNING) << "Payload length " << packet.payload_size_bytes()
<< " is too small for TMMBN.";
return false;
}
- size_t items_size_bytes = header.payload_size_bytes - kCommonFeedbackLength;
+ size_t items_size_bytes = packet.payload_size_bytes() - kCommonFeedbackLength;
if (items_size_bytes % TmmbItem::kLength != 0) {
- LOG(LS_WARNING) << "Payload length " << header.payload_size_bytes
+ LOG(LS_WARNING) << "Payload length " << packet.payload_size_bytes()
<< " is not valid for TMMBN.";
return false;
}
- ParseCommonFeedback(payload);
- const uint8_t* next_item = payload + kCommonFeedbackLength;
+ ParseCommonFeedback(packet.payload());
+ const uint8_t* next_item = packet.payload() + kCommonFeedbackLength;
size_t number_of_items = items_size_bytes / TmmbItem::kLength;
items_.resize(number_of_items);
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_packet/tmmbn.h ('k') | webrtc/modules/rtp_rtcp/source/rtcp_packet/tmmbn_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698