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/encoder_verbatim.h" | 5 #include "remoting/host/encoder_verbatim.h" |
6 | 6 |
7 #include "gfx/rect.h" | 7 #include "gfx/rect.h" |
8 #include "media/base/data_buffer.h" | 8 #include "media/base/data_buffer.h" |
9 #include "remoting/base/protocol_util.h" | 9 #include "remoting/base/protocol_util.h" |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 gfx::Rect dirty_rect = dirty_rects[i]; | 23 gfx::Rect dirty_rect = dirty_rects[i]; |
24 scoped_ptr<UpdateStreamPacketHeader> header(new UpdateStreamPacketHeader); | 24 scoped_ptr<UpdateStreamPacketHeader> header(new UpdateStreamPacketHeader); |
25 if (EncodeRect(dirty_rect, | 25 if (EncodeRect(dirty_rect, |
26 input_data, | 26 input_data, |
27 strides, | 27 strides, |
28 header.get(), | 28 header.get(), |
29 &data)) { | 29 &data)) { |
30 EncodingState state = EncodingInProgress; | 30 EncodingState state = EncodingInProgress; |
31 if (i == 0) { | 31 if (i == 0) { |
32 state |= EncodingStarting; | 32 state |= EncodingStarting; |
33 } else if (i == num_rects - 1) { | 33 } |
| 34 if (i == num_rects - 1) { |
34 state |= EncodingEnded; | 35 state |= EncodingEnded; |
35 } | 36 } |
36 data_available_callback->Run(header.release(), | 37 data_available_callback->Run(header.release(), |
37 data, | 38 data, |
38 state); | 39 state); |
39 } | 40 } |
40 } | 41 } |
41 | 42 |
42 delete data_available_callback; | 43 delete data_available_callback; |
43 } | 44 } |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 DCHECK_LE(row_size, strides[i]); | 89 DCHECK_LE(row_size, strides[i]); |
89 memcpy(out, in, row_size); | 90 memcpy(out, in, row_size); |
90 in += strides[i]; | 91 in += strides[i]; |
91 out += row_size; | 92 out += row_size; |
92 } | 93 } |
93 } | 94 } |
94 return true; | 95 return true; |
95 } | 96 } |
96 | 97 |
97 } // namespace remoting | 98 } // namespace remoting |
OLD | NEW |