Bug 877954 - Enable QM if load adaption is enabled. r=jesup
authorGian-Carlo Pascutto <gpascutto@mozilla.com>
Thu, 13 Mar 2014 11:06:27 +0100
changeset 191621 cb28fb0f9febd718fcb4afdc0fdce589db9177cd
parent 191620 7d879d9643edadb953af9ab1bb6c6c7273e0c480
child 191622 41473d14f297ea3670f2ea4270ae557eb8335369
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs877954
milestone30.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 877954 - Enable QM if load adaption is enabled. r=jesup
media/webrtc/trunk/webrtc/video_engine/vie_encoder.cc
--- a/media/webrtc/trunk/webrtc/video_engine/vie_encoder.cc
+++ b/media/webrtc/trunk/webrtc/video_engine/vie_encoder.cc
@@ -195,18 +195,18 @@ bool ViEEncoder::Init() {
   if (vcm_.InitializeSender() != 0) {
     WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
                  ViEId(engine_id_, channel_id_),
                  "%s InitializeSender failure", __FUNCTION__);
     return false;
   }
   vpm_.EnableTemporalDecimation(true);
 
-  // Enable/disable content analysis: off by default for now.
-  vpm_.EnableContentAnalysis(false);
+  // Enable content analysis if load management enabled
+  vpm_.EnableContentAnalysis(load_manager_ != NULL);
 
   if (module_process_thread_.RegisterModule(&vcm_) != 0 ||
       module_process_thread_.RegisterModule(default_rtp_rtcp_.get()) != 0 ||
       module_process_thread_.RegisterModule(paced_sender_.get()) != 0) {
     WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,
                  ViEId(engine_id_, channel_id_),
                  "%s RegisterModule failure", __FUNCTION__);
     return false;
@@ -268,17 +268,20 @@ bool ViEEncoder::Init() {
                  "VCM::RegisterQMCallback failure");
     return false;
   }
   return true;
 }
 
 void ViEEncoder::SetLoadManager(CPULoadStateCallbackInvoker* load_manager) {
   load_manager_ = load_manager;
-  load_manager_->AddObserver(loadstate_observer_.get());
+  if (load_manager_) {
+      load_manager_->AddObserver(loadstate_observer_.get());
+  }
+  vpm_.EnableContentAnalysis(load_manager != NULL);
 }
 
 ViEEncoder::~ViEEncoder() {
   WEBRTC_TRACE(webrtc::kTraceMemory, webrtc::kTraceVideo,
                ViEId(engine_id_, channel_id_),
                "ViEEncoder Destructor 0x%p, engine_id: %d", this, engine_id_);
   if (bitrate_controller_) {
     bitrate_controller_->RemoveBitrateObserver(bitrate_observer_.get());