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

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

Issue 2234783002: Cleaned out candidateSet member from TMMBRHelp class (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: remove now unused include 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 | « no previous file | webrtc/modules/rtp_rtcp/source/rtcp_sender.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_receiver.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc b/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
index 31a11e28925759fd149de689d197a37f0876c5ca..8012f47dc0e7e3d6ec46b1e9efe452592bfc7422 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
@@ -13,6 +13,8 @@
#include <assert.h>
#include <string.h>
+#include <limits>
+
#include "webrtc/base/checks.h"
#include "webrtc/base/logging.h"
#include "webrtc/base/trace_event.h"
@@ -1233,18 +1235,16 @@ void RTCPReceiver::HandleTransportFeedback(
rtcp_parser->Iterate();
}
int32_t RTCPReceiver::UpdateTMMBR() {
- TMMBRHelp tmmbr_help;
- uint32_t bitrate = 0;
- uint32_t accNumCandidates = 0;
-
int32_t size = TMMBRReceived(0, 0, NULL);
+ TMMBRSet candidates;
if (size > 0) {
- TMMBRSet* candidateSet = tmmbr_help.VerifyAndAllocateCandidateSet(size);
+ candidates.reserve(size);
// Get candidate set from receiver.
- accNumCandidates = TMMBRReceived(size, accNumCandidates, candidateSet);
+ TMMBRReceived(size, 0, &candidates);
}
// Find bounding set
- std::vector<rtcp::TmmbItem> bounding = tmmbr_help.FindTMMBRBoundingSet();
+ std::vector<rtcp::TmmbItem> bounding =
+ TMMBRHelp::FindBoundingSet(std::move(candidates));
// Set bounding set
// Inform remote clients about the new bandwidth
// inform the remote client
@@ -1256,12 +1256,11 @@ int32_t RTCPReceiver::UpdateTMMBR() {
// empty bounding set has been sent
return 0;
}
- // Get net bitrate from bounding set depending on sent packet rate
- if (tmmbr_help.CalcMinBitRate(&bitrate)) {
- // we have a new bandwidth estimate on this channel
- if (_cbRtcpBandwidthObserver) {
- _cbRtcpBandwidthObserver->OnReceivedEstimatedBitrate(bitrate * 1000);
- }
+ // We have a new bandwidth estimate on this channel.
+ if (_cbRtcpBandwidthObserver) {
+ uint64_t bitrate_bps = TMMBRHelp::CalcMinBitrateBps(bounding);
+ if (bitrate_bps <= std::numeric_limits<uint32_t>::max())
+ _cbRtcpBandwidthObserver->OnReceivedEstimatedBitrate(bitrate_bps);
}
return 0;
}
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/rtcp_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698