| 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 encoded_frame_._completeFrame = true; | 259 encoded_frame_._completeFrame = true; |
| 260 EXPECT_EQ(WEBRTC_VIDEO_CODEC_ERROR, | 260 EXPECT_EQ(WEBRTC_VIDEO_CODEC_ERROR, |
| 261 decoder_->Decode(encoded_frame_, false, NULL)); | 261 decoder_->Decode(encoded_frame_, false, NULL)); |
| 262 // Now setting a key frame. | 262 // Now setting a key frame. |
| 263 encoded_frame_._frameType = kVideoFrameKey; | 263 encoded_frame_._frameType = kVideoFrameKey; |
| 264 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, | 264 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, |
| 265 decoder_->Decode(encoded_frame_, false, NULL)); | 265 decoder_->Decode(encoded_frame_, false, NULL)); |
| 266 EXPECT_GT(I420PSNR(&input_frame_, &decoded_frame_), 36); | 266 EXPECT_GT(I420PSNR(&input_frame_, &decoded_frame_), 36); |
| 267 } | 267 } |
| 268 | 268 |
| 269 TEST_F(TestVp8Impl, TestReset) { | |
| 270 SetUpEncodeDecode(); | |
| 271 EXPECT_EQ(0, encoder_->Encode(input_frame_, NULL, NULL)); | |
| 272 EXPECT_EQ(0, decoder_->Decode(encoded_frame_, false, NULL)); | |
| 273 size_t length = CalcBufferSize(kI420, kWidth, kHeight); | |
| 274 rtc::scoped_ptr<uint8_t[]> first_frame_buffer(new uint8_t[length]); | |
| 275 ExtractBuffer(decoded_frame_, length, first_frame_buffer.get()); | |
| 276 | |
| 277 EXPECT_EQ(0, decoder_->Reset()); | |
| 278 | |
| 279 EXPECT_EQ(0, decoder_->Decode(encoded_frame_, false, NULL)); | |
| 280 rtc::scoped_ptr<uint8_t[]> second_frame_buffer(new uint8_t[length]); | |
| 281 ExtractBuffer(decoded_frame_, length, second_frame_buffer.get()); | |
| 282 | |
| 283 EXPECT_EQ( | |
| 284 0, memcmp(second_frame_buffer.get(), first_frame_buffer.get(), length)); | |
| 285 } | |
| 286 | |
| 287 } // namespace webrtc | 269 } // namespace webrtc |
| OLD | NEW |