| 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 1638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1649 handle1, width, height, 1, 1, kVideoRotation_0)); | 1649 handle1, width, height, 1, 1, kVideoRotation_0)); |
| 1650 input_frames.push_back(test::FakeNativeHandle::CreateFrame( | 1650 input_frames.push_back(test::FakeNativeHandle::CreateFrame( |
| 1651 handle2, width, height, 2, 2, kVideoRotation_0)); | 1651 handle2, width, height, 2, 2, kVideoRotation_0)); |
| 1652 input_frames.push_back(CreateVideoFrame(width, height, 3)); | 1652 input_frames.push_back(CreateVideoFrame(width, height, 3)); |
| 1653 input_frames.push_back(CreateVideoFrame(width, height, 4)); | 1653 input_frames.push_back(CreateVideoFrame(width, height, 4)); |
| 1654 input_frames.push_back(test::FakeNativeHandle::CreateFrame( | 1654 input_frames.push_back(test::FakeNativeHandle::CreateFrame( |
| 1655 handle3, width, height, 5, 5, kVideoRotation_0)); | 1655 handle3, width, height, 5, 5, kVideoRotation_0)); |
| 1656 | 1656 |
| 1657 video_send_stream_->Start(); | 1657 video_send_stream_->Start(); |
| 1658 test::FrameForwarder forwarder; | 1658 test::FrameForwarder forwarder; |
| 1659 video_send_stream_->SetSource(&forwarder); | 1659 video_send_stream_->SetSource( |
| 1660 &forwarder, VideoSendStream::DegradationPreference::kBalanced); |
| 1660 for (size_t i = 0; i < input_frames.size(); i++) { | 1661 for (size_t i = 0; i < input_frames.size(); i++) { |
| 1661 forwarder.IncomingCapturedFrame(input_frames[i]); | 1662 forwarder.IncomingCapturedFrame(input_frames[i]); |
| 1662 // Wait until the output frame is received before sending the next input | 1663 // Wait until the output frame is received before sending the next input |
| 1663 // frame. Or the previous input frame may be replaced without delivering. | 1664 // frame. Or the previous input frame may be replaced without delivering. |
| 1664 observer.WaitOutputFrame(); | 1665 observer.WaitOutputFrame(); |
| 1665 } | 1666 } |
| 1666 video_send_stream_->Stop(); | 1667 video_send_stream_->Stop(); |
| 1667 video_send_stream_->SetSource(nullptr); | 1668 video_send_stream_->SetSource( |
| 1669 nullptr, VideoSendStream::DegradationPreference::kBalanced); |
| 1668 | 1670 |
| 1669 // Test if the input and output frames are the same. render_time_ms and | 1671 // Test if the input and output frames are the same. render_time_ms and |
| 1670 // timestamp are not compared because capturer sets those values. | 1672 // timestamp are not compared because capturer sets those values. |
| 1671 ExpectEqualFramesVector(input_frames, observer.output_frames()); | 1673 ExpectEqualFramesVector(input_frames, observer.output_frames()); |
| 1672 | 1674 |
| 1673 DestroyStreams(); | 1675 DestroyStreams(); |
| 1674 } | 1676 } |
| 1675 | 1677 |
| 1676 void ExpectEqualFramesVector(const std::vector<VideoFrame>& frames1, | 1678 void ExpectEqualFramesVector(const std::vector<VideoFrame>& frames1, |
| 1677 const std::vector<VideoFrame>& frames2) { | 1679 const std::vector<VideoFrame>& frames2) { |
| (...skipping 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2888 observation_complete_.Set(); | 2890 observation_complete_.Set(); |
| 2889 } | 2891 } |
| 2890 } | 2892 } |
| 2891 } test; | 2893 } test; |
| 2892 | 2894 |
| 2893 RunBaseTest(&test); | 2895 RunBaseTest(&test); |
| 2894 } | 2896 } |
| 2895 #endif // !defined(RTC_DISABLE_VP9) | 2897 #endif // !defined(RTC_DISABLE_VP9) |
| 2896 | 2898 |
| 2897 } // namespace webrtc | 2899 } // namespace webrtc |
| OLD | NEW |