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

Unified Diff: remoting/client/decoder_verbatim.cc

Issue 2878009: Add flag to decoder class to flip the image vertically since that is required... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/client/decoder_verbatim.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/decoder_verbatim.cc
===================================================================
--- remoting/client/decoder_verbatim.cc (revision 51015)
+++ remoting/client/decoder_verbatim.cc (working copy)
@@ -9,7 +9,8 @@
namespace remoting {
DecoderVerbatim::DecoderVerbatim()
- : updated_rects_(NULL) {
+ : updated_rects_(NULL),
+ reverse_rows_(true) {
dmac 2010/06/28 20:41:51 how do we plan to set this per platform?
}
bool DecoderVerbatim::BeginDecode(scoped_refptr<media::VideoFrame> frame,
@@ -51,13 +52,20 @@
// Copy the data line by line.
const int src_stride = bytes_per_pixel * width;
const char* src = message->update_stream_packet().data().c_str();
+ int src_stride_dir = src_stride;
+ if (reverse_rows_) {
+ // Copy rows from bottom to top to flip the image vertically.
+ src += (height - 1) * src_stride;
+ // Change the direction of the stride to work bottom to top.
+ src_stride_dir *= -1;
+ }
const int dest_stride = frame_->stride(media::VideoFrame::kRGBPlane);
uint8* dest = frame_->data(media::VideoFrame::kRGBPlane) +
dest_stride * y + bytes_per_pixel * x;
for (int i = 0; i < height; ++i) {
memcpy(dest, src, src_stride);
dest += dest_stride;
- src += src_stride;
+ src += src_stride_dir;
}
updated_rects_->clear();
« no previous file with comments | « remoting/client/decoder_verbatim.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698