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

Unified Diff: webrtc/video/overuse_frame_detector.cc

Issue 2304363002: Let ViEEncoder express resolution requests as Sinkwants (Closed)
Patch Set: Fix broken test RunOnTqNormalUsage. Created 4 years, 2 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
Index: webrtc/video/overuse_frame_detector.cc
diff --git a/webrtc/video/overuse_frame_detector.cc b/webrtc/video/overuse_frame_detector.cc
index bb89864bb0409f9bbee1a95168697266b9654238..0847d015568d0d15f214f069b526f5c1976b3afb 100644
--- a/webrtc/video/overuse_frame_detector.cc
+++ b/webrtc/video/overuse_frame_detector.cc
@@ -205,12 +205,10 @@ OveruseFrameDetector::OveruseFrameDetector(
Clock* clock,
const CpuOveruseOptions& options,
CpuOveruseObserver* observer,
- EncodedFrameObserver* encoder_timing,
CpuOveruseMetricsObserver* metrics_observer)
: check_overuse_task_(nullptr),
options_(options),
observer_(observer),
- encoder_timing_(encoder_timing),
metrics_observer_(metrics_observer),
clock_(clock),
num_process_times_(0),
@@ -228,7 +226,10 @@ OveruseFrameDetector::OveruseFrameDetector(
}
OveruseFrameDetector::~OveruseFrameDetector() {
- RTC_DCHECK(!check_overuse_task_) << "StopCheckForOverUse must be called.";
+ RTC_DCHECK_CALLED_SEQUENTIALLY(&task_checker_);
+ if (check_overuse_task_) {
+ check_overuse_task_->Stop();
+ }
}
void OveruseFrameDetector::StartCheckForOveruse() {
@@ -236,11 +237,6 @@ void OveruseFrameDetector::StartCheckForOveruse() {
RTC_DCHECK(!check_overuse_task_);
check_overuse_task_ = new CheckOveruseTask(this);
}
-void OveruseFrameDetector::StopCheckForOveruse() {
- RTC_DCHECK_CALLED_SEQUENTIALLY(&task_checker_);
- check_overuse_task_->Stop();
- check_overuse_task_ = nullptr;
-}
void OveruseFrameDetector::EncodedFrameTimeMeasured(int encode_duration_ms) {
RTC_DCHECK_CALLED_SEQUENTIALLY(&task_checker_);
@@ -280,7 +276,6 @@ void OveruseFrameDetector::ResetAll(int num_pixels) {
void OveruseFrameDetector::FrameCaptured(const VideoFrame& frame,
int64_t time_when_first_seen_ms) {
RTC_DCHECK_CALLED_SEQUENTIALLY(&task_checker_);
-
if (FrameSizeChanged(frame.width() * frame.height()) ||
FrameTimeoutDetected(time_when_first_seen_ms)) {
ResetAll(frame.width() * frame.height());
@@ -323,10 +318,6 @@ void OveruseFrameDetector::FrameSent(uint32_t timestamp,
if (timing.last_send_ms != -1) {
int encode_duration_ms =
static_cast<int>(timing.last_send_ms - timing.capture_ms);
- if (encoder_timing_) {
- encoder_timing_->OnEncodeTiming(timing.capture_ntp_ms,
- encode_duration_ms);
- }
if (last_processed_capture_time_ms_ != -1) {
int64_t diff_ms = timing.capture_ms - last_processed_capture_time_ms_;
usage_->AddSample(encode_duration_ms, diff_ms);

Powered by Google App Engine
This is Rietveld 408576698