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

Unified Diff: webrtc/modules/rtp_rtcp/source/tmmbr_help.h

Issue 1669323002: TMMBRSet become vector<rtcp::TmmbItem> (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: makes std::vector<rtcp::TmmbItem> compatible with TMMBRSet Created 4 years, 10 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/tmmbr_help.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/rtp_rtcp/source/tmmbr_help.h
diff --git a/webrtc/modules/rtp_rtcp/source/tmmbr_help.h b/webrtc/modules/rtp_rtcp/source/tmmbr_help.h
index 09926762b10e61b3a8ad4707b4e5f08027e81d59..6236d5d43bdc32748deaff49d0c33628f00e86ca 100644
--- a/webrtc/modules/rtp_rtcp/source/tmmbr_help.h
+++ b/webrtc/modules/rtp_rtcp/source/tmmbr_help.h
@@ -12,34 +12,29 @@
#define WEBRTC_MODULES_RTP_RTCP_SOURCE_TMMBR_HELP_H_
#include <vector>
-
+#include "webrtc/modules/rtp_rtcp/source/rtcp_packet/tmmb_item.h"
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
#include "webrtc/typedefs.h"
namespace webrtc {
-class TMMBRSet
+class TMMBRSet : public std::vector<rtcp::TmmbItem>
{
public:
- TMMBRSet();
- ~TMMBRSet();
-
void VerifyAndAllocateSet(uint32_t minimumSize);
void VerifyAndAllocateSetKeepingData(uint32_t minimumSize);
// Number of valid data items in set.
- uint32_t lengthOfSet() const { return _lengthOfSet; }
+ uint32_t lengthOfSet() const { return size(); }
// Presently allocated max size of set.
- uint32_t sizeOfSet() const { return _sizeOfSet; }
- void clearSet() {
- _lengthOfSet = 0;
- }
+ uint32_t sizeOfSet() const { return capacity(); }
+ void clearSet() { clear(); }
uint32_t Tmmbr(int i) const {
- return _data.at(i).tmmbr;
+ return (*this)[i].bitrate_bps() / 1000;
}
uint32_t PacketOH(int i) const {
- return _data.at(i).packet_oh;
+ return (*this)[i].packet_overhead();
}
uint32_t Ssrc(int i) const {
- return _data.at(i).ssrc;
+ return (*this)[i].ssrc();
}
void SetEntry(unsigned int i,
uint32_t tmmbrSet,
@@ -58,21 +53,6 @@ public:
// Set entry data to zero, but keep it in table.
void ClearEntry(uint32_t idx);
-
- private:
- class SetElement {
- public:
- SetElement() : tmmbr(0), packet_oh(0), ssrc(0) {}
- uint32_t tmmbr;
- uint32_t packet_oh;
- uint32_t ssrc;
- };
-
- std::vector<SetElement> _data;
- // Number of places allocated.
- uint32_t _sizeOfSet;
- // NUmber of places currently in use.
- uint32_t _lengthOfSet;
};
class TMMBRHelp
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/tmmbr_help.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698