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 1563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1574 handle1, width, height, 1, 1, kVideoRotation_0)); | 1574 handle1, width, height, 1, 1, kVideoRotation_0)); |
1575 input_frames.push_back(test::FakeNativeHandle::CreateFrame( | 1575 input_frames.push_back(test::FakeNativeHandle::CreateFrame( |
1576 handle2, width, height, 2, 2, kVideoRotation_0)); | 1576 handle2, width, height, 2, 2, kVideoRotation_0)); |
1577 input_frames.push_back(CreateVideoFrame(width, height, 3)); | 1577 input_frames.push_back(CreateVideoFrame(width, height, 3)); |
1578 input_frames.push_back(CreateVideoFrame(width, height, 4)); | 1578 input_frames.push_back(CreateVideoFrame(width, height, 4)); |
1579 input_frames.push_back(test::FakeNativeHandle::CreateFrame( | 1579 input_frames.push_back(test::FakeNativeHandle::CreateFrame( |
1580 handle3, width, height, 5, 5, kVideoRotation_0)); | 1580 handle3, width, height, 5, 5, kVideoRotation_0)); |
1581 | 1581 |
1582 video_send_stream_->Start(); | 1582 video_send_stream_->Start(); |
1583 test::FrameForwarder forwarder; | 1583 test::FrameForwarder forwarder; |
1584 video_send_stream_->SetSource(&forwarder); | 1584 video_send_stream_->SetSource(&forwarder, |
| 1585 false /* disable_resolution_scaling */); |
1585 for (size_t i = 0; i < input_frames.size(); i++) { | 1586 for (size_t i = 0; i < input_frames.size(); i++) { |
1586 forwarder.IncomingCapturedFrame(input_frames[i]); | 1587 forwarder.IncomingCapturedFrame(input_frames[i]); |
1587 // Wait until the output frame is received before sending the next input | 1588 // Wait until the output frame is received before sending the next input |
1588 // frame. Or the previous input frame may be replaced without delivering. | 1589 // frame. Or the previous input frame may be replaced without delivering. |
1589 observer.WaitOutputFrame(); | 1590 observer.WaitOutputFrame(); |
1590 } | 1591 } |
1591 video_send_stream_->Stop(); | 1592 video_send_stream_->Stop(); |
1592 video_send_stream_->SetSource(nullptr); | 1593 video_send_stream_->SetSource(nullptr, false); |
1593 | 1594 |
1594 // Test if the input and output frames are the same. render_time_ms and | 1595 // Test if the input and output frames are the same. render_time_ms and |
1595 // timestamp are not compared because capturer sets those values. | 1596 // timestamp are not compared because capturer sets those values. |
1596 ExpectEqualFramesVector(input_frames, observer.output_frames()); | 1597 ExpectEqualFramesVector(input_frames, observer.output_frames()); |
1597 | 1598 |
1598 DestroyStreams(); | 1599 DestroyStreams(); |
1599 } | 1600 } |
1600 | 1601 |
1601 void ExpectEqualFramesVector(const std::vector<VideoFrame>& frames1, | 1602 void ExpectEqualFramesVector(const std::vector<VideoFrame>& frames1, |
1602 const std::vector<VideoFrame>& frames2) { | 1603 const std::vector<VideoFrame>& frames2) { |
(...skipping 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2803 observation_complete_.Set(); | 2804 observation_complete_.Set(); |
2804 } | 2805 } |
2805 } | 2806 } |
2806 } test; | 2807 } test; |
2807 | 2808 |
2808 RunBaseTest(&test); | 2809 RunBaseTest(&test); |
2809 } | 2810 } |
2810 #endif // !defined(RTC_DISABLE_VP9) | 2811 #endif // !defined(RTC_DISABLE_VP9) |
2811 | 2812 |
2812 } // namespace webrtc | 2813 } // namespace webrtc |
OLD | NEW |