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

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

Issue 1849243002: [rtcp] Bye::Parse updated not to use RTCPUtility (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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/bye.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.cc b/webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.cc
index 4cfc921ce55940e5a6a3c23884a97a525ca82891..7b688ab9a4e7cdd04c7c9084c5c8e9ba3dab594c 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.cc
@@ -13,8 +13,7 @@
#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 {
@@ -33,21 +32,22 @@ namespace rtcp {
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Bye::Bye() : sender_ssrc_(0) {}
-bool Bye::Parse(const RtcpCommonHeader& header, const uint8_t* payload) {
- RTC_DCHECK(header.packet_type == kPacketType);
+bool Bye::Parse(const CommonHeader& packet) {
+ RTC_DCHECK(packet.type() == kPacketType);
- const uint8_t src_count = header.count_or_format;
+ const uint8_t src_count = packet.count();
// Validate packet.
- if (header.payload_size_bytes < 4u * src_count) {
+ if (packet.payload_size_bytes() < 4u * src_count) {
LOG(LS_WARNING)
<< "Packet is too small to contain CSRCs it promise to have.";
return false;
}
- bool has_reason = (header.payload_size_bytes > 4u * src_count);
+ const uint8_t* const payload = packet.payload();
+ bool has_reason = packet.payload_size_bytes() > 4u * src_count;
uint8_t reason_length = 0;
if (has_reason) {
reason_length = payload[4u * src_count];
- if (header.payload_size_bytes - 4u * src_count < 1u + reason_length) {
+ if (packet.payload_size_bytes() - 4u * src_count < 1u + reason_length) {
LOG(LS_WARNING) << "Invalid reason length: " << reason_length;
return false;
}
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.h ('k') | webrtc/modules/rtp_rtcp/source/rtcp_packet/bye_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698