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

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

Issue 1846433003: [rtcp] Sdes::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/sdes.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_packet/sdes.cc b/webrtc/modules/rtp_rtcp/source/rtcp_packet/sdes.cc
index 48ebb071e58b4b3deed88aa70d8395a952c5d5e8..3a905ba3157e8e90880fad1e621ea1772942e704 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_packet/sdes.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_packet/sdes.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 {
@@ -60,22 +59,23 @@ Sdes::Sdes() : block_length_(RtcpPacket::kHeaderLength) {}
Sdes::~Sdes() {}
-bool Sdes::Parse(const RtcpCommonHeader& header, const uint8_t* payload) {
- RTC_CHECK(header.packet_type == kPacketType);
+bool Sdes::Parse(const CommonHeader& packet) {
+ RTC_DCHECK(packet.type() == kPacketType);
- uint8_t number_of_chunks = header.count_or_format;
+ uint8_t number_of_chunks = packet.count();
std::vector<Chunk> chunks; // Read chunk into temporary array, so that in
// case of an error original array would stay
// unchanged.
size_t block_length = kHeaderLength;
- if (header.payload_size_bytes % 4 != 0) {
- LOG(LS_WARNING) << "Invalid payload size " << header.payload_size_bytes
+ if (packet.payload_size_bytes() % 4 != 0) {
+ LOG(LS_WARNING) << "Invalid payload size " << packet.payload_size_bytes()
<< " bytes for a valid Sdes packet. Size should be"
" multiple of 4 bytes";
}
- const uint8_t* const payload_end = payload + header.payload_size_bytes;
- const uint8_t* looking_at = payload;
+ const uint8_t* const payload_end =
+ packet.payload() + packet.payload_size_bytes();
+ const uint8_t* looking_at = packet.payload();
chunks.resize(number_of_chunks);
for (size_t i = 0; i < number_of_chunks;) {
// Each chunk consumes at least 8 bytes.
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_packet/sdes.h ('k') | webrtc/modules/rtp_rtcp/source/rtcp_packet/sdes_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698