OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/host/capturer.h" | 5 #include "remoting/host/capturer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "remoting/base/tracer.h" | 9 #include "remoting/base/tracer.h" |
10 | 10 |
11 namespace remoting { | 11 namespace remoting { |
12 | 12 |
13 Capturer::Capturer() | 13 Capturer::Capturer(MessageLoop* message_loop) |
14 : width_(0), | 14 : width_(0), |
15 height_(0), | 15 height_(0), |
16 pixel_format_(media::VideoFrame::INVALID), | 16 pixel_format_(media::VideoFrame::INVALID), |
17 bytes_per_row_(0), | 17 bytes_per_row_(0), |
18 current_buffer_(0) { | 18 current_buffer_(0), |
| 19 message_loop_(message_loop) { |
19 } | 20 } |
20 | 21 |
21 Capturer::~Capturer() { | 22 Capturer::~Capturer() { |
22 } | 23 } |
23 | 24 |
24 // Return the width of the screen. | 25 // Return the width of the screen. |
25 int Capturer::width() const { | 26 int Capturer::width() const { |
26 return width_; | 27 return width_; |
27 } | 28 } |
28 | 29 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 void Capturer::FinishCapture(scoped_refptr<CaptureData> data, | 79 void Capturer::FinishCapture(scoped_refptr<CaptureData> data, |
79 CaptureCompletedCallback* callback) { | 80 CaptureCompletedCallback* callback) { |
80 // Select the next buffer to be the current buffer. | 81 // Select the next buffer to be the current buffer. |
81 current_buffer_ = (current_buffer_ + 1) % kNumBuffers; | 82 current_buffer_ = (current_buffer_ + 1) % kNumBuffers; |
82 | 83 |
83 callback->Run(data); | 84 callback->Run(data); |
84 delete callback; | 85 delete callback; |
85 } | 86 } |
86 | 87 |
87 } // namespace remoting | 88 } // namespace remoting |
OLD | NEW |