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

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: 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
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..ad3d9f050e10d71cb5c632c195a69b2e566e0f6d 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
@@ -1233,18 +1233,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 +1254,10 @@ int32_t RTCPReceiver::UpdateTMMBR() {
// empty bounding set has been sent
return 0;
}
- // Get net bitrate from bounding set depending on sent packet rate
danilchap 2016/08/10 11:18:48 comment say bounding set is used, but code used ca
- 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);
+ _cbRtcpBandwidthObserver->OnReceivedEstimatedBitrate(bitrate_bps);
}
return 0;
}
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/rtcp_sender.cc » ('j') | webrtc/modules/rtp_rtcp/source/tmmbr_help.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698