| 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 <utility> | 5 #include <utility> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 memset(frame->data(), 0, frame->stride() * frame->size().height()); | 77 memset(frame->data(), 0, frame->stride() * frame->size().height()); |
| 78 | 78 |
| 79 // Set updated_region only for the first frame, as the frame content | 79 // Set updated_region only for the first frame, as the frame content |
| 80 // doesn't change. | 80 // doesn't change. |
| 81 if (!first_frame_sent_) { | 81 if (!first_frame_sent_) { |
| 82 first_frame_sent_ = true; | 82 first_frame_sent_ = true; |
| 83 frame->mutable_updated_region()->SetRect( | 83 frame->mutable_updated_region()->SetRect( |
| 84 webrtc::DesktopRect::MakeSize(frame->size())); | 84 webrtc::DesktopRect::MakeSize(frame->size())); |
| 85 } | 85 } |
| 86 | 86 |
| 87 callback_->OnCaptureCompleted(frame.release()); | 87 callback_->OnCaptureResult(webrtc::DesktopCapturer::Result::SUCCESS, |
| 88 std::move(frame)); |
| 88 } | 89 } |
| 89 | 90 |
| 90 private: | 91 private: |
| 91 Callback* callback_ = nullptr; | 92 Callback* callback_ = nullptr; |
| 92 bool first_frame_sent_ = false; | 93 bool first_frame_sent_ = false; |
| 93 }; | 94 }; |
| 94 | 95 |
| 95 } // namespace | 96 } // namespace |
| 96 | 97 |
| 97 class ConnectionTest : public testing::Test, | 98 class ConnectionTest : public testing::Test, |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 | 338 |
| 338 std::unique_ptr<VideoStream> video_stream = | 339 std::unique_ptr<VideoStream> video_stream = |
| 339 host_connection_->StartVideoStream( | 340 host_connection_->StartVideoStream( |
| 340 base::WrapUnique(new TestScreenCapturer())); | 341 base::WrapUnique(new TestScreenCapturer())); |
| 341 | 342 |
| 342 WaitFirstVideoFrame(); | 343 WaitFirstVideoFrame(); |
| 343 } | 344 } |
| 344 | 345 |
| 345 } // namespace protocol | 346 } // namespace protocol |
| 346 } // namespace remoting | 347 } // namespace remoting |
| OLD | NEW |