OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/client/software_video_renderer.h" | 5 #include "remoting/client/software_video_renderer.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/memory/scoped_vector.h" | 13 #include "base/memory/scoped_vector.h" |
14 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
15 #include "base/run_loop.h" | 15 #include "base/run_loop.h" |
16 #include "base/threading/thread.h" | 16 #include "base/threading/thread.h" |
17 #include "remoting/client/frame_consumer.h" | |
18 #include "remoting/codec/video_encoder_verbatim.h" | 17 #include "remoting/codec/video_encoder_verbatim.h" |
19 #include "remoting/proto/video.pb.h" | 18 #include "remoting/proto/video.pb.h" |
| 19 #include "remoting/protocol/frame_consumer.h" |
20 #include "remoting/protocol/session_config.h" | 20 #include "remoting/protocol/session_config.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
22 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" | 22 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" |
23 | 23 |
24 using webrtc::DesktopFrame; | 24 using webrtc::DesktopFrame; |
25 | 25 |
26 namespace remoting { | 26 namespace remoting { |
27 | 27 |
28 namespace { | 28 namespace { |
29 | 29 |
30 const int kFrameWidth = 200; | 30 const int kFrameWidth = 200; |
31 const int kFrameHeight = 200; | 31 const int kFrameHeight = 200; |
32 | 32 |
33 class TestFrameConsumer : public FrameConsumer { | 33 class TestFrameConsumer : public protocol::FrameConsumer { |
34 public: | 34 public: |
35 TestFrameConsumer() {} | 35 TestFrameConsumer() {} |
36 ~TestFrameConsumer() override {} | 36 ~TestFrameConsumer() override {} |
37 | 37 |
38 scoped_ptr<DesktopFrame> WaitForNextFrame(base::Closure* out_done_callback) { | 38 scoped_ptr<DesktopFrame> WaitForNextFrame(base::Closure* out_done_callback) { |
39 EXPECT_TRUE(thread_checker_.CalledOnValidThread()); | 39 EXPECT_TRUE(thread_checker_.CalledOnValidThread()); |
40 frame_run_loop_.reset(new base::RunLoop()); | 40 frame_run_loop_.reset(new base::RunLoop()); |
41 frame_run_loop_->Run(); | 41 frame_run_loop_->Run(); |
42 frame_run_loop_.reset(); | 42 frame_run_loop_.reset(); |
43 *out_done_callback = last_frame_done_callback_; | 43 *out_done_callback = last_frame_done_callback_; |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 175 |
176 EXPECT_FALSE(callback_called[frame_index]); | 176 EXPECT_FALSE(callback_called[frame_index]); |
177 done_callback.Run(); | 177 done_callback.Run(); |
178 EXPECT_TRUE(callback_called[frame_index]); | 178 EXPECT_TRUE(callback_called[frame_index]); |
179 | 179 |
180 EXPECT_TRUE(CompareFrames(*test_frames[frame_index], *decoded_frame)); | 180 EXPECT_TRUE(CompareFrames(*test_frames[frame_index], *decoded_frame)); |
181 } | 181 } |
182 } | 182 } |
183 | 183 |
184 } // namespace remoting | 184 } // namespace remoting |
OLD | NEW |