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 #include <stdint.h> | 5 #include <stdint.h> |
6 #include <string.h> | 6 #include <string.h> |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 // This has to be included first. | 10 // This has to be included first. |
11 // See http://code.google.com/p/googletest/issues/detail?id=371 | 11 // See http://code.google.com/p/googletest/issues/detail?id=371 |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
14 #include "base/at_exit.h" | 14 #include "base/at_exit.h" |
15 #include "base/bind.h" | 15 #include "base/bind.h" |
16 #include "base/files/file_util.h" | 16 #include "base/files/file_util.h" |
17 #include "base/logging.h" | 17 #include "base/logging.h" |
18 #include "base/md5.h" | 18 #include "base/md5.h" |
19 #include "base/path_service.h" | 19 #include "base/path_service.h" |
20 #include "base/strings/string_piece.h" | 20 #include "base/strings/string_piece.h" |
21 #include "content/common/gpu/media/vaapi_jpeg_decoder.h" | |
22 #include "media/base/test_data_util.h" | 21 #include "media/base/test_data_util.h" |
23 #include "media/base/video_frame.h" | 22 #include "media/base/video_frame.h" |
24 #include "media/filters/jpeg_parser.h" | 23 #include "media/filters/jpeg_parser.h" |
| 24 #include "media/gpu/vaapi_jpeg_decoder.h" |
25 | 25 |
26 namespace content { | 26 namespace media { |
27 namespace { | 27 namespace { |
28 | 28 |
29 const char* kTestFilename = "pixel-1280x720.jpg"; | 29 const char* kTestFilename = "pixel-1280x720.jpg"; |
30 const char* kExpectedMd5Sum = "6e9e1716073c9a9a1282e3f0e0dab743"; | 30 const char* kExpectedMd5Sum = "6e9e1716073c9a9a1282e3f0e0dab743"; |
31 | 31 |
32 void LogOnError() { | 32 void LogOnError() { |
33 LOG(FATAL) << "Oh noes! Decoder failed"; | 33 LOG(FATAL) << "Oh noes! Decoder failed"; |
34 } | 34 } |
35 | 35 |
36 class VaapiJpegDecoderTest : public ::testing::Test { | 36 class VaapiJpegDecoderTest : public ::testing::Test { |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 124 |
125 std::vector<VASurfaceID> va_surfaces; | 125 std::vector<VASurfaceID> va_surfaces; |
126 ASSERT_TRUE( | 126 ASSERT_TRUE( |
127 wrapper_->CreateSurfaces(VA_RT_FORMAT_YUV420, size, 1, &va_surfaces)); | 127 wrapper_->CreateSurfaces(VA_RT_FORMAT_YUV420, size, 1, &va_surfaces)); |
128 | 128 |
129 EXPECT_FALSE( | 129 EXPECT_FALSE( |
130 VaapiJpegDecoder::Decode(wrapper_.get(), parse_result, va_surfaces[0])); | 130 VaapiJpegDecoder::Decode(wrapper_.get(), parse_result, va_surfaces[0])); |
131 } | 131 } |
132 | 132 |
133 } // namespace | 133 } // namespace |
134 } // namespace content | 134 } // namespace media |
135 | 135 |
136 int main(int argc, char** argv) { | 136 int main(int argc, char** argv) { |
137 testing::InitGoogleTest(&argc, argv); | 137 testing::InitGoogleTest(&argc, argv); |
138 base::AtExitManager exit_manager; | 138 base::AtExitManager exit_manager; |
139 content::VaapiWrapper::PreSandboxInitialization(); | 139 media::VaapiWrapper::PreSandboxInitialization(); |
140 return RUN_ALL_TESTS(); | 140 return RUN_ALL_TESTS(); |
141 } | 141 } |
OLD | NEW |