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

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

Issue 2716643002: Add framerate to VideoSinkWants and ability to signal on overuse (Closed)
Patch Set: Comments 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
« 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 214
215 CreateVideoStreams(); 215 CreateVideoStreams();
216 Start(); 216 Start();
217 217
218 // Create frames that are smaller than the send width/height, this is done to 218 // Create frames that are smaller than the send width/height, this is done to
219 // check that the callbacks are done after processing video. 219 // check that the callbacks are done after processing video.
220 std::unique_ptr<test::FrameGenerator> frame_generator( 220 std::unique_ptr<test::FrameGenerator> frame_generator(
221 test::FrameGenerator::CreateSquareGenerator(kWidth, kHeight)); 221 test::FrameGenerator::CreateSquareGenerator(kWidth, kHeight));
222 test::FrameForwarder frame_forwarder; 222 test::FrameForwarder frame_forwarder;
223 video_send_stream_->SetSource( 223 video_send_stream_->SetSource(
224 &frame_forwarder, VideoSendStream::DegradationPreference::kBalanced); 224 &frame_forwarder,
225 VideoSendStream::DegradationPreference::kMaintainFramerate);
225 226
226 frame_forwarder.IncomingCapturedFrame(*frame_generator->NextFrame()); 227 frame_forwarder.IncomingCapturedFrame(*frame_generator->NextFrame());
227 EXPECT_TRUE(renderer.Wait()) 228 EXPECT_TRUE(renderer.Wait())
228 << "Timed out while waiting for the frame to render."; 229 << "Timed out while waiting for the frame to render.";
229 230
230 Stop(); 231 Stop();
231 232
232 sender_transport.StopSending(); 233 sender_transport.StopSending();
233 receiver_transport.StopSending(); 234 receiver_transport.StopSending();
234 235
(...skipping 24 matching lines...) Expand all
259 video_receive_configs_[0].renderer = &renderer; 260 video_receive_configs_[0].renderer = &renderer;
260 261
261 CreateVideoStreams(); 262 CreateVideoStreams();
262 Start(); 263 Start();
263 264
264 std::unique_ptr<test::FrameGenerator> frame_generator( 265 std::unique_ptr<test::FrameGenerator> frame_generator(
265 test::FrameGenerator::CreateSquareGenerator(kDefaultWidth, 266 test::FrameGenerator::CreateSquareGenerator(kDefaultWidth,
266 kDefaultHeight)); 267 kDefaultHeight));
267 test::FrameForwarder frame_forwarder; 268 test::FrameForwarder frame_forwarder;
268 video_send_stream_->SetSource( 269 video_send_stream_->SetSource(
269 &frame_forwarder, VideoSendStream::DegradationPreference::kBalanced); 270 &frame_forwarder,
271 VideoSendStream::DegradationPreference::kMaintainFramerate);
270 frame_forwarder.IncomingCapturedFrame(*frame_generator->NextFrame()); 272 frame_forwarder.IncomingCapturedFrame(*frame_generator->NextFrame());
271 273
272 EXPECT_TRUE(renderer.Wait()) 274 EXPECT_TRUE(renderer.Wait())
273 << "Timed out while waiting for the frame to render."; 275 << "Timed out while waiting for the frame to render.";
274 276
275 Stop(); 277 Stop();
276 278
277 sender_transport.StopSending(); 279 sender_transport.StopSending();
278 receiver_transport.StopSending(); 280 receiver_transport.StopSending();
279 281
(...skipping 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after
1490 UpdateReceiveConfig(i, &receive_config); 1492 UpdateReceiveConfig(i, &receive_config);
1491 1493
1492 receive_streams[i] = 1494 receive_streams[i] =
1493 receiver_call->CreateVideoReceiveStream(std::move(receive_config)); 1495 receiver_call->CreateVideoReceiveStream(std::move(receive_config));
1494 receive_streams[i]->Start(); 1496 receive_streams[i]->Start();
1495 1497
1496 frame_generators[i] = test::FrameGeneratorCapturer::Create( 1498 frame_generators[i] = test::FrameGeneratorCapturer::Create(
1497 width, height, 30, Clock::GetRealTimeClock()); 1499 width, height, 30, Clock::GetRealTimeClock());
1498 send_streams[i]->SetSource( 1500 send_streams[i]->SetSource(
1499 frame_generators[i], 1501 frame_generators[i],
1500 VideoSendStream::DegradationPreference::kBalanced); 1502 VideoSendStream::DegradationPreference::kMaintainFramerate);
1501 frame_generators[i]->Start(); 1503 frame_generators[i]->Start();
1502 } 1504 }
1503 1505
1504 Wait(); 1506 Wait();
1505 1507
1506 for (size_t i = 0; i < kNumStreams; ++i) { 1508 for (size_t i = 0; i < kNumStreams; ++i) {
1507 frame_generators[i]->Stop(); 1509 frame_generators[i]->Stop();
1508 sender_call->DestroyVideoSendStream(send_streams[i]); 1510 sender_call->DestroyVideoSendStream(send_streams[i]);
1509 receiver_call->DestroyVideoReceiveStream(receive_streams[i]); 1511 receiver_call->DestroyVideoReceiveStream(receive_streams[i]);
1510 delete frame_generators[i]; 1512 delete frame_generators[i];
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1937 video_receive_configs_[0].pre_decode_callback = &pre_decode_observer; 1939 video_receive_configs_[0].pre_decode_callback = &pre_decode_observer;
1938 1940
1939 CreateVideoStreams(); 1941 CreateVideoStreams();
1940 Start(); 1942 Start();
1941 1943
1942 std::unique_ptr<test::FrameGenerator> frame_generator( 1944 std::unique_ptr<test::FrameGenerator> frame_generator(
1943 test::FrameGenerator::CreateSquareGenerator(kDefaultWidth, 1945 test::FrameGenerator::CreateSquareGenerator(kDefaultWidth,
1944 kDefaultHeight)); 1946 kDefaultHeight));
1945 test::FrameForwarder forwarder; 1947 test::FrameForwarder forwarder;
1946 video_send_stream_->SetSource( 1948 video_send_stream_->SetSource(
1947 &forwarder, VideoSendStream::DegradationPreference::kBalanced); 1949 &forwarder, VideoSendStream::DegradationPreference::kMaintainFramerate);
1948 forwarder.IncomingCapturedFrame(*frame_generator->NextFrame()); 1950 forwarder.IncomingCapturedFrame(*frame_generator->NextFrame());
1949 1951
1950 EXPECT_TRUE(post_encode_observer.Wait()) 1952 EXPECT_TRUE(post_encode_observer.Wait())
1951 << "Timed out while waiting for send-side encoded-frame callback."; 1953 << "Timed out while waiting for send-side encoded-frame callback.";
1952 1954
1953 EXPECT_TRUE(pre_decode_observer.Wait()) 1955 EXPECT_TRUE(pre_decode_observer.Wait())
1954 << "Timed out while waiting for pre-decode encoded-frame callback."; 1956 << "Timed out while waiting for pre-decode encoded-frame callback.";
1955 1957
1956 post_encode_observer.ExpectEqualFrames(pre_decode_observer); 1958 post_encode_observer.ExpectEqualFrames(pre_decode_observer);
1957 1959
(...skipping 2222 matching lines...) Expand 10 before | Expand all | Expand 10 after
4180 std::unique_ptr<VideoEncoder> encoder_; 4182 std::unique_ptr<VideoEncoder> encoder_;
4181 std::unique_ptr<VideoDecoder> decoder_; 4183 std::unique_ptr<VideoDecoder> decoder_;
4182 rtc::CriticalSection crit_; 4184 rtc::CriticalSection crit_;
4183 int recorded_frames_ GUARDED_BY(crit_); 4185 int recorded_frames_ GUARDED_BY(crit_);
4184 } test(this); 4186 } test(this);
4185 4187
4186 RunBaseTest(&test); 4188 RunBaseTest(&test);
4187 } 4189 }
4188 4190
4189 } // namespace webrtc 4191 } // 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