Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/vaapi_wrapper.h" | 5 #include "content/common/gpu/media/vaapi_wrapper.h" |
| 6 | 6 |
| 7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 284 return false; | 284 return false; |
| 285 } | 285 } |
| 286 | 286 |
| 287 report_error_to_uma_cb_ = report_error_to_uma_cb; | 287 report_error_to_uma_cb_ = report_error_to_uma_cb; |
| 288 | 288 |
| 289 base::AutoLock auto_lock(va_lock_); | 289 base::AutoLock auto_lock(va_lock_); |
| 290 | 290 |
| 291 #if defined(USE_X11) | 291 #if defined(USE_X11) |
| 292 va_display_ = vaGetDisplay(gfx::GetXDisplay()); | 292 va_display_ = vaGetDisplay(gfx::GetXDisplay()); |
| 293 #elif defined(USE_OZONE) | 293 #elif defined(USE_OZONE) |
| 294 ui::OzonePlatform* platform = ui::OzonePlatform::GetInstance(); | 294 const char* kDriRenderNode0Path = "/dev/dri/renderD128"; |
|
Pawel Osciak
2015/04/08 23:39:20
I don't see this node on BYT or HSW for example...
| |
| 295 ui::SurfaceFactoryOzone* factory = platform->GetSurfaceFactoryOzone(); | 295 drm_file_ = base::File(base::FilePath::FromUTF8Unsafe(kDriRenderNode0Path), |
| 296 | 296 base::File::FLAG_OPEN | base::File::FLAG_READ | |
| 297 va_display_ = vaGetDisplayDRM(factory->GetDrmFd()); | 297 base::File::FLAG_WRITE); |
| 298 va_display_ = vaGetDisplayDRM(drm_file_.GetPlatformFile()); | |
| 298 #endif // USE_X11 | 299 #endif // USE_X11 |
| 299 | 300 |
| 300 if (!vaDisplayIsValid(va_display_)) { | 301 if (!vaDisplayIsValid(va_display_)) { |
| 301 LOG(ERROR) << "Could not get a valid VA display"; | 302 LOG(ERROR) << "Could not get a valid VA display"; |
| 302 return false; | 303 return false; |
| 303 } | 304 } |
| 304 | 305 |
| 305 VAStatus va_res = vaInitialize(va_display_, &major_version_, &minor_version_); | 306 VAStatus va_res = vaInitialize(va_display_, &major_version_, &minor_version_); |
| 306 VA_SUCCESS_OR_RETURN(va_res, "vaInitialize failed", false); | 307 VA_SUCCESS_OR_RETURN(va_res, "vaInitialize failed", false); |
| 307 va_initialized_ = true; | 308 va_initialized_ = true; |
| (...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1054 bool VaapiWrapper::LazyProfileInfos::IsProfileSupported( | 1055 bool VaapiWrapper::LazyProfileInfos::IsProfileSupported( |
| 1055 CodecMode mode, VAProfile va_profile) { | 1056 CodecMode mode, VAProfile va_profile) { |
| 1056 for (const auto& profile : supported_profiles_[mode]) { | 1057 for (const auto& profile : supported_profiles_[mode]) { |
| 1057 if (profile.va_profile == va_profile) | 1058 if (profile.va_profile == va_profile) |
| 1058 return true; | 1059 return true; |
| 1059 } | 1060 } |
| 1060 return false; | 1061 return false; |
| 1061 } | 1062 } |
| 1062 | 1063 |
| 1063 } // namespace content | 1064 } // namespace content |
| OLD | NEW |