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/client/chromoting_view.h" | 5 #include "remoting/client/chromoting_view.h" |
6 | 6 |
7 #include "remoting/base/decoder_verbatim.h" | 7 #include "remoting/base/decoder_verbatim.h" |
8 #include "remoting/base/decoder_zlib.h" | 8 #include "remoting/base/decoder_zlib.h" |
9 | 9 |
10 namespace remoting { | 10 namespace remoting { |
11 | 11 |
12 ChromotingView::ChromotingView() | 12 ChromotingView::ChromotingView() |
13 : frame_width_(0), | 13 : frame_width_(0), |
14 frame_height_(0) { | 14 frame_height_(0) { |
15 } | 15 } |
16 | 16 |
| 17 |
| 18 // TODO(garykac): This assumes a single screen. This will need to be adjusted |
| 19 // to add support for mulitple monitors. |
| 20 void ChromotingView::GetScreenSize(int* width, int* height) { |
| 21 *width = frame_width_; |
| 22 *height = frame_height_; |
| 23 } |
| 24 |
17 bool ChromotingView::SetupDecoder(UpdateStreamEncoding encoding) { | 25 bool ChromotingView::SetupDecoder(UpdateStreamEncoding encoding) { |
18 if (encoding == EncodingInvalid) { | 26 if (encoding == EncodingInvalid) { |
19 LOG(ERROR) << "Cannot create encoder for EncodingInvalid"; | 27 LOG(ERROR) << "Cannot create encoder for EncodingInvalid"; |
20 return false; | 28 return false; |
21 } | 29 } |
22 | 30 |
23 // If we're in the middle of decoding a stream, then we need to make sure | 31 // If we're in the middle of decoding a stream, then we need to make sure |
24 // that that all packets in that stream match the encoding of the first | 32 // that that all packets in that stream match the encoding of the first |
25 // packet. | 33 // packet. |
26 // | 34 // |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 102 |
95 if (decoder_->IsStarted()) { | 103 if (decoder_->IsStarted()) { |
96 LOG(ERROR) << "Unable to properly end decoding.\n"; | 104 LOG(ERROR) << "Unable to properly end decoding.\n"; |
97 return false; | 105 return false; |
98 } | 106 } |
99 | 107 |
100 return true; | 108 return true; |
101 } | 109 } |
102 | 110 |
103 } // namespace remoting | 111 } // namespace remoting |
OLD | NEW |