| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 // This has to be included first. | 5 // This has to be included first. |
| 6 // See http://code.google.com/p/googletest/issues/detail?id=371 | 6 // See http://code.google.com/p/googletest/issues/detail?id=371 |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 8 |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "base/strings/string_split.h" | 22 #include "base/strings/string_split.h" |
| 23 #include "base/thread_task_runner_handle.h" | 23 #include "base/thread_task_runner_handle.h" |
| 24 #include "build/build_config.h" | 24 #include "build/build_config.h" |
| 25 #include "content/common/gpu/media/video_accelerator_unittest_helpers.h" | 25 #include "content/common/gpu/media/video_accelerator_unittest_helpers.h" |
| 26 #include "media/base/test_data_util.h" | 26 #include "media/base/test_data_util.h" |
| 27 #include "media/filters/jpeg_parser.h" | 27 #include "media/filters/jpeg_parser.h" |
| 28 #include "media/video/jpeg_decode_accelerator.h" | 28 #include "media/video/jpeg_decode_accelerator.h" |
| 29 #include "third_party/libyuv/include/libyuv.h" | 29 #include "third_party/libyuv/include/libyuv.h" |
| 30 #include "ui/gfx/codec/jpeg_codec.h" | 30 #include "ui/gfx/codec/jpeg_codec.h" |
| 31 | 31 |
| 32 #if defined(OS_CHROMEOS) | 32 #if defined(OS_CHROMEOS) || defined(OS_LINUX) |
| 33 #if defined(USE_V4L2_CODEC) | 33 #if defined(USE_V4L2_CODEC) |
| 34 #include "content/common/gpu/media/v4l2_device.h" | 34 #include "content/common/gpu/media/v4l2_device.h" |
| 35 #include "content/common/gpu/media/v4l2_jpeg_decode_accelerator.h" | 35 #include "content/common/gpu/media/v4l2_jpeg_decode_accelerator.h" |
| 36 #endif | 36 #endif |
| 37 #if defined(ARCH_CPU_X86_FAMILY) | 37 #if defined(ARCH_CPU_X86_FAMILY) |
| 38 #include "content/common/gpu/media/vaapi_jpeg_decode_accelerator.h" | 38 #include "content/common/gpu/media/vaapi_jpeg_decode_accelerator.h" |
| 39 #include "content/common/gpu/media/vaapi_wrapper.h" | 39 #include "content/common/gpu/media/vaapi_wrapper.h" |
| 40 #endif | 40 #endif |
| 41 #endif | 41 #endif |
| 42 | 42 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 128 |
| 129 JpegClient::JpegClient(const std::vector<TestImageFile*>& test_image_files, | 129 JpegClient::JpegClient(const std::vector<TestImageFile*>& test_image_files, |
| 130 ClientStateNotification<ClientState>* note) | 130 ClientStateNotification<ClientState>* note) |
| 131 : test_image_files_(test_image_files), state_(CS_CREATED), note_(note) { | 131 : test_image_files_(test_image_files), state_(CS_CREATED), note_(note) { |
| 132 } | 132 } |
| 133 | 133 |
| 134 JpegClient::~JpegClient() { | 134 JpegClient::~JpegClient() { |
| 135 } | 135 } |
| 136 | 136 |
| 137 void JpegClient::CreateJpegDecoder() { | 137 void JpegClient::CreateJpegDecoder() { |
| 138 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) | 138 #if (defined(OS_CHROMEOS) || defined(OS_LINUX))&& defined(ARCH_CPU_X86_FAMILY) |
| 139 decoder_.reset( | 139 decoder_.reset( |
| 140 new VaapiJpegDecodeAccelerator(base::ThreadTaskRunnerHandle::Get())); | 140 new VaapiJpegDecodeAccelerator(base::ThreadTaskRunnerHandle::Get())); |
| 141 #elif defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC) | 141 #elif defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC) |
| 142 scoped_refptr<V4L2Device> device = | 142 scoped_refptr<V4L2Device> device = |
| 143 V4L2Device::Create(V4L2Device::kJpegDecoder); | 143 V4L2Device::Create(V4L2Device::kJpegDecoder); |
| 144 if (!device.get()) { | 144 if (!device.get()) { |
| 145 LOG(ERROR) << "V4L2Device::Create failed"; | 145 LOG(ERROR) << "V4L2Device::Create failed"; |
| 146 SetState(CS_ERROR); | 146 SetState(CS_ERROR); |
| 147 return; | 147 return; |
| 148 } | 148 } |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 #endif | 579 #endif |
| 580 | 580 |
| 581 content::g_env = | 581 content::g_env = |
| 582 reinterpret_cast<content::JpegDecodeAcceleratorTestEnvironment*>( | 582 reinterpret_cast<content::JpegDecodeAcceleratorTestEnvironment*>( |
| 583 testing::AddGlobalTestEnvironment( | 583 testing::AddGlobalTestEnvironment( |
| 584 new content::JpegDecodeAcceleratorTestEnvironment( | 584 new content::JpegDecodeAcceleratorTestEnvironment( |
| 585 jpeg_filenames))); | 585 jpeg_filenames))); |
| 586 | 586 |
| 587 return RUN_ALL_TESTS(); | 587 return RUN_ALL_TESTS(); |
| 588 } | 588 } |
| OLD | NEW |