| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "base/test/simple_test_tick_clock.h" | 7 #include "base/test/simple_test_tick_clock.h" |
| 8 #include "base/time/tick_clock.h" | 8 #include "base/time/tick_clock.h" |
| 9 #include "media/cast/cast_config.h" | 9 #include "media/cast/cast_config.h" |
| 10 #include "media/cast/cast_defines.h" | 10 #include "media/cast/cast_defines.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // Random frame size for testing. | 22 // Random frame size for testing. |
| 23 const int kFrameSize = 2345; | 23 const int kFrameSize = 2345; |
| 24 static const int64 kStartMillisecond = GG_INT64_C(1245); | 24 static const int64 kStartMillisecond = GG_INT64_C(1245); |
| 25 | 25 |
| 26 namespace { | 26 namespace { |
| 27 class DecodeTestFrameCallback : | 27 class DecodeTestFrameCallback : |
| 28 public base::RefCountedThreadSafe<DecodeTestFrameCallback> { | 28 public base::RefCountedThreadSafe<DecodeTestFrameCallback> { |
| 29 public: | 29 public: |
| 30 DecodeTestFrameCallback() {} | 30 DecodeTestFrameCallback() {} |
| 31 | 31 |
| 32 void DecodeComplete(scoped_ptr<I420VideoFrame> decoded_frame, | 32 void DecodeComplete(const scoped_refptr<media::VideoFrame>& decoded_frame, |
| 33 const base::TimeTicks& render_time) {} | 33 const base::TimeTicks& render_time) {} |
| 34 protected: | 34 protected: |
| 35 virtual ~DecodeTestFrameCallback() {} | 35 virtual ~DecodeTestFrameCallback() {} |
| 36 private: | 36 private: |
| 37 friend class base::RefCountedThreadSafe<DecodeTestFrameCallback>; | 37 friend class base::RefCountedThreadSafe<DecodeTestFrameCallback>; |
| 38 }; | 38 }; |
| 39 } // namespace | 39 } // namespace |
| 40 | 40 |
| 41 class VideoDecoderTest : public ::testing::Test { | 41 class VideoDecoderTest : public ::testing::Test { |
| 42 protected: | 42 protected: |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 EXPECT_DEATH( | 85 EXPECT_DEATH( |
| 86 decoder_->DecodeVideoFrame(&encoded_frame, render_time, base::Bind( | 86 decoder_->DecodeVideoFrame(&encoded_frame, render_time, base::Bind( |
| 87 &DecodeTestFrameCallback::DecodeComplete, test_callback_)), | 87 &DecodeTestFrameCallback::DecodeComplete, test_callback_)), |
| 88 "Invalid codec"); | 88 "Invalid codec"); |
| 89 } | 89 } |
| 90 | 90 |
| 91 // TODO(pwestin): Test decoding a real frame. | 91 // TODO(pwestin): Test decoding a real frame. |
| 92 | 92 |
| 93 } // namespace cast | 93 } // namespace cast |
| 94 } // namespace media | 94 } // namespace media |
| OLD | NEW |