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

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

Issue 2378113002: Allow max 1 block per type in RTCP Extended Reports (Closed)
Patch Set: use operator==(T, Optional<T>) for slightly cleaner tests Created 4 years, 2 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
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/rtcp_packet/dlrr.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/rtp_rtcp/source/rtcp_packet/dlrr.h
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_packet/dlrr.h b/webrtc/modules/rtp_rtcp/source/rtcp_packet/dlrr.h
index c2a4b8fffcc6cdeda1650aaeb868a6ad4e3de53a..c5f5c23bf1fcb4d3cd1ad15cf149d16ab6669821 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_packet/dlrr.h
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_packet/dlrr.h
@@ -32,7 +32,6 @@ struct ReceiveTimeInfo {
class Dlrr {
public:
static const uint8_t kBlockType = 5;
- static const size_t kMaxNumberOfDlrrItems = 100;
Dlrr() {}
Dlrr(const Dlrr& other) = default;
@@ -40,6 +39,9 @@ class Dlrr {
Dlrr& operator=(const Dlrr& other) = default;
+ // Dlrr without items treated same as no dlrr block.
+ explicit operator bool() const { return !sub_blocks_.empty(); }
+
// Second parameter is value read from block header,
// i.e. size of block in 32bits excluding block header itself.
bool Parse(const uint8_t* buffer, uint16_t block_length_32bits);
@@ -49,9 +51,10 @@ class Dlrr {
// Consumes BlockLength() bytes.
void Create(uint8_t* buffer) const;
- // Max 100 DLRR Items can be added per DLRR report block.
- bool AddDlrrItem(const ReceiveTimeInfo& time_info);
- bool AddDlrrItem(uint32_t ssrc, uint32_t last_rr, uint32_t delay_last_rr);
+ void ClearItems() { sub_blocks_.clear(); }
+ void AddDlrrItem(const ReceiveTimeInfo& time_info) {
+ sub_blocks_.push_back(time_info);
+ }
const std::vector<ReceiveTimeInfo>& sub_blocks() const { return sub_blocks_; }
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/rtcp_packet/dlrr.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698