OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 103 |
104 bool Vp8UnitTestDecodeCompleteCallback::DecodeComplete() { | 104 bool Vp8UnitTestDecodeCompleteCallback::DecodeComplete() { |
105 if (decode_complete) { | 105 if (decode_complete) { |
106 decode_complete = false; | 106 decode_complete = false; |
107 return true; | 107 return true; |
108 } | 108 } |
109 return false; | 109 return false; |
110 } | 110 } |
111 | 111 |
112 int Vp8UnitTestDecodeCompleteCallback::Decoded(VideoFrame& image) { | 112 int Vp8UnitTestDecodeCompleteCallback::Decoded(VideoFrame& image) { |
113 decoded_frame_->ShallowCopy(image); | 113 *decoded_frame_ = image; |
114 decode_complete = true; | 114 decode_complete = true; |
115 return 0; | 115 return 0; |
116 } | 116 } |
117 | 117 |
118 class TestVp8Impl : public ::testing::Test { | 118 class TestVp8Impl : public ::testing::Test { |
119 protected: | 119 protected: |
120 virtual void SetUp() { | 120 virtual void SetUp() { |
121 encoder_.reset(VP8Encoder::Create()); | 121 encoder_.reset(VP8Encoder::Create()); |
122 decoder_.reset(VP8Decoder::Create()); | 122 decoder_.reset(VP8Decoder::Create()); |
123 memset(&codec_inst_, 0, sizeof(codec_inst_)); | 123 memset(&codec_inst_, 0, sizeof(codec_inst_)); |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 EXPECT_EQ(WEBRTC_VIDEO_CODEC_ERROR, | 269 EXPECT_EQ(WEBRTC_VIDEO_CODEC_ERROR, |
270 decoder_->Decode(encoded_frame_, false, NULL)); | 270 decoder_->Decode(encoded_frame_, false, NULL)); |
271 // Now setting a key frame. | 271 // Now setting a key frame. |
272 encoded_frame_._frameType = kVideoFrameKey; | 272 encoded_frame_._frameType = kVideoFrameKey; |
273 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, | 273 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, |
274 decoder_->Decode(encoded_frame_, false, NULL)); | 274 decoder_->Decode(encoded_frame_, false, NULL)); |
275 EXPECT_GT(I420PSNR(input_frame_.get(), &decoded_frame_), 36); | 275 EXPECT_GT(I420PSNR(input_frame_.get(), &decoded_frame_), 36); |
276 } | 276 } |
277 | 277 |
278 } // namespace webrtc | 278 } // namespace webrtc |
OLD | NEW |