| 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 <cstdlib> | 5 #include <cstdlib> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/synchronization/condition_variable.h" | 9 #include "base/synchronization/condition_variable.h" |
| 10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
| 11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
| 12 #include "media/cast/cast_config.h" | 12 #include "media/cast/cast_config.h" |
| 13 #include "media/cast/test/utility/default_config.h" | 13 #include "media/cast/receiver/video_decoder.h" |
| 14 #include "media/cast/test/utility/standalone_cast_environment.h" | 14 #include "media/cast/test/utility/standalone_cast_environment.h" |
| 15 #include "media/cast/test/utility/video_utility.h" | 15 #include "media/cast/test/utility/video_utility.h" |
| 16 #include "media/cast/video_receiver/video_decoder.h" | |
| 17 #include "media/cast/video_sender/codecs/vp8/vp8_encoder.h" | 16 #include "media/cast/video_sender/codecs/vp8/vp8_encoder.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 19 | 18 |
| 20 namespace media { | 19 namespace media { |
| 21 namespace cast { | 20 namespace cast { |
| 22 | 21 |
| 23 namespace { | 22 namespace { |
| 24 | 23 |
| 25 const int kWidth = 360; | 24 const int kWidth = 360; |
| 26 const int kHeight = 240; | 25 const int kHeight = 240; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 41 public: | 40 public: |
| 42 VideoDecoderTest() | 41 VideoDecoderTest() |
| 43 : cast_environment_(new StandaloneCastEnvironment()), | 42 : cast_environment_(new StandaloneCastEnvironment()), |
| 44 vp8_encoder_(GetVideoSenderConfigForTest(), 0), | 43 vp8_encoder_(GetVideoSenderConfigForTest(), 0), |
| 45 cond_(&lock_) { | 44 cond_(&lock_) { |
| 46 vp8_encoder_.Initialize(); | 45 vp8_encoder_.Initialize(); |
| 47 } | 46 } |
| 48 | 47 |
| 49 protected: | 48 protected: |
| 50 virtual void SetUp() OVERRIDE { | 49 virtual void SetUp() OVERRIDE { |
| 51 FrameReceiverConfig decoder_config = GetDefaultVideoReceiverConfig(); | 50 video_decoder_.reset(new VideoDecoder(cast_environment_, GetParam())); |
| 52 decoder_config.codec.video = GetParam(); | |
| 53 video_decoder_.reset(new VideoDecoder(cast_environment_, decoder_config)); | |
| 54 CHECK_EQ(STATUS_VIDEO_INITIALIZED, video_decoder_->InitializationResult()); | 51 CHECK_EQ(STATUS_VIDEO_INITIALIZED, video_decoder_->InitializationResult()); |
| 55 | 52 |
| 56 next_frame_timestamp_ = base::TimeDelta(); | 53 next_frame_timestamp_ = base::TimeDelta(); |
| 57 last_frame_id_ = 0; | 54 last_frame_id_ = 0; |
| 58 seen_a_decoded_frame_ = false; | 55 seen_a_decoded_frame_ = false; |
| 59 | 56 |
| 60 total_video_frames_feed_in_ = 0; | 57 total_video_frames_feed_in_ = 0; |
| 61 total_video_frames_decoded_ = 0; | 58 total_video_frames_decoded_ = 0; |
| 62 } | 59 } |
| 63 | 60 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 } | 174 } |
| 178 WaitForAllVideoToBeDecoded(); | 175 WaitForAllVideoToBeDecoded(); |
| 179 } | 176 } |
| 180 | 177 |
| 181 INSTANTIATE_TEST_CASE_P(VideoDecoderTestScenarios, | 178 INSTANTIATE_TEST_CASE_P(VideoDecoderTestScenarios, |
| 182 VideoDecoderTest, | 179 VideoDecoderTest, |
| 183 ::testing::Values(transport::kVp8)); | 180 ::testing::Values(transport::kVp8)); |
| 184 | 181 |
| 185 } // namespace cast | 182 } // namespace cast |
| 186 } // namespace media | 183 } // namespace media |
| OLD | NEW |