diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-22 18:16:53 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-22 18:16:53 +0000 |
commit | d3a4b09d49a617e667e79c387fbe3570c7fac950 (patch) | |
tree | b67e7d9e794de45f347f745020b8af370a523f6c /remoting/base | |
parent | 20a648064480d72460d3b6b0b211ea781cdd6c55 (diff) | |
download | chromium_src-d3a4b09d49a617e667e79c387fbe3570c7fac950.zip chromium_src-d3a4b09d49a617e667e79c387fbe3570c7fac950.tar.gz chromium_src-d3a4b09d49a617e667e79c387fbe3570c7fac950.tar.bz2 |
Change chromoting images to upright by default
Remove all the ugly code to have reverse rows. All images are upright now.
BUG=71872
TEST=Everything in chromoting still works and upright.
Review URL: http://codereview.chromium.org/6546057
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75609 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/base')
-rw-r--r-- | remoting/base/decoder_row_based.cc | 14 | ||||
-rw-r--r-- | remoting/base/decoder_row_based.h | 8 | ||||
-rw-r--r-- | remoting/base/decoder_vp8.cc | 12 | ||||
-rw-r--r-- | remoting/base/decoder_vp8.h | 3 | ||||
-rw-r--r-- | remoting/base/encode_decode_unittest.cc | 2 |
5 files changed, 2 insertions, 37 deletions
diff --git a/remoting/base/decoder_row_based.cc b/remoting/base/decoder_row_based.cc index 25e738f..f349272 100644 --- a/remoting/base/decoder_row_based.cc +++ b/remoting/base/decoder_row_based.cc @@ -32,11 +32,7 @@ DecoderRowBased::DecoderRowBased(Decompressor* decompressor, decompressor_(decompressor), encoding_(encoding), row_pos_(0), - row_y_(0), - // TODO(hclam): We should use the information from the update stream - // to determine whether we should reverse the rows or not. - // But for simplicity we set to be always true. - reverse_rows_(true) { + row_y_(0) { } DecoderRowBased::~DecoderRowBased() { @@ -92,14 +88,6 @@ Decoder::DecodeResult DecoderRowBased::DecodePacket(const VideoPacket* packet) { int stride = frame_->stride(media::VideoFrame::kRGBPlane); uint8* rect_begin = frame_->data(media::VideoFrame::kRGBPlane); - if (reverse_rows_) { - // Advance the pointer to the last row. - rect_begin += (frame_->height() - 1) * stride; - - // And then make the stride negative. - stride = -stride; - } - uint8* out = rect_begin + stride * (clip_.y() + row_y_) + kBytesPerPixel * clip_.x(); diff --git a/remoting/base/decoder_row_based.h b/remoting/base/decoder_row_based.h index 05c2e3c..2afd60e 100644 --- a/remoting/base/decoder_row_based.h +++ b/remoting/base/decoder_row_based.h @@ -26,11 +26,6 @@ class DecoderRowBased : public Decoder { virtual void Reset(); virtual VideoPacketFormat::Encoding Encoding(); - // TODO(hclam): Should make this into the Decoder interface. - // TODO(ajwong): Before putting into the interface, we should decide if the - // Host should normalize the coordinate system. - void set_reverse_rows(bool reverse) { reverse_rows_ = reverse; } - private: enum State { kUninitialized, @@ -68,9 +63,6 @@ class DecoderRowBased : public Decoder { // The current row in the rect that we are updaing. int row_y_; - // True if we should decode the image upside down. - bool reverse_rows_; - UpdatedRects updated_rects_; DISALLOW_COPY_AND_ASSIGN(DecoderRowBased); diff --git a/remoting/base/decoder_vp8.cc b/remoting/base/decoder_vp8.cc index d7744a8..785382a 100644 --- a/remoting/base/decoder_vp8.cc +++ b/remoting/base/decoder_vp8.cc @@ -18,8 +18,7 @@ extern "C" { namespace remoting { DecoderVp8::DecoderVp8() - : reverse_rows_(true), - state_(kUninitialized), + : state_(kUninitialized), codec_(NULL) { } @@ -84,10 +83,6 @@ Decoder::DecodeResult DecoderVp8::DecodePacket(const VideoPacket* packet) { // Perform YUV conversion. uint8* data_start = frame_->data(media::VideoFrame::kRGBPlane); int stride = frame_->stride(media::VideoFrame::kRGBPlane); - if (reverse_rows_) { - data_start = data_start + (frame_->height() - 1) * stride; - stride = -stride; - } // Propogate updated rects. updated_rects_.clear(); @@ -109,11 +104,6 @@ Decoder::DecodeResult DecoderVp8::DecodePacket(const VideoPacket* packet) { image->stride[0], image->stride[1], stride); - - // Since the image generated by client is upside-down we need to report - // updated rects as upside-down. - if (reverse_rows_) - r.set_y(image->d_h - r.bottom()); updated_rects_.push_back(r); } return DECODE_DONE; diff --git a/remoting/base/decoder_vp8.h b/remoting/base/decoder_vp8.h index 6e15a0b..08f60e2 100644 --- a/remoting/base/decoder_vp8.h +++ b/remoting/base/decoder_vp8.h @@ -31,9 +31,6 @@ class DecoderVp8 : public Decoder { kError, }; - // True if we should decode the image upside down. - bool reverse_rows_; - // The internal state of the decoder. State state_; diff --git a/remoting/base/encode_decode_unittest.cc b/remoting/base/encode_decode_unittest.cc index d1d409d..10baf7c 100644 --- a/remoting/base/encode_decode_unittest.cc +++ b/remoting/base/encode_decode_unittest.cc @@ -13,14 +13,12 @@ namespace remoting { TEST(EncodeDecodeTest, EncodeAndDecodeZlib) { scoped_ptr<EncoderRowBased> encoder(EncoderRowBased::CreateZlibEncoder()); scoped_ptr<DecoderRowBased> decoder(DecoderRowBased::CreateZlibDecoder()); - decoder->set_reverse_rows(false); TestEncoderDecoder(encoder.get(), decoder.get(), true); } TEST(EncodeDecodeTest, EncodeAndDecodeSmallOutputBufferZlib) { scoped_ptr<EncoderRowBased> encoder(EncoderRowBased::CreateZlibEncoder(64)); scoped_ptr<DecoderRowBased> decoder(DecoderRowBased::CreateZlibDecoder()); - decoder->set_reverse_rows(false); TestEncoderDecoder(encoder.get(), decoder.get(), true); } |