Removes usages of repeating task without task queue argument.
This prepares from removing the overload in a followup CL.
Bug: webrtc:10365
Change-Id: I80db16e7d37944e3dc7d2799bbf45ef8f439a22c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126860
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27091}
diff --git a/modules/video_coding/utility/quality_scaler.cc b/modules/video_coding/utility/quality_scaler.cc
index 795f85e..4f4bb3b 100644
--- a/modules/video_coding/utility/quality_scaler.cc
+++ b/modules/video_coding/utility/quality_scaler.cc
@@ -68,13 +68,14 @@
rtc::ExpFilter smoother_;
};
-
-QualityScaler::QualityScaler(AdaptationObserverInterface* observer,
+QualityScaler::QualityScaler(rtc::TaskQueue* task_queue,
+ AdaptationObserverInterface* observer,
VideoEncoder::QpThresholds thresholds)
- : QualityScaler(observer, thresholds, kMeasureMs) {}
+ : QualityScaler(task_queue, observer, thresholds, kMeasureMs) {}
// Protected ctor, should not be called directly.
-QualityScaler::QualityScaler(AdaptationObserverInterface* observer,
+QualityScaler::QualityScaler(rtc::TaskQueue* task_queue,
+ AdaptationObserverInterface* observer,
VideoEncoder::QpThresholds thresholds,
int64_t sampling_period_ms)
: observer_(observer),
@@ -95,7 +96,7 @@
}
RTC_DCHECK(observer_ != nullptr);
check_qp_task_ = RepeatingTaskHandle::DelayedStart(
- TimeDelta::ms(GetSamplingPeriodMs()), [this]() {
+ task_queue->Get(), 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 c2f5b21..5e7ee0d 100644
--- a/modules/video_coding/utility/quality_scaler.h
+++ b/modules/video_coding/utility/quality_scaler.h
@@ -19,6 +19,7 @@
#include "rtc_base/experiments/quality_scaling_experiment.h"
#include "rtc_base/numerics/moving_average.h"
#include "rtc_base/sequenced_task_checker.h"
+#include "rtc_base/task_queue.h"
#include "rtc_base/task_utils/repeating_task.h"
namespace webrtc {
@@ -48,7 +49,8 @@
// Construct a QualityScaler with given |thresholds| and |observer|.
// This starts the quality scaler periodically checking what the average QP
// has been recently.
- QualityScaler(AdaptationObserverInterface* observer,
+ QualityScaler(rtc::TaskQueue* task_queue,
+ AdaptationObserverInterface* observer,
VideoEncoder::QpThresholds thresholds);
virtual ~QualityScaler();
// Should be called each time a frame is dropped at encoding.
@@ -59,7 +61,8 @@
// The following members declared protected for testing purposes.
protected:
- QualityScaler(AdaptationObserverInterface* observer,
+ QualityScaler(rtc::TaskQueue* task_queue,
+ 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 3424312..618439c 100644
--- a/modules/video_coding/utility/quality_scaler_unittest.cc
+++ b/modules/video_coding/utility/quality_scaler_unittest.cc
@@ -59,9 +59,10 @@
// Pass a lower sampling period to speed up the tests.
class QualityScalerUnderTest : public QualityScaler {
public:
- explicit QualityScalerUnderTest(AdaptationObserverInterface* observer,
+ explicit QualityScalerUnderTest(rtc::TaskQueue* task_queue,
+ AdaptationObserverInterface* observer,
VideoEncoder::QpThresholds thresholds)
- : QualityScaler(observer, thresholds, 5) {}
+ : QualityScaler(task_queue, observer, thresholds, 5) {}
};
class QualityScalerTest : public ::testing::Test,
@@ -81,7 +82,8 @@
observer_(new MockAdaptationObserver()) {
DO_SYNC(q_, {
qs_ = std::unique_ptr<QualityScaler>(new QualityScalerUnderTest(
- observer_.get(), VideoEncoder::QpThresholds(kLowQp, kHighQp)));
+ q_.get(), observer_.get(),
+ VideoEncoder::QpThresholds(kLowQp, kHighQp)));
});
}