| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stdint.h> | 5 #include <stdint.h> |
| 6 #include <string.h> | 6 #include <string.h> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 webrtc::kVideoCodecI420, mock_gpu_factories_.get())); | 173 webrtc::kVideoCodecI420, mock_gpu_factories_.get())); |
| 174 EXPECT_EQ(NULL, null_rtc_decoder.get()); | 174 EXPECT_EQ(NULL, null_rtc_decoder.get()); |
| 175 } | 175 } |
| 176 | 176 |
| 177 TEST_P(RTCVideoDecoderTest, CreateAndInitSucceeds) { | 177 TEST_P(RTCVideoDecoderTest, CreateAndInitSucceeds) { |
| 178 const webrtc::VideoCodecType codec_type = GetParam(); | 178 const webrtc::VideoCodecType codec_type = GetParam(); |
| 179 CreateDecoder(codec_type); | 179 CreateDecoder(codec_type); |
| 180 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, rtc_decoder_->InitDecode(&codec_, 1)); | 180 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, rtc_decoder_->InitDecode(&codec_, 1)); |
| 181 } | 181 } |
| 182 | 182 |
| 183 TEST_F(RTCVideoDecoderTest, InitDecodeReturnsErrorOnFeedbackMode) { | |
| 184 CreateDecoder(webrtc::kVideoCodecVP8); | |
| 185 codec_.VP8()->feedbackModeOn = true; | |
| 186 EXPECT_EQ(WEBRTC_VIDEO_CODEC_ERROR, rtc_decoder_->InitDecode(&codec_, 1)); | |
| 187 } | |
| 188 | |
| 189 TEST_F(RTCVideoDecoderTest, DecodeReturnsErrorWithoutInitDecode) { | 183 TEST_F(RTCVideoDecoderTest, DecodeReturnsErrorWithoutInitDecode) { |
| 190 CreateDecoder(webrtc::kVideoCodecVP8); | 184 CreateDecoder(webrtc::kVideoCodecVP8); |
| 191 webrtc::EncodedImage input_image; | 185 webrtc::EncodedImage input_image; |
| 192 EXPECT_EQ(WEBRTC_VIDEO_CODEC_UNINITIALIZED, | 186 EXPECT_EQ(WEBRTC_VIDEO_CODEC_UNINITIALIZED, |
| 193 rtc_decoder_->Decode(input_image, false, nullptr, nullptr, 0)); | 187 rtc_decoder_->Decode(input_image, false, nullptr, nullptr, 0)); |
| 194 } | 188 } |
| 195 | 189 |
| 196 TEST_F(RTCVideoDecoderTest, DecodeReturnsErrorOnIncompleteFrame) { | 190 TEST_F(RTCVideoDecoderTest, DecodeReturnsErrorOnIncompleteFrame) { |
| 197 CreateDecoder(webrtc::kVideoCodecVP8); | 191 CreateDecoder(webrtc::kVideoCodecVP8); |
| 198 Initialize(); | 192 Initialize(); |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, | 334 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, |
| 341 rtc_decoder_->Decode(input_image, false, nullptr, nullptr, 0)); | 335 rtc_decoder_->Decode(input_image, false, nullptr, nullptr, 0)); |
| 342 } | 336 } |
| 343 | 337 |
| 344 INSTANTIATE_TEST_CASE_P(CodecProfiles, | 338 INSTANTIATE_TEST_CASE_P(CodecProfiles, |
| 345 RTCVideoDecoderTest, | 339 RTCVideoDecoderTest, |
| 346 Values(webrtc::kVideoCodecVP8, | 340 Values(webrtc::kVideoCodecVP8, |
| 347 webrtc::kVideoCodecH264)); | 341 webrtc::kVideoCodecH264)); |
| 348 | 342 |
| 349 } // content | 343 } // content |
| OLD | NEW |