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

Unified Diff: remoting/base/codec_test.cc

Issue 9331003: Improving the decoder pipeline. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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 | « no previous file | remoting/base/compressor_verbatim.cc » ('j') | remoting/base/compressor_verbatim.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/base/codec_test.cc
diff --git a/remoting/base/codec_test.cc b/remoting/base/codec_test.cc
index 81f0db82a3b2354b6b005724fc02f337bb31643c..32fa7db11027d9d77c5f79e831c149694505e48b 100644
--- a/remoting/base/codec_test.cc
+++ b/remoting/base/codec_test.cc
@@ -9,6 +9,7 @@
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "media/base/video_frame.h"
+#include "ppapi/cpp/image_data.h"
Wez 2012/02/07 01:56:31 Is this needed?
alexeypa (please no reviews) 2012/02/15 23:06:22 No. Removed.
#include "remoting/base/base_mock_objects.h"
#include "remoting/base/codec_test.h"
#include "remoting/base/decoder.h"
@@ -123,12 +124,9 @@ class DecoderTester {
DecoderTester(Decoder* decoder)
: strict_(false),
decoder_(decoder) {
- frame_ = media::VideoFrame::CreateFrame(media::VideoFrame::RGB32,
- kWidth, kHeight,
- base::TimeDelta(),
- base::TimeDelta());
- EXPECT_TRUE(frame_.get());
- decoder_->Initialize(frame_);
+ image_data_.reset(new uint8[kWidth * kHeight * kBytesPerPixel]);
+ EXPECT_TRUE(image_data_.get());
+ decoder_->Initialize(SkISize::Make(kWidth, kHeight));
}
void Reset() {
@@ -142,7 +140,11 @@ class DecoderTester {
ASSERT_NE(Decoder::DECODE_ERROR, result);
if (result == Decoder::DECODE_DONE) {
- decoder_->GetUpdatedRegion(&update_region_);
+ decoder_->Draw(SkISize::Make(kWidth, kHeight),
+ SkIRect::MakeXYWH(0, 0, kWidth, kHeight),
+ image_data_.get(),
+ kWidth * kBytesPerPixel,
+ &update_region_);
}
}
@@ -169,12 +171,12 @@ class DecoderTester {
// Test the content of the update region.
EXPECT_EQ(expected_region_, update_region_);
for (SkRegion::Iterator i(update_region_); !i.done(); i.next()) {
- EXPECT_EQ(frame_->stride(0), capture_data_->data_planes().strides[0]);
- const int stride = frame_->stride(0);
+ const int stride = kWidth * kBytesPerPixel;
+ EXPECT_EQ(stride, capture_data_->data_planes().strides[0]);
const int offset = stride * i.rect().top() +
kBytesPerPixel * i.rect().left();
const uint8* original = capture_data_->data_planes().data[0] + offset;
- const uint8* decoded = frame_->data(0) + offset;
+ const uint8* decoded = image_data_.get() + offset;
const int row_size = kBytesPerPixel * i.rect().width();
for (int y = 0; y < i.rect().height(); ++y) {
EXPECT_EQ(0, memcmp(original, decoded, row_size))
@@ -190,7 +192,7 @@ class DecoderTester {
SkRegion expected_region_;
SkRegion update_region_;
Decoder* decoder_;
- scoped_refptr<media::VideoFrame> frame_;
+ scoped_array<uint8> image_data_;
scoped_refptr<CaptureData> capture_data_;
DISALLOW_COPY_AND_ASSIGN(DecoderTester);
« no previous file with comments | « no previous file | remoting/base/compressor_verbatim.cc » ('j') | remoting/base/compressor_verbatim.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698