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

Unified Diff: content/common/gpu/media/vaapi_wrapper.cc

Issue 1432963003: [Ozone] Extends the lifetime of VaapiWrapper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: NOT for upstream Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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 4f073d3a1768ba2cba239e58cd7a7627e8b95b3c..848fd8bd9bd100c237d0d63f916966a02cbb7253 100644
--- a/content/common/gpu/media/vaapi_wrapper.cc
+++ b/content/common/gpu/media/vaapi_wrapper.cc
@@ -142,7 +142,7 @@ VaapiWrapper::~VaapiWrapper() {
}
// static
-scoped_ptr<VaapiWrapper> VaapiWrapper::Create(
+scoped_refptr<VaapiWrapper> VaapiWrapper::Create(
CodecMode mode,
VAProfile va_profile,
const base::Closure& report_error_to_uma_cb) {
@@ -151,7 +151,7 @@ scoped_ptr<VaapiWrapper> VaapiWrapper::Create(
return nullptr;
}
- scoped_ptr<VaapiWrapper> vaapi_wrapper(new VaapiWrapper());
+ scoped_refptr<VaapiWrapper> vaapi_wrapper(new VaapiWrapper());
if (vaapi_wrapper->VaInitialize(report_error_to_uma_cb)) {
if (vaapi_wrapper->Initialize(mode, va_profile))
return vaapi_wrapper.Pass();
@@ -161,12 +161,12 @@ scoped_ptr<VaapiWrapper> VaapiWrapper::Create(
}
// static
-scoped_ptr<VaapiWrapper> VaapiWrapper::CreateForVideoCodec(
+scoped_refptr<VaapiWrapper> VaapiWrapper::CreateForVideoCodec(
CodecMode mode,
media::VideoCodecProfile profile,
const base::Closure& report_error_to_uma_cb) {
VAProfile va_profile = ProfileToVAProfile(profile, mode);
- scoped_ptr<VaapiWrapper> vaapi_wrapper =
+ scoped_refptr<VaapiWrapper> vaapi_wrapper =
Create(mode, va_profile, report_error_to_uma_cb);
return vaapi_wrapper.Pass();
}
@@ -1063,7 +1063,7 @@ bool VaapiWrapper::PostSandboxInitialization() {
VaapiWrapper::LazyProfileInfos::LazyProfileInfos() {
static_assert(arraysize(supported_profiles_) == kCodecModeMax,
"The array size of supported profile is incorrect.");
- scoped_ptr<VaapiWrapper> vaapi_wrapper(new VaapiWrapper());
+ scoped_refptr<VaapiWrapper> vaapi_wrapper(new VaapiWrapper());
if (!vaapi_wrapper->VaInitialize(base::Bind(&base::DoNothing)))
return;
for (size_t i = 0; i < kCodecModeMax; ++i) {

Powered by Google App Engine
This is Rietveld 408576698