| 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> // max | 10 #include <algorithm> // max |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" | 26 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" |
| 27 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" | 27 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" |
| 28 #include "webrtc/modules/rtp_rtcp/source/rtcp_sender.h" | 28 #include "webrtc/modules/rtp_rtcp/source/rtcp_sender.h" |
| 29 #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h" | 29 #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h" |
| 30 #include "webrtc/modules/rtp_rtcp/source/rtp_format_vp9.h" | 30 #include "webrtc/modules/rtp_rtcp/source/rtp_format_vp9.h" |
| 31 #include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h" | 31 #include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h" |
| 32 #include "webrtc/system_wrappers/include/sleep.h" | 32 #include "webrtc/system_wrappers/include/sleep.h" |
| 33 #include "webrtc/test/call_test.h" | 33 #include "webrtc/test/call_test.h" |
| 34 #include "webrtc/test/configurable_frame_size_encoder.h" | 34 #include "webrtc/test/configurable_frame_size_encoder.h" |
| 35 #include "webrtc/test/fake_texture_frame.h" | 35 #include "webrtc/test/fake_texture_frame.h" |
| 36 #include "webrtc/test/frame_generator.h" | |
| 37 #include "webrtc/test/frame_utils.h" | 36 #include "webrtc/test/frame_utils.h" |
| 38 #include "webrtc/test/null_transport.h" | 37 #include "webrtc/test/null_transport.h" |
| 39 #include "webrtc/test/testsupport/perf_test.h" | 38 #include "webrtc/test/testsupport/perf_test.h" |
| 40 #include "webrtc/video/send_statistics_proxy.h" | 39 #include "webrtc/video/send_statistics_proxy.h" |
| 41 #include "webrtc/video_frame.h" | 40 #include "webrtc/video_frame.h" |
| 42 #include "webrtc/video_send_stream.h" | 41 #include "webrtc/video_send_stream.h" |
| 43 | 42 |
| 44 namespace webrtc { | 43 namespace webrtc { |
| 45 | 44 |
| 46 enum VideoFormat { kGeneric, kVP8, }; | 45 enum VideoFormat { kGeneric, kVP8, }; |
| (...skipping 1420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1467 input_frames.push_back(test::FakeNativeHandle::CreateFrame( | 1466 input_frames.push_back(test::FakeNativeHandle::CreateFrame( |
| 1468 handle1, width, height, 1, 1, kVideoRotation_0)); | 1467 handle1, width, height, 1, 1, kVideoRotation_0)); |
| 1469 input_frames.push_back(test::FakeNativeHandle::CreateFrame( | 1468 input_frames.push_back(test::FakeNativeHandle::CreateFrame( |
| 1470 handle2, width, height, 2, 2, kVideoRotation_0)); | 1469 handle2, width, height, 2, 2, kVideoRotation_0)); |
| 1471 input_frames.push_back(CreateVideoFrame(width, height, 3)); | 1470 input_frames.push_back(CreateVideoFrame(width, height, 3)); |
| 1472 input_frames.push_back(CreateVideoFrame(width, height, 4)); | 1471 input_frames.push_back(CreateVideoFrame(width, height, 4)); |
| 1473 input_frames.push_back(test::FakeNativeHandle::CreateFrame( | 1472 input_frames.push_back(test::FakeNativeHandle::CreateFrame( |
| 1474 handle3, width, height, 5, 5, kVideoRotation_0)); | 1473 handle3, width, height, 5, 5, kVideoRotation_0)); |
| 1475 | 1474 |
| 1476 video_send_stream_->Start(); | 1475 video_send_stream_->Start(); |
| 1477 test::FrameForwarder forwarder; | |
| 1478 video_send_stream_->SetSource(&forwarder); | |
| 1479 for (size_t i = 0; i < input_frames.size(); i++) { | 1476 for (size_t i = 0; i < input_frames.size(); i++) { |
| 1480 forwarder.IncomingCapturedFrame(input_frames[i]); | 1477 video_send_stream_->Input()->IncomingCapturedFrame(input_frames[i]); |
| 1481 // Do not send the next frame too fast, so the frame dropper won't drop it. | 1478 // Do not send the next frame too fast, so the frame dropper won't drop it. |
| 1482 if (i < input_frames.size() - 1) | 1479 if (i < input_frames.size() - 1) |
| 1483 SleepMs(1000 / video_encoder_config_.streams[0].max_framerate); | 1480 SleepMs(1000 / video_encoder_config_.streams[0].max_framerate); |
| 1484 // Wait until the output frame is received before sending the next input | 1481 // Wait until the output frame is received before sending the next input |
| 1485 // frame. Or the previous input frame may be replaced without delivering. | 1482 // frame. Or the previous input frame may be replaced without delivering. |
| 1486 observer.WaitOutputFrame(); | 1483 observer.WaitOutputFrame(); |
| 1487 } | 1484 } |
| 1488 video_send_stream_->Stop(); | 1485 video_send_stream_->Stop(); |
| 1489 video_send_stream_->SetSource(nullptr); | |
| 1490 | 1486 |
| 1491 // Test if the input and output frames are the same. render_time_ms and | 1487 // Test if the input and output frames are the same. render_time_ms and |
| 1492 // timestamp are not compared because capturer sets those values. | 1488 // timestamp are not compared because capturer sets those values. |
| 1493 ExpectEqualFramesVector(input_frames, observer.output_frames()); | 1489 ExpectEqualFramesVector(input_frames, observer.output_frames()); |
| 1494 | 1490 |
| 1495 DestroyStreams(); | 1491 DestroyStreams(); |
| 1496 } | 1492 } |
| 1497 | 1493 |
| 1498 void ExpectEqualFramesVector(const std::vector<VideoFrame>& frames1, | 1494 void ExpectEqualFramesVector(const std::vector<VideoFrame>& frames1, |
| 1499 const std::vector<VideoFrame>& frames2) { | 1495 const std::vector<VideoFrame>& frames2) { |
| (...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2570 observation_complete_.Set(); | 2566 observation_complete_.Set(); |
| 2571 } | 2567 } |
| 2572 } | 2568 } |
| 2573 } test; | 2569 } test; |
| 2574 | 2570 |
| 2575 RunBaseTest(&test); | 2571 RunBaseTest(&test); |
| 2576 } | 2572 } |
| 2577 #endif // !defined(RTC_DISABLE_VP9) | 2573 #endif // !defined(RTC_DISABLE_VP9) |
| 2578 | 2574 |
| 2579 } // namespace webrtc | 2575 } // namespace webrtc |
| OLD | NEW |