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; |
} |