Index: content/common/gpu/media/vaapi_wrapper.cc |
diff --git a/content/common/gpu/media/vaapi_wrapper.cc b/content/common/gpu/media/vaapi_wrapper.cc |
index 219e370e5bdc29475be4555ccc20660528d03500..c30c58dfce2610652a7f1a95ec990b0b286746df 100644 |
--- a/content/common/gpu/media/vaapi_wrapper.cc |
+++ b/content/common/gpu/media/vaapi_wrapper.cc |
@@ -62,6 +62,11 @@ namespace content { |
// and not taken from HW documentation. |
const int kMaxEncoderFramerate = 30; |
+#if defined(USE_OZONE) |
+base::LazyInstance<base::File> |
+ VaapiWrapper::drm_file_ = LAZY_INSTANCE_INITIALIZER; |
+#endif |
+ |
base::LazyInstance<VaapiWrapper::LazyProfileInfos> |
VaapiWrapper::profile_infos_ = LAZY_INSTANCE_INITIALIZER; |
@@ -317,11 +322,7 @@ bool VaapiWrapper::VaInitialize(const base::Closure& report_error_to_uma_cb) { |
#if defined(USE_X11) |
va_display_ = vaGetDisplay(gfx::GetXDisplay()); |
#elif defined(USE_OZONE) |
- const char* kDriRenderNode0Path = "/dev/dri/renderD128"; |
- drm_file_ = base::File(base::FilePath::FromUTF8Unsafe(kDriRenderNode0Path), |
- base::File::FLAG_OPEN | base::File::FLAG_READ | |
- base::File::FLAG_WRITE); |
- va_display_ = vaGetDisplayDRM(drm_file_.GetPlatformFile()); |
+ va_display_ = vaGetDisplayDRM(drm_file_.Get().GetPlatformFile()); |
dnicoara
2015/05/07 21:17:09
Previously, weren't we crashing because of double
hshi1
2015/05/07 21:50:17
The double close (bug 464628) was because we're us
dnicoara
2015/05/07 22:04:27
Are you sure VAApiWrapper is shared? If I open mul
|
#endif // USE_X11 |
if (!vaDisplayIsValid(va_display_)) { |
@@ -1042,6 +1043,17 @@ void VaapiWrapper::DeinitializeVpp() { |
} |
// static |
+void VaapiWrapper::PreSandboxInitialization() { |
+#if defined(USE_OZONE) |
+ const char* kDriRenderNode0Path = "/dev/dri/renderD128"; |
+ drm_file_.Get().Initialize( |
+ base::FilePath::FromUTF8Unsafe(kDriRenderNode0Path), |
+ base::File::FLAG_OPEN | base::File::FLAG_READ | |
+ base::File::FLAG_WRITE); |
+#endif |
+} |
+ |
+// static |
bool VaapiWrapper::PostSandboxInitialization() { |
StubPathMap paths; |