OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 XCloseDisplay(x_display_); | 111 XCloseDisplay(x_display_); |
112 } | 112 } |
113 } | 113 } |
114 | 114 |
115 void LogOnError(VaapiH264Decoder::VAVDAH264DecoderFailure error) { | 115 void LogOnError(VaapiH264Decoder::VAVDAH264DecoderFailure error) { |
116 LOG(FATAL) << "Oh noes! Decoder failed: " << error; | 116 LOG(FATAL) << "Oh noes! Decoder failed: " << error; |
117 } | 117 } |
118 | 118 |
119 bool VaapiH264DecoderLoop::Initialize(base::FilePath input_file, | 119 bool VaapiH264DecoderLoop::Initialize(base::FilePath input_file, |
120 base::FilePath output_file) { | 120 base::FilePath output_file) { |
121 x_display_ = XOpenDisplay(NULL); | 121 x_display_ = gfx::OpenNewXDisplay(); |
122 if (!x_display_) { | 122 if (!x_display_) { |
123 LOG(ERROR) << "Can't open X display"; | 123 LOG(ERROR) << "Can't open X display"; |
124 return false; | 124 return false; |
125 } | 125 } |
126 | 126 |
127 media::VideoCodecProfile profile = media::H264PROFILE_BASELINE; | 127 media::VideoCodecProfile profile = media::H264PROFILE_BASELINE; |
128 base::Closure report_error_cb = | 128 base::Closure report_error_cb = |
129 base::Bind(&LogOnError, VaapiH264Decoder::VAAPI_ERROR); | 129 base::Bind(&LogOnError, VaapiH264Decoder::VAAPI_ERROR); |
130 wrapper_ = VaapiWrapper::Create(profile, x_display_, report_error_cb); | 130 wrapper_ = VaapiWrapper::Create(profile, x_display_, report_error_cb); |
131 if (!wrapper_.get()) { | 131 if (!wrapper_.get()) { |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 content::g_md5sum = it->second; | 376 content::g_md5sum = it->second; |
377 continue; | 377 continue; |
378 } | 378 } |
379 if (it->first == "v" || it->first == "vmodule") | 379 if (it->first == "v" || it->first == "vmodule") |
380 continue; | 380 continue; |
381 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; | 381 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; |
382 } | 382 } |
383 | 383 |
384 return RUN_ALL_TESTS(); | 384 return RUN_ALL_TESTS(); |
385 } | 385 } |
OLD | NEW |