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

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

Issue 1959013003: TMMBRHelp moved from member object/base class to stack object, (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: includes adjusted Created 4 years, 7 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/rtcp_receiver.h ('k') | webrtc/modules/rtp_rtcp/source/rtcp_sender.h » ('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 3e8e47fbd377372cac9bae6b2f6389464eb10e7c..34b2ce3687f4f442787ea5c27d1ccd7ea006c86b 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
@@ -20,6 +20,7 @@
#include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h"
#include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h"
#include "webrtc/modules/rtp_rtcp/source/time_util.h"
+#include "webrtc/modules/rtp_rtcp/source/tmmbr_help.h"
#include "webrtc/system_wrappers/include/ntp_time.h"
namespace webrtc {
@@ -44,8 +45,7 @@ RTCPReceiver::RTCPReceiver(
RtcpIntraFrameObserver* rtcp_intra_frame_observer,
TransportFeedbackObserver* transport_feedback_observer,
ModuleRtpRtcpImpl* owner)
- : TMMBRHelp(),
- _clock(clock),
+ : _clock(clock),
receiver_only_(receiver_only),
_lastReceived(0),
_rtpRtcp(*owner),
@@ -1233,22 +1233,20 @@ void RTCPReceiver::HandleTransportFeedback(
rtcp_parser->Iterate();
}
int32_t RTCPReceiver::UpdateTMMBR() {
+ TMMBRHelp tmmbr_help;
int32_t numBoundingSet = 0;
uint32_t bitrate = 0;
uint32_t accNumCandidates = 0;
int32_t size = TMMBRReceived(0, 0, NULL);
if (size > 0) {
- TMMBRSet* candidateSet = VerifyAndAllocateCandidateSet(size);
+ TMMBRSet* candidateSet = tmmbr_help.VerifyAndAllocateCandidateSet(size);
// Get candidate set from receiver.
accNumCandidates = TMMBRReceived(size, accNumCandidates, candidateSet);
- } else {
- // Candidate set empty.
- VerifyAndAllocateCandidateSet(0); // resets candidate set
}
// Find bounding set
TMMBRSet* boundingSet = NULL;
- numBoundingSet = FindTMMBRBoundingSet(boundingSet);
+ numBoundingSet = tmmbr_help.FindTMMBRBoundingSet(boundingSet);
if (numBoundingSet == -1) {
LOG(LS_WARNING) << "Failed to find TMMBR bounding set.";
return -1;
@@ -1265,7 +1263,7 @@ int32_t RTCPReceiver::UpdateTMMBR() {
return 0;
}
// Get net bitrate from bounding set depending on sent packet rate
- if (CalcMinBitRate(&bitrate)) {
+ if (tmmbr_help.CalcMinBitRate(&bitrate)) {
// we have a new bandwidth estimate on this channel
if (_cbRtcpBandwidthObserver) {
_cbRtcpBandwidthObserver->OnReceivedEstimatedBitrate(bitrate * 1000);
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_receiver.h ('k') | webrtc/modules/rtp_rtcp/source/rtcp_sender.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698