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

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

Issue 1554223002: Move fake-handle frame creation into test target. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: add file Created 4 years, 11 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) 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> // max 10 #include <algorithm> // max
(...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after
1151 CreateStreams(); 1151 CreateStreams();
1152 1152
1153 // Prepare five input frames. Send ordinary VideoFrame and texture frames 1153 // Prepare five input frames. Send ordinary VideoFrame and texture frames
1154 // alternatively. 1154 // alternatively.
1155 std::vector<VideoFrame> input_frames; 1155 std::vector<VideoFrame> input_frames;
1156 int width = static_cast<int>(video_encoder_config_.streams[0].width); 1156 int width = static_cast<int>(video_encoder_config_.streams[0].width);
1157 int height = static_cast<int>(video_encoder_config_.streams[0].height); 1157 int height = static_cast<int>(video_encoder_config_.streams[0].height);
1158 test::FakeNativeHandle* handle1 = new test::FakeNativeHandle(); 1158 test::FakeNativeHandle* handle1 = new test::FakeNativeHandle();
1159 test::FakeNativeHandle* handle2 = new test::FakeNativeHandle(); 1159 test::FakeNativeHandle* handle2 = new test::FakeNativeHandle();
1160 test::FakeNativeHandle* handle3 = new test::FakeNativeHandle(); 1160 test::FakeNativeHandle* handle3 = new test::FakeNativeHandle();
1161 input_frames.push_back(test::CreateFakeNativeHandleFrame( 1161 input_frames.push_back(test::FakeNativeHandle::CreateFrame(
1162 handle1, width, height, 1, 1, kVideoRotation_0)); 1162 handle1, width, height, 1, 1, kVideoRotation_0));
1163 input_frames.push_back(test::CreateFakeNativeHandleFrame( 1163 input_frames.push_back(test::FakeNativeHandle::CreateFrame(
1164 handle2, width, height, 2, 2, kVideoRotation_0)); 1164 handle2, width, height, 2, 2, kVideoRotation_0));
1165 input_frames.push_back(CreateVideoFrame(width, height, 3)); 1165 input_frames.push_back(CreateVideoFrame(width, height, 3));
1166 input_frames.push_back(CreateVideoFrame(width, height, 4)); 1166 input_frames.push_back(CreateVideoFrame(width, height, 4));
1167 input_frames.push_back(test::CreateFakeNativeHandleFrame( 1167 input_frames.push_back(test::FakeNativeHandle::CreateFrame(
1168 handle3, width, height, 5, 5, kVideoRotation_0)); 1168 handle3, width, height, 5, 5, kVideoRotation_0));
1169 1169
1170 video_send_stream_->Start(); 1170 video_send_stream_->Start();
1171 for (size_t i = 0; i < input_frames.size(); i++) { 1171 for (size_t i = 0; i < input_frames.size(); i++) {
1172 video_send_stream_->Input()->IncomingCapturedFrame(input_frames[i]); 1172 video_send_stream_->Input()->IncomingCapturedFrame(input_frames[i]);
1173 // Do not send the next frame too fast, so the frame dropper won't drop it. 1173 // Do not send the next frame too fast, so the frame dropper won't drop it.
1174 if (i < input_frames.size() - 1) 1174 if (i < input_frames.size() - 1)
1175 SleepMs(1000 / video_encoder_config_.streams[0].max_framerate); 1175 SleepMs(1000 / video_encoder_config_.streams[0].max_framerate);
1176 // Wait until the output frame is received before sending the next input 1176 // Wait until the output frame is received before sending the next input
1177 // frame. Or the previous input frame may be replaced without delivering. 1177 // frame. Or the previous input frame may be replaced without delivering.
(...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after
2225 EXPECT_GT(vp9_header.num_ref_pics, 0u); 2225 EXPECT_GT(vp9_header.num_ref_pics, 0u);
2226 observation_complete_.Set(); 2226 observation_complete_.Set();
2227 } 2227 }
2228 } 2228 }
2229 } test; 2229 } test;
2230 2230
2231 RunBaseTest(&test, FakeNetworkPipe::Config()); 2231 RunBaseTest(&test, FakeNetworkPipe::Config());
2232 } 2232 }
2233 2233
2234 } // namespace webrtc 2234 } // namespace webrtc
OLDNEW
« webrtc/test/fake_texture_frame.cc ('K') | « webrtc/video/video_capture_input_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698