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

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

Issue 2224933002: Cleaned out boundingSet member from TMMBRHelp class (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: nit from presubmit Created 4 years, 4 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 | « webrtc/modules/rtp_rtcp/source/tmmbr_help.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/rtp_rtcp/source/tmmbr_help.cc
diff --git a/webrtc/modules/rtp_rtcp/source/tmmbr_help.cc b/webrtc/modules/rtp_rtcp/source/tmmbr_help.cc
index c153181da9812d026f60e76c47cabb49153b253b..5aa8f945aaf4853756dde63194c7682044793b12 100644
--- a/webrtc/modules/rtp_rtcp/source/tmmbr_help.cc
+++ b/webrtc/modules/rtp_rtcp/source/tmmbr_help.cc
@@ -12,6 +12,7 @@
#include <algorithm>
#include <limits>
+#include <utility>
#include "webrtc/base/checks.h"
#include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_config.h"
@@ -60,7 +61,7 @@ TMMBRSet* TMMBRHelp::CandidateSet() {
return &_candidateSet;
}
-int32_t TMMBRHelp::FindTMMBRBoundingSet(TMMBRSet*& boundingSet) {
+std::vector<rtcp::TmmbItem> TMMBRHelp::FindTMMBRBoundingSet() {
// Work on local variable, will be modified
TMMBRSet candidateSet;
candidateSet.VerifyAndAllocateSet(_candidateSet.capacity());
@@ -80,16 +81,14 @@ int32_t TMMBRHelp::FindTMMBRBoundingSet(TMMBRSet*& boundingSet) {
// Number of set candidates
int32_t numSetCandidates = candidateSet.lengthOfSet();
// Find bounding set
- uint32_t numBoundingSet = 0;
+ std::vector<rtcp::TmmbItem> bounding;
if (numSetCandidates > 0) {
- FindBoundingSet(std::move(candidateSet), &_boundingSet);
- numBoundingSet = _boundingSet.size();
- if (numBoundingSet < 1 || (numBoundingSet > _candidateSet.size())) {
- return -1;
- }
- boundingSet = &_boundingSet;
+ FindBoundingSet(std::move(candidateSet), &bounding);
+ size_t numBoundingSet = bounding.size();
+ RTC_DCHECK_GE(numBoundingSet, 1u);
+ RTC_DCHECK_LE(numBoundingSet, _candidateSet.size());
}
- return numBoundingSet;
+ return bounding;
}
void TMMBRHelp::FindBoundingSet(std::vector<rtcp::TmmbItem> candidates,
@@ -231,13 +230,10 @@ void TMMBRHelp::FindBoundingSet(std::vector<rtcp::TmmbItem> candidates,
}
}
-bool TMMBRHelp::IsOwner(const uint32_t ssrc, const uint32_t length) const {
- if (length == 0) {
- // Empty bounding set.
- return false;
- }
- for (size_t i = 0; (i < length) && (i < _boundingSet.size()); ++i) {
- if (_boundingSet.Ssrc(i) == ssrc) {
+bool TMMBRHelp::IsOwner(const std::vector<rtcp::TmmbItem>& bounding,
+ uint32_t ssrc) {
+ for (const rtcp::TmmbItem& item : bounding) {
+ if (item.ssrc() == ssrc) {
return true;
}
}
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/tmmbr_help.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698