Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1107)

Side by Side Diff: content/common/gpu/media/vaapi_jpeg_decoder_unittest.cc

Issue 1209033018: Create VA surface with correct VA RT format for MJPEG decode acceleration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <string> 5 #include <string>
6 6
7 // This has to be included first. 7 // This has to be included first.
8 // See http://code.google.com/p/googletest/issues/detail?id=371 8 // See http://code.google.com/p/googletest/issues/detail?id=371
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 std::string jpeg_data_; 56 std::string jpeg_data_;
57 }; 57 };
58 58
59 bool VaapiJpegDecoderTest::VerifyDecode( 59 bool VaapiJpegDecoderTest::VerifyDecode(
60 const media::JpegParseResult& parse_result, 60 const media::JpegParseResult& parse_result,
61 const std::string& expected_md5sum) { 61 const std::string& expected_md5sum) {
62 gfx::Size size(parse_result.frame_header.coded_width, 62 gfx::Size size(parse_result.frame_header.coded_width,
63 parse_result.frame_header.coded_height); 63 parse_result.frame_header.coded_height);
64 64
65 std::vector<VASurfaceID> va_surfaces; 65 std::vector<VASurfaceID> va_surfaces;
66 if (!wrapper_->CreateSurfaces(size, 1, &va_surfaces)) 66 if (!wrapper_->CreateSurfaces(VA_RT_FORMAT_YUV420, size, 1, &va_surfaces))
67 return false; 67 return false;
68 68
69 if (!VaapiJpegDecoder::Decode(wrapper_.get(), parse_result, va_surfaces[0])) { 69 if (!VaapiJpegDecoder::Decode(wrapper_.get(), parse_result, va_surfaces[0])) {
70 LOG(ERROR) << "Decode failed"; 70 LOG(ERROR) << "Decode failed";
71 return false; 71 return false;
72 } 72 }
73 73
74 VAImage image; 74 VAImage image;
75 VAImageFormat format; 75 VAImageFormat format;
76 const uint32_t kI420Fourcc = VA_FOURCC('I', '4', '2', '0'); 76 const uint32_t kI420Fourcc = VA_FOURCC('I', '4', '2', '0');
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 128
129 } // namespace 129 } // namespace
130 } // namespace content 130 } // namespace content
131 131
132 int main(int argc, char** argv) { 132 int main(int argc, char** argv) {
133 testing::InitGoogleTest(&argc, argv); 133 testing::InitGoogleTest(&argc, argv);
134 base::AtExitManager exit_manager; 134 base::AtExitManager exit_manager;
135 content::VaapiWrapper::PreSandboxInitialization(); 135 content::VaapiWrapper::PreSandboxInitialization();
136 return RUN_ALL_TESTS(); 136 return RUN_ALL_TESTS();
137 } 137 }
OLDNEW
« no previous file with comments | « content/common/gpu/media/vaapi_jpeg_decode_accelerator.cc ('k') | content/common/gpu/media/vaapi_video_decode_accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698