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

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

Issue 2781433002: Reland of Add framerate to VideoSinkWants and ability to signal on overuse (Closed)
Patch Set: Rebase error, initial scaling fix Created 3 years, 8 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
« no previous file with comments | « webrtc/test/video_capturer.cc ('k') | webrtc/video/overuse_frame_detector.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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 222
223 CreateVideoStreams(); 223 CreateVideoStreams();
224 Start(); 224 Start();
225 225
226 // Create frames that are smaller than the send width/height, this is done to 226 // Create frames that are smaller than the send width/height, this is done to
227 // check that the callbacks are done after processing video. 227 // check that the callbacks are done after processing video.
228 std::unique_ptr<test::FrameGenerator> frame_generator( 228 std::unique_ptr<test::FrameGenerator> frame_generator(
229 test::FrameGenerator::CreateSquareGenerator(kWidth, kHeight)); 229 test::FrameGenerator::CreateSquareGenerator(kWidth, kHeight));
230 test::FrameForwarder frame_forwarder; 230 test::FrameForwarder frame_forwarder;
231 video_send_stream_->SetSource( 231 video_send_stream_->SetSource(
232 &frame_forwarder, VideoSendStream::DegradationPreference::kBalanced); 232 &frame_forwarder,
233 VideoSendStream::DegradationPreference::kMaintainFramerate);
233 234
234 frame_forwarder.IncomingCapturedFrame(*frame_generator->NextFrame()); 235 frame_forwarder.IncomingCapturedFrame(*frame_generator->NextFrame());
235 EXPECT_TRUE(renderer.Wait()) 236 EXPECT_TRUE(renderer.Wait())
236 << "Timed out while waiting for the frame to render."; 237 << "Timed out while waiting for the frame to render.";
237 238
238 Stop(); 239 Stop();
239 240
240 sender_transport.StopSending(); 241 sender_transport.StopSending();
241 receiver_transport.StopSending(); 242 receiver_transport.StopSending();
242 243
(...skipping 24 matching lines...) Expand all
267 video_receive_configs_[0].renderer = &renderer; 268 video_receive_configs_[0].renderer = &renderer;
268 269
269 CreateVideoStreams(); 270 CreateVideoStreams();
270 Start(); 271 Start();
271 272
272 std::unique_ptr<test::FrameGenerator> frame_generator( 273 std::unique_ptr<test::FrameGenerator> frame_generator(
273 test::FrameGenerator::CreateSquareGenerator(kDefaultWidth, 274 test::FrameGenerator::CreateSquareGenerator(kDefaultWidth,
274 kDefaultHeight)); 275 kDefaultHeight));
275 test::FrameForwarder frame_forwarder; 276 test::FrameForwarder frame_forwarder;
276 video_send_stream_->SetSource( 277 video_send_stream_->SetSource(
277 &frame_forwarder, VideoSendStream::DegradationPreference::kBalanced); 278 &frame_forwarder,
279 VideoSendStream::DegradationPreference::kMaintainFramerate);
278 frame_forwarder.IncomingCapturedFrame(*frame_generator->NextFrame()); 280 frame_forwarder.IncomingCapturedFrame(*frame_generator->NextFrame());
279 281
280 EXPECT_TRUE(renderer.Wait()) 282 EXPECT_TRUE(renderer.Wait())
281 << "Timed out while waiting for the frame to render."; 283 << "Timed out while waiting for the frame to render.";
282 284
283 Stop(); 285 Stop();
284 286
285 sender_transport.StopSending(); 287 sender_transport.StopSending();
286 receiver_transport.StopSending(); 288 receiver_transport.StopSending();
287 289
(...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1501 UpdateReceiveConfig(i, &receive_config); 1503 UpdateReceiveConfig(i, &receive_config);
1502 1504
1503 receive_streams[i] = 1505 receive_streams[i] =
1504 receiver_call->CreateVideoReceiveStream(std::move(receive_config)); 1506 receiver_call->CreateVideoReceiveStream(std::move(receive_config));
1505 receive_streams[i]->Start(); 1507 receive_streams[i]->Start();
1506 1508
1507 frame_generators[i] = test::FrameGeneratorCapturer::Create( 1509 frame_generators[i] = test::FrameGeneratorCapturer::Create(
1508 width, height, 30, Clock::GetRealTimeClock()); 1510 width, height, 30, Clock::GetRealTimeClock());
1509 send_streams[i]->SetSource( 1511 send_streams[i]->SetSource(
1510 frame_generators[i], 1512 frame_generators[i],
1511 VideoSendStream::DegradationPreference::kBalanced); 1513 VideoSendStream::DegradationPreference::kMaintainFramerate);
1512 frame_generators[i]->Start(); 1514 frame_generators[i]->Start();
1513 } 1515 }
1514 1516
1515 Wait(); 1517 Wait();
1516 1518
1517 for (size_t i = 0; i < kNumStreams; ++i) { 1519 for (size_t i = 0; i < kNumStreams; ++i) {
1518 frame_generators[i]->Stop(); 1520 frame_generators[i]->Stop();
1519 sender_call->DestroyVideoSendStream(send_streams[i]); 1521 sender_call->DestroyVideoSendStream(send_streams[i]);
1520 receiver_call->DestroyVideoReceiveStream(receive_streams[i]); 1522 receiver_call->DestroyVideoReceiveStream(receive_streams[i]);
1521 delete frame_generators[i]; 1523 delete frame_generators[i];
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1948 video_receive_configs_[0].pre_decode_callback = &pre_decode_observer; 1950 video_receive_configs_[0].pre_decode_callback = &pre_decode_observer;
1949 1951
1950 CreateVideoStreams(); 1952 CreateVideoStreams();
1951 Start(); 1953 Start();
1952 1954
1953 std::unique_ptr<test::FrameGenerator> frame_generator( 1955 std::unique_ptr<test::FrameGenerator> frame_generator(
1954 test::FrameGenerator::CreateSquareGenerator(kDefaultWidth, 1956 test::FrameGenerator::CreateSquareGenerator(kDefaultWidth,
1955 kDefaultHeight)); 1957 kDefaultHeight));
1956 test::FrameForwarder forwarder; 1958 test::FrameForwarder forwarder;
1957 video_send_stream_->SetSource( 1959 video_send_stream_->SetSource(
1958 &forwarder, VideoSendStream::DegradationPreference::kBalanced); 1960 &forwarder, VideoSendStream::DegradationPreference::kMaintainFramerate);
1959 forwarder.IncomingCapturedFrame(*frame_generator->NextFrame()); 1961 forwarder.IncomingCapturedFrame(*frame_generator->NextFrame());
1960 1962
1961 EXPECT_TRUE(post_encode_observer.Wait()) 1963 EXPECT_TRUE(post_encode_observer.Wait())
1962 << "Timed out while waiting for send-side encoded-frame callback."; 1964 << "Timed out while waiting for send-side encoded-frame callback.";
1963 1965
1964 EXPECT_TRUE(pre_decode_observer.Wait()) 1966 EXPECT_TRUE(pre_decode_observer.Wait())
1965 << "Timed out while waiting for pre-decode encoded-frame callback."; 1967 << "Timed out while waiting for pre-decode encoded-frame callback.";
1966 1968
1967 post_encode_observer.ExpectEqualFrames(pre_decode_observer); 1969 post_encode_observer.ExpectEqualFrames(pre_decode_observer);
1968 1970
(...skipping 2326 matching lines...) Expand 10 before | Expand all | Expand 10 after
4295 std::unique_ptr<VideoEncoder> encoder_; 4297 std::unique_ptr<VideoEncoder> encoder_;
4296 std::unique_ptr<VideoDecoder> decoder_; 4298 std::unique_ptr<VideoDecoder> decoder_;
4297 rtc::CriticalSection crit_; 4299 rtc::CriticalSection crit_;
4298 int recorded_frames_ GUARDED_BY(crit_); 4300 int recorded_frames_ GUARDED_BY(crit_);
4299 } test(this); 4301 } test(this);
4300 4302
4301 RunBaseTest(&test); 4303 RunBaseTest(&test);
4302 } 4304 }
4303 4305
4304 } // namespace webrtc 4306 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/test/video_capturer.cc ('k') | webrtc/video/overuse_frame_detector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698