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

Unified Diff: remoting/base/encoder_verbatim.cc

Issue 3011010: Unit test for Encoder / Decoder for remoting (Closed)
Patch Set: fixed comments Created 10 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/base/decoder_verbatim_unittest.cc ('k') | remoting/base/encoder_verbatim_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/base/encoder_verbatim.cc
diff --git a/remoting/base/encoder_verbatim.cc b/remoting/base/encoder_verbatim.cc
index f6cc2cac6387c96b77c1466fac545ab554fedae8..509daf946dda8a5f6baf5138d0e77a162bb342aa 100644
--- a/remoting/base/encoder_verbatim.cc
+++ b/remoting/base/encoder_verbatim.cc
@@ -71,14 +71,18 @@ bool EncoderVerbatim::EncodeRect(
&((*packet->mutable_rect_data()->mutable_data())[0]));
for (int i = 0; i < DataPlanes::kPlaneCount; ++i) {
- const uint8* in = capture_data->data_planes().data[i];
// Skip over planes that don't have data.
- if (!in) continue;
+ if (!capture_data->data_planes().data[i])
+ continue;
+
+ const uint8* in = capture_data->data_planes().data[i] +
+ y * capture_data->data_planes().strides[i] +
+ x * bytes_per_pixel;
// TODO(hclam): Handle YUV since the height would be different.
for (int j = 0; j < height; ++j) {
DCHECK_LE(row_size, capture_data->data_planes().strides[i]);
- memcpy(out, in, row_size);
+ memcpy(out, in, width * bytes_per_pixel);
in += capture_data->data_planes().strides[i];
out += row_size;
}
« no previous file with comments | « remoting/base/decoder_verbatim_unittest.cc ('k') | remoting/base/encoder_verbatim_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698