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

Side by Side Diff: webrtc/video/vie_encoder_unittest.cc

Issue 2716643002: Add framerate to VideoSinkWants and ability to signal on overuse (Closed)
Patch Set: Fix wireup, keep scale state per degradation pref Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 adapted_frame.set_ntp_time_ms(video_frame.ntp_time_ms()); 144 adapted_frame.set_ntp_time_ms(video_frame.ntp_time_ms());
145 test::FrameForwarder::IncomingCapturedFrame(adapted_frame); 145 test::FrameForwarder::IncomingCapturedFrame(adapted_frame);
146 } else { 146 } else {
147 test::FrameForwarder::IncomingCapturedFrame(video_frame); 147 test::FrameForwarder::IncomingCapturedFrame(video_frame);
148 } 148 }
149 } 149 }
150 150
151 void AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink, 151 void AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink,
152 const rtc::VideoSinkWants& wants) override { 152 const rtc::VideoSinkWants& wants) override {
153 rtc::CritScope cs(&crit_); 153 rtc::CritScope cs(&crit_);
154 adapter_.OnResolutionRequest(wants.target_pixel_count, 154 adapter_.OnResolutionFramerateRequest(wants.target_pixel_count,
155 wants.max_pixel_count); 155 wants.max_pixel_count,
156 wants.max_framerate_fps_);
156 test::FrameForwarder::AddOrUpdateSink(sink, wants); 157 test::FrameForwarder::AddOrUpdateSink(sink, wants);
157 } 158 }
158 159
159 cricket::VideoAdapter adapter_; 160 cricket::VideoAdapter adapter_;
160 bool adaptation_enabled_ GUARDED_BY(crit_); 161 bool adaptation_enabled_ GUARDED_BY(crit_);
161 }; 162 };
162 } // namespace 163 } // namespace
163 164
164 class ViEEncoderTest : public ::testing::Test { 165 class ViEEncoderTest : public ::testing::Test {
165 public: 166 public:
(...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after
1221 1222
1222 // Trigger CPU normal use, return to original resoluton; 1223 // Trigger CPU normal use, return to original resoluton;
1223 vie_encoder_->TriggerCpuNormalUsage(); 1224 vie_encoder_->TriggerCpuNormalUsage();
1224 video_source_.IncomingCapturedFrame( 1225 video_source_.IncomingCapturedFrame(
1225 CreateFrame(3, kFrameWidth, kFrameHeight)); 1226 CreateFrame(3, kFrameWidth, kFrameHeight));
1226 sink_.WaitForEncodedFrame(kFrameWidth, kFrameHeight); 1227 sink_.WaitForEncodedFrame(kFrameWidth, kFrameHeight);
1227 1228
1228 vie_encoder_->Stop(); 1229 vie_encoder_->Stop();
1229 } 1230 }
1230 } // namespace webrtc 1231 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698