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

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

Issue 1631683002: [rtp_rtcp] Dlrr::SubBlock struct renamed to ReceiveTimeInfo (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 11 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/dlrr.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_packet/dlrr.cc b/webrtc/modules/rtp_rtcp/source/rtcp_packet/dlrr.cc
index 6d6c48fadafdddffef3ee6a3893387bc4338d477..981eae55e05a1eb83887a92fa9f0353f5924bdc2 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_packet/dlrr.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_packet/dlrr.cc
@@ -45,7 +45,7 @@ bool Dlrr::Parse(const uint8_t* buffer, uint16_t block_length_32bits) {
size_t blocks_count = block_length_32bits / 3;
const uint8_t* read_at = buffer + kBlockHeaderLength;
sub_blocks_.resize(blocks_count);
- for (SubBlock& sub_block : sub_blocks_) {
+ for (ReceiveTimeInfo& sub_block : sub_blocks_) {
sub_block.ssrc = ByteReader<uint32_t>::ReadBigEndian(&read_at[0]);
sub_block.last_rr = ByteReader<uint32_t>::ReadBigEndian(&read_at[4]);
sub_block.delay_since_last_rr =
@@ -71,7 +71,7 @@ void Dlrr::Create(uint8_t* buffer) const {
ByteWriter<uint16_t>::WriteBigEndian(&buffer[2], 3 * sub_blocks_.size());
// Create sub blocks.
uint8_t* write_at = buffer + kBlockHeaderLength;
- for (const SubBlock& sub_block : sub_blocks_) {
+ for (const ReceiveTimeInfo& sub_block : sub_blocks_) {
ByteWriter<uint32_t>::WriteBigEndian(&write_at[0], sub_block.ssrc);
ByteWriter<uint32_t>::WriteBigEndian(&write_at[4], sub_block.last_rr);
ByteWriter<uint32_t>::WriteBigEndian(&write_at[8],
@@ -81,6 +81,15 @@ void Dlrr::Create(uint8_t* buffer) const {
RTC_DCHECK_EQ(buffer + BlockLength(), write_at);
}
+bool Dlrr::WithDlrrItem(const ReceiveTimeInfo& block) {
+ if (sub_blocks_.size() >= kMaxNumberOfDlrrItems) {
+ LOG(LS_WARNING) << "Max DLRR items reached.";
+ return false;
+ }
+ sub_blocks_.push_back(block);
+ return true;
+}
+
bool Dlrr::WithDlrrItem(uint32_t ssrc,
uint32_t last_rr,
uint32_t delay_last_rr) {
åsapersson 2016/01/26 12:37:00 Call function above here? ReceiveTimeInfo block; b
danilchap 2016/01/26 12:46:37 Done.
@@ -88,13 +97,12 @@ bool Dlrr::WithDlrrItem(uint32_t ssrc,
LOG(LS_WARNING) << "Max DLRR items reached.";
return false;
}
- SubBlock block;
+ ReceiveTimeInfo block;
block.ssrc = ssrc;
block.last_rr = last_rr;
block.delay_since_last_rr = delay_last_rr;
sub_blocks_.push_back(block);
return true;
}
-
} // namespace rtcp
} // namespace webrtc
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_packet/dlrr.h ('k') | webrtc/modules/rtp_rtcp/source/rtcp_packet/dlrr_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698