| 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/protocol/video_frame_pump.h" | 5 #include "remoting/protocol/video_frame_pump.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 callback_ = callback; | 111 callback_ = callback; |
| 112 } | 112 } |
| 113 | 113 |
| 114 void Capture(const webrtc::DesktopRegion& rect) override { | 114 void Capture(const webrtc::DesktopRegion& rect) override { |
| 115 EXPECT_TRUE(task_runner_->BelongsToCurrentThread()); | 115 EXPECT_TRUE(task_runner_->BelongsToCurrentThread()); |
| 116 | 116 |
| 117 std::unique_ptr<webrtc::DesktopFrame> frame( | 117 std::unique_ptr<webrtc::DesktopFrame> frame( |
| 118 new webrtc::BasicDesktopFrame(webrtc::DesktopSize(kWidth, kHeight))); | 118 new webrtc::BasicDesktopFrame(webrtc::DesktopSize(kWidth, kHeight))); |
| 119 frame->mutable_updated_region()->SetRect( | 119 frame->mutable_updated_region()->SetRect( |
| 120 webrtc::DesktopRect::MakeXYWH(0, 0, 10, 10)); | 120 webrtc::DesktopRect::MakeXYWH(0, 0, 10, 10)); |
| 121 callback_->OnCaptureCompleted(frame.release()); | 121 callback_->OnCaptureResult(webrtc::DesktopCapturer::Result::SUCCESS, |
| 122 std::move(frame)); |
| 122 } | 123 } |
| 123 | 124 |
| 124 private: | 125 private: |
| 125 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 126 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 126 webrtc::DesktopCapturer::Callback* callback_; | 127 webrtc::DesktopCapturer::Callback* callback_; |
| 127 | 128 |
| 128 DISALLOW_COPY_AND_ASSIGN(ThreadCheckDesktopCapturer); | 129 DISALLOW_COPY_AND_ASSIGN(ThreadCheckDesktopCapturer); |
| 129 }; | 130 }; |
| 130 | 131 |
| 131 class VideoFramePumpTest : public testing::Test { | 132 class VideoFramePumpTest : public testing::Test { |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 // Start video frame capture. | 238 // Start video frame capture. |
| 238 pump_.reset(new VideoFramePump(encode_task_runner_, std::move(capturer), | 239 pump_.reset(new VideoFramePump(encode_task_runner_, std::move(capturer), |
| 239 std::move(encoder), &video_stub_)); | 240 std::move(encoder), &video_stub_)); |
| 240 | 241 |
| 241 // Run MessageLoop until the first frame is received. | 242 // Run MessageLoop until the first frame is received. |
| 242 run_loop.Run(); | 243 run_loop.Run(); |
| 243 } | 244 } |
| 244 | 245 |
| 245 } // namespace protocol | 246 } // namespace protocol |
| 246 } // namespace remoting | 247 } // namespace remoting |
| OLD | NEW |