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

Unified Diff: content/common/gpu/media/vaapi_video_decode_accelerator.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_video_decode_accelerator.cc
diff --git a/content/common/gpu/media/vaapi_video_decode_accelerator.cc b/content/common/gpu/media/vaapi_video_decode_accelerator.cc
index 704f7f2257382e8536d9cf894342e03bce46b3c0..3bf69ad7712bc9efe2842c9d4d8cb86f56bc82a9 100644
--- a/content/common/gpu/media/vaapi_video_decode_accelerator.cc
+++ b/content/common/gpu/media/vaapi_video_decode_accelerator.cc
@@ -729,8 +729,8 @@ void VaapiVideoDecodeAccelerator::AssignPictureBuffers(
<< " to texture id: " << buffers[i].texture_id()
<< " VASurfaceID: " << va_surface_ids[i];
- linked_ptr<VaapiPicture> picture(VaapiPicture::CreatePicture(
- vaapi_wrapper_.get(), make_context_current_, buffers[i].id(),
+ scoped_refptr<VaapiPicture> picture(VaapiPicture::CreatePicture(
+ vaapi_wrapper_, make_context_current_, buffers[i].id(),
buffers[i].texture_id(), requested_pic_size_));
scoped_refptr<gl::GLImage> image = picture->GetImageToBind();
@@ -930,6 +930,8 @@ void VaapiVideoDecodeAccelerator::Cleanup() {
client_ptr_factory_.reset();
weak_this_factory_.InvalidateWeakPtrs();
+ pictures_.clear();
kalyank 2015/11/14 10:42:06 I have played around with this a bit and issue is
Pawel Osciak 2015/11/16 04:24:35 If there are any references to VaapiDrmPicture bei
william.xie1 2015/11/16 08:07:26 Done.
william.xie1 2015/11/16 08:07:26 Done.
kalyank 2015/11/18 00:21:43 We want to ensure VaapiDrmPicture is alive while a
+ vaapi_wrapper_ = nullptr;
// Signal all potential waiters on the decoder_thread_, let them early-exit,
// as we've just moved to the kDestroying state, and wait for all tasks
@@ -948,6 +950,7 @@ void VaapiVideoDecodeAccelerator::Destroy() {
DCHECK_EQ(message_loop_, base::MessageLoop::current());
Cleanup();
delete this;
+ LOG(WARNING) << "!!!!!!!!!!!!!!!qxie2:" << __FUNCTION__;
}
bool VaapiVideoDecodeAccelerator::CanDecodeOnIOThread() {

Powered by Google App Engine
This is Rietveld 408576698