Index: webrtc/modules/congestion_controller/congestion_controller.cc |
diff --git a/webrtc/modules/congestion_controller/congestion_controller.cc b/webrtc/modules/congestion_controller/congestion_controller.cc |
index 44b2f41e86b85117b1e121ec6c56de1a028c29d4..7c492c4813743345a8b47223bf088b79a98e59c8 100644 |
--- a/webrtc/modules/congestion_controller/congestion_controller.cc |
+++ b/webrtc/modules/congestion_controller/congestion_controller.cc |
@@ -23,6 +23,7 @@ |
#include "webrtc/modules/remote_bitrate_estimator/include/bwe_defines.h" |
#include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.h" |
#include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h" |
+#include "webrtc/modules/utility/include/process_thread.h" |
#include "webrtc/system_wrappers/include/critical_section_wrapper.h" |
namespace webrtc { |
@@ -173,6 +174,7 @@ CongestionController::CongestionController( |
: clock_(clock), |
observer_(observer), |
packet_router_(packet_router), |
+ pacer_thread_(ProcessThread::Create("PacerThread")), |
perkj_webrtc
2017/01/02 09:18:58
There are upstreams projects that use CongestionCo
nisse-webrtc
2017/01/09 13:43:46
I can try moving it to the pacer itself. One obvio
|
pacer_(std::move(pacer)), |
remote_bitrate_estimator_( |
new WrappingBitrateEstimator(remote_bitrate_observer, clock_)), |
@@ -193,9 +195,18 @@ CongestionController::CongestionController( |
network_state_(kNetworkUp) { |
transport_feedback_adapter_.InitBwe(); |
transport_feedback_adapter_.SetMinBitrate(min_bitrate_bps_); |
+ |
+ pacer_thread_->RegisterModule(pacer_.get()); |
+ pacer_thread_->RegisterModule(&remote_estimator_proxy_); |
+ pacer_thread_->Start(); |
+ |
} |
-CongestionController::~CongestionController() {} |
+CongestionController::~CongestionController() { |
+ pacer_thread_->Stop(); |
+ pacer_thread_->DeRegisterModule(pacer_.get()); |
+ pacer_thread_->DeRegisterModule(&remote_estimator_proxy_); |
+} |
void CongestionController::SetBweBitrates(int min_bitrate_bps, |
int start_bitrate_bps, |