| 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 <deque> | 5 #include <deque> |
| 6 #include <stdlib.h> | 6 #include <stdlib.h> |
| 7 | 7 |
| 8 #include "gfx/rect.h" | 8 #include "gfx/rect.h" |
| 9 #include "media/base/video_frame.h" | 9 #include "media/base/video_frame.h" |
| 10 #include "remoting/base/codec_test.h" | 10 #include "remoting/base/codec_test.h" |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 bool decode_done() const { return decode_done_; } | 196 bool decode_done() const { return decode_done_; } |
| 197 void reset_decode_done() { decode_done_ = false; } | 197 void reset_decode_done() { decode_done_ = false; } |
| 198 | 198 |
| 199 private: | 199 private: |
| 200 void OnPartialDecodeDone() { | 200 void OnPartialDecodeDone() { |
| 201 if (!strict_) | 201 if (!strict_) |
| 202 return; | 202 return; |
| 203 | 203 |
| 204 // Test the content of the update rect. | 204 // Test the content of the update rect. |
| 205 for (size_t i = 0; i < update_rects_.size(); ++i) { | 205 for (size_t i = 0; i < update_rects_.size(); ++i) { |
| 206 LOG(INFO) << "Testing Rect " << i; | |
| 207 EXPECT_FALSE(rects_.empty()); | 206 EXPECT_FALSE(rects_.empty()); |
| 208 gfx::Rect rect = rects_.front(); | 207 gfx::Rect rect = rects_.front(); |
| 209 rects_.pop_front(); | 208 rects_.pop_front(); |
| 210 EXPECT_EQ(rect, update_rects_[i]); | 209 EXPECT_EQ(rect, update_rects_[i]); |
| 211 | 210 |
| 212 EXPECT_EQ(frame_->stride(0), capture_data_->data_planes().strides[0]); | 211 EXPECT_EQ(frame_->stride(0), capture_data_->data_planes().strides[0]); |
| 213 const int stride = frame_->stride(0); | 212 const int stride = frame_->stride(0); |
| 214 const int offset = stride * update_rects_[i].y() + | 213 const int offset = stride * update_rects_[i].y() + |
| 215 kBytesPerPixel * update_rects_[i].x(); | 214 kBytesPerPixel * update_rects_[i].x(); |
| 216 const uint8* original = capture_data_->data_planes().data[0] + offset; | 215 const uint8* original = capture_data_->data_planes().data[0] + offset; |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 TestEncodingRects(encoder, &encoder_tester, &decoder_tester, data, | 421 TestEncodingRects(encoder, &encoder_tester, &decoder_tester, data, |
| 423 kTestRects + 2, 1); | 422 kTestRects + 2, 1); |
| 424 TestEncodingRects(encoder, &encoder_tester, &decoder_tester, data, | 423 TestEncodingRects(encoder, &encoder_tester, &decoder_tester, data, |
| 425 kTestRects + 3, 2); | 424 kTestRects + 3, 2); |
| 426 delete [] memory; | 425 delete [] memory; |
| 427 } | 426 } |
| 428 | 427 |
| 429 } // namespace remoting | 428 } // namespace remoting |
| 430 | 429 |
| 431 DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::DecoderTester); | 430 DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::DecoderTester); |
| OLD | NEW |