summaryrefslogtreecommitdiffstats
path: root/remoting/codec
diff options
context:
space:
mode:
authorkxing@chromium.org <kxing@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-25 00:33:50 +0000
committerkxing@chromium.org <kxing@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-25 00:33:50 +0000
commit04499fbfa24e52ef1848ed52365db4df91a8f224 (patch)
tree41705185071827aa7f3c3b415b12498c74585a0f /remoting/codec
parentea0c34746e092caf728a74819c1d1cda1c9b7f8a (diff)
downloadchromium_src-04499fbfa24e52ef1848ed52365db4df91a8f224.zip
chromium_src-04499fbfa24e52ef1848ed52365db4df91a8f224.tar.gz
chromium_src-04499fbfa24e52ef1848ed52365db4df91a8f224.tar.bz2
Cleaned up codec_test.cc
BUG=92086 Review URL: https://chromiumcodereview.appspot.com/10871068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153361 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/codec')
-rw-r--r--remoting/codec/codec_test.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/remoting/codec/codec_test.cc b/remoting/codec/codec_test.cc
index 6f3a4ae..defcae8 100644
--- a/remoting/codec/codec_test.cc
+++ b/remoting/codec/codec_test.cc
@@ -319,12 +319,13 @@ class VideoEncoderTester {
scoped_refptr<CaptureData> PrepareEncodeData(const SkISize& size,
media::VideoFrame::Format format,
- uint8** memory) {
+ scoped_array<uint8>* memory) {
// TODO(hclam): Support also YUV format.
CHECK_EQ(format, media::VideoFrame::RGB32);
int memory_size = size.width() * size.height() * kBytesPerPixel;
- *memory = new uint8[memory_size];
+ memory->reset(new uint8[memory_size]);
+
srand(0);
for (int i = 0; i < memory_size; ++i) {
(*memory)[i] = rand() % 256;
@@ -333,7 +334,7 @@ scoped_refptr<CaptureData> PrepareEncodeData(const SkISize& size,
DataPlanes planes;
memset(planes.data, 0, sizeof(planes.data));
memset(planes.strides, 0, sizeof(planes.strides));
- planes.data[0] = *memory;
+ planes.data[0] = memory->get();
planes.strides[0] = size.width() * kBytesPerPixel;
scoped_refptr<CaptureData> data =
@@ -363,10 +364,9 @@ void TestVideoEncoder(VideoEncoder* encoder, bool strict) {
VideoEncoderTester tester(&message_tester);
- uint8* memory;
+ scoped_array<uint8> memory;
scoped_refptr<CaptureData> data =
PrepareEncodeData(kSize, media::VideoFrame::RGB32, &memory);
- scoped_array<uint8> memory_wrapper(memory);
std::vector<std::vector<SkIRect> > test_rect_lists = MakeTestRectLists(kSize);
for (size_t i = 0; i < test_rect_lists.size(); ++i) {
@@ -416,10 +416,9 @@ void TestVideoEncoderDecoder(
VideoEncoderTester encoder_tester(&message_tester);
- uint8* memory;
+ scoped_array<uint8> memory;
scoped_refptr<CaptureData> data =
PrepareEncodeData(kSize, media::VideoFrame::RGB32, &memory);
- scoped_array<uint8> memory_wrapper(memory);
VideoDecoderTester decoder_tester(decoder, kSize, kSize);
decoder_tester.set_strict(strict);