| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "content/common/gpu/media/android_video_decode_accelerator.h" | 5 #include "content/common/gpu/media/android_video_decode_accelerator.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
| 12 #include "content/common/gpu/media/android_copying_backing_strategy.h" | 12 #include "content/common/gpu/media/android_copying_backing_strategy.h" |
| 13 #include "content/common/gpu/media/android_video_decode_accelerator.h" | 13 #include "content/common/gpu/media/android_video_decode_accelerator.h" |
| 14 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" | 14 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" |
| 15 #include "media/base/android/media_codec_bridge.h" | 15 #include "media/base/android/media_codec_util.h" |
| 16 #include "media/base/android/media_jni_registrar.h" | 16 #include "media/base/android/media_jni_registrar.h" |
| 17 #include "media/video/picture.h" | 17 #include "media/video/picture.h" |
| 18 #include "media/video/video_decode_accelerator.h" | 18 #include "media/video/video_decode_accelerator.h" |
| 19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 20 #include "ui/gl/android/surface_texture.h" | 20 #include "ui/gl/android/surface_texture.h" |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 bool MockMakeContextCurrent() { | 24 bool MockMakeContextCurrent() { |
| 25 return true; | 25 return true; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 private: | 84 private: |
| 85 scoped_ptr<media::VideoDecodeAccelerator> accelerator_; | 85 scoped_ptr<media::VideoDecodeAccelerator> accelerator_; |
| 86 scoped_ptr<base::MessageLoop> message_loop_; | 86 scoped_ptr<base::MessageLoop> message_loop_; |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 TEST_F(AndroidVideoDecodeAcceleratorTest, ConfigureUnsupportedCodec) { | 89 TEST_F(AndroidVideoDecodeAcceleratorTest, ConfigureUnsupportedCodec) { |
| 90 EXPECT_FALSE(Configure(media::kUnknownVideoCodec)); | 90 EXPECT_FALSE(Configure(media::kUnknownVideoCodec)); |
| 91 } | 91 } |
| 92 | 92 |
| 93 TEST_F(AndroidVideoDecodeAcceleratorTest, ConfigureSupportedCodec) { | 93 TEST_F(AndroidVideoDecodeAcceleratorTest, ConfigureSupportedCodec) { |
| 94 if (!media::MediaCodecBridge::IsAvailable()) | 94 if (!media::MediaCodecUtil::IsMediaCodecAvailable()) |
| 95 return; | 95 return; |
| 96 EXPECT_TRUE(Configure(media::kCodecVP8)); | 96 EXPECT_TRUE(Configure(media::kCodecVP8)); |
| 97 } | 97 } |
| 98 | 98 |
| 99 } // namespace content | 99 } // namespace content |
| 100 | 100 |
| 101 int main(int argc, char **argv) { | 101 int main(int argc, char **argv) { |
| 102 testing::InitGoogleTest(&argc, argv); | 102 testing::InitGoogleTest(&argc, argv); |
| 103 return RUN_ALL_TESTS(); | 103 return RUN_ALL_TESTS(); |
| 104 } | 104 } |
| OLD | NEW |