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

Unified Diff: webrtc/modules/rtp_rtcp/source/rtcp_packet/fir.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/fir.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_packet/fir.cc b/webrtc/modules/rtp_rtcp/source/rtcp_packet/fir.cc
index 9096af819278ef5e5e73777454975e8a794b122e..69df03a000a4b2aa9a43b7065a22032a5a61efee 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_packet/fir.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_packet/fir.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 Fir::kFeedbackMessageType;
// RFC 4585: Feedback format.
// Common packet format:
//
@@ -43,26 +43,26 @@ namespace rtcp {
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
// | Seq nr. | Reserved = 0 |
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-bool Fir::Parse(const RtcpCommonHeader& header, const uint8_t* payload) {
- RTC_CHECK(header.packet_type == kPacketType);
- RTC_CHECK(header.count_or_format == kFeedbackMessageType);
+bool Fir::Parse(const CommonHeader& packet) {
+ RTC_DCHECK_EQ(packet.type(), kPacketType);
+ RTC_DCHECK_EQ(packet.fmt(), kFeedbackMessageType);
// The FCI field MUST contain one or more FIR entries.
- if (header.payload_size_bytes < kCommonFeedbackLength + kFciLength) {
+ if (packet.payload_size_bytes() < kCommonFeedbackLength + kFciLength) {
LOG(LS_WARNING) << "Packet is too small to be a valid FIR packet.";
return false;
}
- if ((header.payload_size_bytes - kCommonFeedbackLength) % kFciLength != 0) {
+ if ((packet.payload_size_bytes() - kCommonFeedbackLength) % kFciLength != 0) {
LOG(LS_WARNING) << "Invalid size for a valid FIR packet.";
return false;
}
- ParseCommonFeedback(payload);
+ ParseCommonFeedback(packet.payload());
size_t number_of_fci_items =
- (header.payload_size_bytes - kCommonFeedbackLength) / kFciLength;
- const uint8_t* next_fci = payload + kCommonFeedbackLength;
+ (packet.payload_size_bytes() - kCommonFeedbackLength) / kFciLength;
+ const uint8_t* next_fci = packet.payload() + kCommonFeedbackLength;
items_.resize(number_of_fci_items);
for (Request& request : items_) {
request.ssrc = ByteReader<uint32_t>::ReadBigEndian(next_fci);
@@ -88,7 +88,7 @@ bool Fir::Create(uint8_t* packet,
CreateCommonFeedback(packet + *index);
*index += kCommonFeedbackLength;
- const uint32_t kReserved = 0;
+ constexpr uint32_t kReserved = 0;
for (const Request& request : items_) {
ByteWriter<uint32_t>::WriteBigEndian(packet + *index, request.ssrc);
ByteWriter<uint8_t>::WriteBigEndian(packet + *index + 4, request.seq_nr);
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_packet/fir.h ('k') | webrtc/modules/rtp_rtcp/source/rtcp_packet/fir_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698