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

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

Issue 2304363002: Let ViEEncoder express resolution requests as Sinkwants (Closed)
Patch Set: Rebased. Created 4 years, 1 month 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
« no previous file with comments | « webrtc/video/encoder_rtcp_feedback_unittest.cc ('k') | webrtc/video/send_statistics_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 #include <algorithm> 10 #include <algorithm>
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 video_receive_configs_[0].renderer = &renderer; 226 video_receive_configs_[0].renderer = &renderer;
227 227
228 CreateVideoStreams(); 228 CreateVideoStreams();
229 Start(); 229 Start();
230 230
231 // Create frames that are smaller than the send width/height, this is done to 231 // Create frames that are smaller than the send width/height, this is done to
232 // check that the callbacks are done after processing video. 232 // check that the callbacks are done after processing video.
233 std::unique_ptr<test::FrameGenerator> frame_generator( 233 std::unique_ptr<test::FrameGenerator> frame_generator(
234 test::FrameGenerator::CreateChromaGenerator(kWidth, kHeight)); 234 test::FrameGenerator::CreateChromaGenerator(kWidth, kHeight));
235 test::FrameForwarder frame_forwarder; 235 test::FrameForwarder frame_forwarder;
236 video_send_stream_->SetSource(&frame_forwarder); 236 video_send_stream_->SetSource(
237 &frame_forwarder, VideoSendStream::DegradationPreference::kBalanced);
237 238
238 frame_forwarder.IncomingCapturedFrame(*frame_generator->NextFrame()); 239 frame_forwarder.IncomingCapturedFrame(*frame_generator->NextFrame());
239 EXPECT_TRUE(pre_render_callback.Wait()) 240 EXPECT_TRUE(pre_render_callback.Wait())
240 << "Timed out while waiting for pre-render callback."; 241 << "Timed out while waiting for pre-render callback.";
241 EXPECT_TRUE(renderer.Wait()) 242 EXPECT_TRUE(renderer.Wait())
242 << "Timed out while waiting for the frame to render."; 243 << "Timed out while waiting for the frame to render.";
243 244
244 Stop(); 245 Stop();
245 246
246 sender_transport.StopSending(); 247 sender_transport.StopSending();
(...skipping 25 matching lines...) Expand all
272 CreateMatchingReceiveConfigs(&receiver_transport); 273 CreateMatchingReceiveConfigs(&receiver_transport);
273 video_receive_configs_[0].renderer = &renderer; 274 video_receive_configs_[0].renderer = &renderer;
274 275
275 CreateVideoStreams(); 276 CreateVideoStreams();
276 Start(); 277 Start();
277 278
278 std::unique_ptr<test::FrameGenerator> frame_generator( 279 std::unique_ptr<test::FrameGenerator> frame_generator(
279 test::FrameGenerator::CreateChromaGenerator(kDefaultWidth, 280 test::FrameGenerator::CreateChromaGenerator(kDefaultWidth,
280 kDefaultHeight)); 281 kDefaultHeight));
281 test::FrameForwarder frame_forwarder; 282 test::FrameForwarder frame_forwarder;
282 video_send_stream_->SetSource(&frame_forwarder); 283 video_send_stream_->SetSource(
284 &frame_forwarder, VideoSendStream::DegradationPreference::kBalanced);
283 frame_forwarder.IncomingCapturedFrame(*frame_generator->NextFrame()); 285 frame_forwarder.IncomingCapturedFrame(*frame_generator->NextFrame());
284 286
285 EXPECT_TRUE(renderer.Wait()) 287 EXPECT_TRUE(renderer.Wait())
286 << "Timed out while waiting for the frame to render."; 288 << "Timed out while waiting for the frame to render.";
287 289
288 Stop(); 290 Stop();
289 291
290 sender_transport.StopSending(); 292 sender_transport.StopSending();
291 receiver_transport.StopSending(); 293 receiver_transport.StopSending();
292 294
(...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after
1310 receive_config.decoders.push_back(decoder); 1312 receive_config.decoders.push_back(decoder);
1311 1313
1312 UpdateReceiveConfig(i, &receive_config); 1314 UpdateReceiveConfig(i, &receive_config);
1313 1315
1314 receive_streams[i] = 1316 receive_streams[i] =
1315 receiver_call->CreateVideoReceiveStream(std::move(receive_config)); 1317 receiver_call->CreateVideoReceiveStream(std::move(receive_config));
1316 receive_streams[i]->Start(); 1318 receive_streams[i]->Start();
1317 1319
1318 frame_generators[i] = test::FrameGeneratorCapturer::Create( 1320 frame_generators[i] = test::FrameGeneratorCapturer::Create(
1319 width, height, 30, Clock::GetRealTimeClock()); 1321 width, height, 30, Clock::GetRealTimeClock());
1320 send_streams[i]->SetSource(frame_generators[i]); 1322 send_streams[i]->SetSource(
1323 frame_generators[i],
1324 VideoSendStream::DegradationPreference::kBalanced);
1321 frame_generators[i]->Start(); 1325 frame_generators[i]->Start();
1322 } 1326 }
1323 1327
1324 Wait(); 1328 Wait();
1325 1329
1326 for (size_t i = 0; i < kNumStreams; ++i) { 1330 for (size_t i = 0; i < kNumStreams; ++i) {
1327 frame_generators[i]->Stop(); 1331 frame_generators[i]->Stop();
1328 sender_call->DestroyVideoSendStream(send_streams[i]); 1332 sender_call->DestroyVideoSendStream(send_streams[i]);
1329 receiver_call->DestroyVideoReceiveStream(receive_streams[i]); 1333 receiver_call->DestroyVideoReceiveStream(receive_streams[i]);
1330 delete frame_generators[i]; 1334 delete frame_generators[i];
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
1770 video_send_config_.post_encode_callback = &post_encode_observer; 1774 video_send_config_.post_encode_callback = &post_encode_observer;
1771 video_receive_configs_[0].pre_decode_callback = &pre_decode_observer; 1775 video_receive_configs_[0].pre_decode_callback = &pre_decode_observer;
1772 1776
1773 CreateVideoStreams(); 1777 CreateVideoStreams();
1774 Start(); 1778 Start();
1775 1779
1776 std::unique_ptr<test::FrameGenerator> frame_generator( 1780 std::unique_ptr<test::FrameGenerator> frame_generator(
1777 test::FrameGenerator::CreateChromaGenerator(kDefaultWidth, 1781 test::FrameGenerator::CreateChromaGenerator(kDefaultWidth,
1778 kDefaultHeight)); 1782 kDefaultHeight));
1779 test::FrameForwarder forwarder; 1783 test::FrameForwarder forwarder;
1780 video_send_stream_->SetSource(&forwarder); 1784 video_send_stream_->SetSource(
1785 &forwarder, VideoSendStream::DegradationPreference::kBalanced);
1781 forwarder.IncomingCapturedFrame(*frame_generator->NextFrame()); 1786 forwarder.IncomingCapturedFrame(*frame_generator->NextFrame());
1782 1787
1783 EXPECT_TRUE(post_encode_observer.Wait()) 1788 EXPECT_TRUE(post_encode_observer.Wait())
1784 << "Timed out while waiting for send-side encoded-frame callback."; 1789 << "Timed out while waiting for send-side encoded-frame callback.";
1785 1790
1786 EXPECT_TRUE(pre_decode_observer.Wait()) 1791 EXPECT_TRUE(pre_decode_observer.Wait())
1787 << "Timed out while waiting for pre-decode encoded-frame callback."; 1792 << "Timed out while waiting for pre-decode encoded-frame callback.";
1788 1793
1789 post_encode_observer.ExpectEqualFrames(pre_decode_observer); 1794 post_encode_observer.ExpectEqualFrames(pre_decode_observer);
1790 1795
(...skipping 2171 matching lines...) Expand 10 before | Expand all | Expand 10 after
3962 std::unique_ptr<VideoEncoder> encoder_; 3967 std::unique_ptr<VideoEncoder> encoder_;
3963 std::unique_ptr<VideoDecoder> decoder_; 3968 std::unique_ptr<VideoDecoder> decoder_;
3964 rtc::CriticalSection crit_; 3969 rtc::CriticalSection crit_;
3965 int recorded_frames_ GUARDED_BY(crit_); 3970 int recorded_frames_ GUARDED_BY(crit_);
3966 } test(this); 3971 } test(this);
3967 3972
3968 RunBaseTest(&test); 3973 RunBaseTest(&test);
3969 } 3974 }
3970 3975
3971 } // namespace webrtc 3976 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/encoder_rtcp_feedback_unittest.cc ('k') | webrtc/video/send_statistics_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698