Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: remoting/protocol/video_frame_pump_unittest.cc

Issue 2050353002: Update webrtc::DesktopCapturer clients to implement OnCaptureResult(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix chromeos Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « remoting/protocol/video_frame_pump.cc ('k') | remoting/protocol/webrtc_frame_scheduler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « remoting/protocol/video_frame_pump.cc ('k') | remoting/protocol/webrtc_frame_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698