diff --git a/modules/video_coding/utility/quality_scaler.cc b/modules/video_coding/utility/quality_scaler.cc index a866aeb764..b7aca9a4fb 100644 --- a/modules/video_coding/utility/quality_scaler.cc +++ b/modules/video_coding/utility/quality_scaler.cc @@ -68,14 +68,12 @@ class QualityScaler::QpSmoother { rtc::ExpFilter smoother_; }; -QualityScaler::QualityScaler(rtc::TaskQueue* task_queue, - AdaptationObserverInterface* observer, +QualityScaler::QualityScaler(AdaptationObserverInterface* observer, VideoEncoder::QpThresholds thresholds) - : QualityScaler(task_queue, observer, thresholds, kMeasureMs) {} + : QualityScaler(observer, thresholds, kMeasureMs) {} // Protected ctor, should not be called directly. -QualityScaler::QualityScaler(rtc::TaskQueue* task_queue, - AdaptationObserverInterface* observer, +QualityScaler::QualityScaler(AdaptationObserverInterface* observer, VideoEncoder::QpThresholds thresholds, int64_t sampling_period_ms) : observer_(observer), @@ -106,7 +104,7 @@ QualityScaler::QualityScaler(rtc::TaskQueue* task_queue, } RTC_DCHECK(observer_ != nullptr); check_qp_task_ = RepeatingTaskHandle::DelayedStart( - task_queue->Get(), TimeDelta::ms(GetSamplingPeriodMs()), [this]() { + TaskQueueBase::Current(), TimeDelta::ms(GetSamplingPeriodMs()), [this]() { CheckQp(); return TimeDelta::ms(GetSamplingPeriodMs()); }); diff --git a/modules/video_coding/utility/quality_scaler.h b/modules/video_coding/utility/quality_scaler.h index eccd8f08c9..9556a58358 100644 --- a/modules/video_coding/utility/quality_scaler.h +++ b/modules/video_coding/utility/quality_scaler.h @@ -53,8 +53,7 @@ class QualityScaler { // Construct a QualityScaler with given |thresholds| and |observer|. // This starts the quality scaler periodically checking what the average QP // has been recently. - QualityScaler(rtc::TaskQueue* task_queue, - AdaptationObserverInterface* observer, + QualityScaler(AdaptationObserverInterface* observer, VideoEncoder::QpThresholds thresholds); virtual ~QualityScaler(); // Should be called each time a frame is dropped at encoding. @@ -68,8 +67,7 @@ class QualityScaler { // The following members declared protected for testing purposes. protected: - QualityScaler(rtc::TaskQueue* task_queue, - AdaptationObserverInterface* observer, + QualityScaler(AdaptationObserverInterface* observer, VideoEncoder::QpThresholds thresholds, int64_t sampling_period_ms); diff --git a/modules/video_coding/utility/quality_scaler_unittest.cc b/modules/video_coding/utility/quality_scaler_unittest.cc index 939865da35..6f16dc81bf 100644 --- a/modules/video_coding/utility/quality_scaler_unittest.cc +++ b/modules/video_coding/utility/quality_scaler_unittest.cc @@ -50,10 +50,9 @@ class MockAdaptationObserver : public AdaptationObserverInterface { // Pass a lower sampling period to speed up the tests. class QualityScalerUnderTest : public QualityScaler { public: - explicit QualityScalerUnderTest(rtc::TaskQueue* task_queue, - AdaptationObserverInterface* observer, + explicit QualityScalerUnderTest(AdaptationObserverInterface* observer, VideoEncoder::QpThresholds thresholds) - : QualityScaler(task_queue, observer, thresholds, 5) {} + : QualityScaler(observer, thresholds, 5) {} }; class QualityScalerTest : public ::testing::Test, @@ -74,8 +73,7 @@ class QualityScalerTest : public ::testing::Test, task_queue_.SendTask( [this] { qs_ = std::unique_ptr(new QualityScalerUnderTest( - &task_queue_, observer_.get(), - VideoEncoder::QpThresholds(kLowQp, kHighQp))); + observer_.get(), VideoEncoder::QpThresholds(kLowQp, kHighQp))); }, RTC_FROM_HERE); } diff --git a/video/video_stream_encoder.cc b/video/video_stream_encoder.cc index 716a56e978..6eaf8c719c 100644 --- a/video/video_stream_encoder.cc +++ b/video/video_stream_encoder.cc @@ -799,9 +799,8 @@ void VideoStreamEncoder::ConfigureQualityScaler( // upcast. AdaptationObserverInterface* observer = resource_adaptation_module_.get(); quality_scaler_ = std::make_unique( - &encoder_queue_, observer, - experimental_thresholds ? *experimental_thresholds - : *(scaling_settings.thresholds)); + observer, experimental_thresholds ? *experimental_thresholds + : *(scaling_settings.thresholds)); resource_adaptation_module_->SetIsQualityScalerEnabled(true); initial_framedrop_ = 0; }