OLD | NEW |
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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 video_receive_configs_[0].pre_render_callback = &pre_render_callback; | 207 video_receive_configs_[0].pre_render_callback = &pre_render_callback; |
208 video_receive_configs_[0].renderer = &renderer; | 208 video_receive_configs_[0].renderer = &renderer; |
209 | 209 |
210 CreateVideoStreams(); | 210 CreateVideoStreams(); |
211 Start(); | 211 Start(); |
212 | 212 |
213 // Create frames that are smaller than the send width/height, this is done to | 213 // Create frames that are smaller than the send width/height, this is done to |
214 // check that the callbacks are done after processing video. | 214 // check that the callbacks are done after processing video. |
215 std::unique_ptr<test::FrameGenerator> frame_generator( | 215 std::unique_ptr<test::FrameGenerator> frame_generator( |
216 test::FrameGenerator::CreateChromaGenerator(kWidth, kHeight)); | 216 test::FrameGenerator::CreateChromaGenerator(kWidth, kHeight)); |
217 video_send_stream_->Input()->IncomingCapturedFrame( | 217 test::FrameForwarder frame_forwarder; |
218 *frame_generator->NextFrame()); | 218 video_send_stream_->SetSource(&frame_forwarder); |
| 219 |
| 220 frame_forwarder.IncomingCapturedFrame(*frame_generator->NextFrame()); |
219 EXPECT_TRUE(pre_render_callback.Wait()) | 221 EXPECT_TRUE(pre_render_callback.Wait()) |
220 << "Timed out while waiting for pre-render callback."; | 222 << "Timed out while waiting for pre-render callback."; |
221 EXPECT_TRUE(renderer.Wait()) | 223 EXPECT_TRUE(renderer.Wait()) |
222 << "Timed out while waiting for the frame to render."; | 224 << "Timed out while waiting for the frame to render."; |
223 | 225 |
224 Stop(); | 226 Stop(); |
225 | 227 |
226 sender_transport.StopSending(); | 228 sender_transport.StopSending(); |
227 receiver_transport.StopSending(); | 229 receiver_transport.StopSending(); |
228 | 230 |
(...skipping 23 matching lines...) Expand all Loading... |
252 CreateMatchingReceiveConfigs(&receiver_transport); | 254 CreateMatchingReceiveConfigs(&receiver_transport); |
253 video_receive_configs_[0].renderer = &renderer; | 255 video_receive_configs_[0].renderer = &renderer; |
254 | 256 |
255 CreateVideoStreams(); | 257 CreateVideoStreams(); |
256 Start(); | 258 Start(); |
257 | 259 |
258 std::unique_ptr<test::FrameGenerator> frame_generator( | 260 std::unique_ptr<test::FrameGenerator> frame_generator( |
259 test::FrameGenerator::CreateChromaGenerator( | 261 test::FrameGenerator::CreateChromaGenerator( |
260 video_encoder_config_.streams[0].width, | 262 video_encoder_config_.streams[0].width, |
261 video_encoder_config_.streams[0].height)); | 263 video_encoder_config_.streams[0].height)); |
262 video_send_stream_->Input()->IncomingCapturedFrame( | 264 test::FrameForwarder frame_forwarder; |
263 *frame_generator->NextFrame()); | 265 video_send_stream_->SetSource(&frame_forwarder); |
| 266 frame_forwarder.IncomingCapturedFrame(*frame_generator->NextFrame()); |
264 | 267 |
265 EXPECT_TRUE(renderer.Wait()) | 268 EXPECT_TRUE(renderer.Wait()) |
266 << "Timed out while waiting for the frame to render."; | 269 << "Timed out while waiting for the frame to render."; |
267 | 270 |
268 Stop(); | 271 Stop(); |
269 | 272 |
270 sender_transport.StopSending(); | 273 sender_transport.StopSending(); |
271 receiver_transport.StopSending(); | 274 receiver_transport.StopSending(); |
272 | 275 |
273 DestroyStreams(); | 276 DestroyStreams(); |
(...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1297 std::unique_ptr<VideoDecoder>(decoder.decoder)); | 1300 std::unique_ptr<VideoDecoder>(decoder.decoder)); |
1298 receive_config.decoders.push_back(decoder); | 1301 receive_config.decoders.push_back(decoder); |
1299 | 1302 |
1300 UpdateReceiveConfig(i, &receive_config); | 1303 UpdateReceiveConfig(i, &receive_config); |
1301 | 1304 |
1302 receive_streams[i] = | 1305 receive_streams[i] = |
1303 receiver_call->CreateVideoReceiveStream(std::move(receive_config)); | 1306 receiver_call->CreateVideoReceiveStream(std::move(receive_config)); |
1304 receive_streams[i]->Start(); | 1307 receive_streams[i]->Start(); |
1305 | 1308 |
1306 frame_generators[i] = test::FrameGeneratorCapturer::Create( | 1309 frame_generators[i] = test::FrameGeneratorCapturer::Create( |
1307 send_streams[i]->Input(), width, height, 30, | 1310 width, height, 30, Clock::GetRealTimeClock()); |
1308 Clock::GetRealTimeClock()); | 1311 send_streams[i]->SetSource(frame_generators[i]); |
1309 frame_generators[i]->Start(); | 1312 frame_generators[i]->Start(); |
1310 } | 1313 } |
1311 | 1314 |
1312 Wait(); | 1315 Wait(); |
1313 | 1316 |
1314 for (size_t i = 0; i < kNumStreams; ++i) { | 1317 for (size_t i = 0; i < kNumStreams; ++i) { |
1315 frame_generators[i]->Stop(); | 1318 frame_generators[i]->Stop(); |
1316 sender_call->DestroyVideoSendStream(send_streams[i]); | 1319 sender_call->DestroyVideoSendStream(send_streams[i]); |
1317 receiver_call->DestroyVideoReceiveStream(receive_streams[i]); | 1320 receiver_call->DestroyVideoReceiveStream(receive_streams[i]); |
1318 delete frame_generators[i]; | 1321 delete frame_generators[i]; |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1758 video_send_config_.post_encode_callback = &post_encode_observer; | 1761 video_send_config_.post_encode_callback = &post_encode_observer; |
1759 video_receive_configs_[0].pre_decode_callback = &pre_decode_observer; | 1762 video_receive_configs_[0].pre_decode_callback = &pre_decode_observer; |
1760 | 1763 |
1761 CreateVideoStreams(); | 1764 CreateVideoStreams(); |
1762 Start(); | 1765 Start(); |
1763 | 1766 |
1764 std::unique_ptr<test::FrameGenerator> frame_generator( | 1767 std::unique_ptr<test::FrameGenerator> frame_generator( |
1765 test::FrameGenerator::CreateChromaGenerator( | 1768 test::FrameGenerator::CreateChromaGenerator( |
1766 video_encoder_config_.streams[0].width, | 1769 video_encoder_config_.streams[0].width, |
1767 video_encoder_config_.streams[0].height)); | 1770 video_encoder_config_.streams[0].height)); |
1768 video_send_stream_->Input()->IncomingCapturedFrame( | 1771 test::FrameForwarder forwarder; |
1769 *frame_generator->NextFrame()); | 1772 video_send_stream_->SetSource(&forwarder); |
| 1773 forwarder.IncomingCapturedFrame(*frame_generator->NextFrame()); |
1770 | 1774 |
1771 EXPECT_TRUE(post_encode_observer.Wait()) | 1775 EXPECT_TRUE(post_encode_observer.Wait()) |
1772 << "Timed out while waiting for send-side encoded-frame callback."; | 1776 << "Timed out while waiting for send-side encoded-frame callback."; |
1773 | 1777 |
1774 EXPECT_TRUE(pre_decode_observer.Wait()) | 1778 EXPECT_TRUE(pre_decode_observer.Wait()) |
1775 << "Timed out while waiting for pre-decode encoded-frame callback."; | 1779 << "Timed out while waiting for pre-decode encoded-frame callback."; |
1776 | 1780 |
1777 post_encode_observer.ExpectEqualFrames(pre_decode_observer); | 1781 post_encode_observer.ExpectEqualFrames(pre_decode_observer); |
1778 | 1782 |
1779 Stop(); | 1783 Stop(); |
(...skipping 1957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3737 private: | 3741 private: |
3738 bool video_observed_; | 3742 bool video_observed_; |
3739 bool audio_observed_; | 3743 bool audio_observed_; |
3740 SequenceNumberUnwrapper unwrapper_; | 3744 SequenceNumberUnwrapper unwrapper_; |
3741 std::set<int64_t> received_packet_ids_; | 3745 std::set<int64_t> received_packet_ids_; |
3742 } test; | 3746 } test; |
3743 | 3747 |
3744 RunBaseTest(&test); | 3748 RunBaseTest(&test); |
3745 } | 3749 } |
3746 } // namespace webrtc | 3750 } // namespace webrtc |
OLD | NEW |