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

Side by Side 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: Created 5 years 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_video_decode_accelerator.h" 5 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 buffers.size(), &va_surface_ids), 723 buffers.size(), &va_surface_ids),
724 "Failed creating VA Surfaces", PLATFORM_FAILURE, ); 724 "Failed creating VA Surfaces", PLATFORM_FAILURE, );
725 DCHECK_EQ(va_surface_ids.size(), buffers.size()); 725 DCHECK_EQ(va_surface_ids.size(), buffers.size());
726 726
727 for (size_t i = 0; i < buffers.size(); ++i) { 727 for (size_t i = 0; i < buffers.size(); ++i) {
728 DVLOG(2) << "Assigning picture id: " << buffers[i].id() 728 DVLOG(2) << "Assigning picture id: " << buffers[i].id()
729 << " to texture id: " << buffers[i].texture_id() 729 << " to texture id: " << buffers[i].texture_id()
730 << " VASurfaceID: " << va_surface_ids[i]; 730 << " VASurfaceID: " << va_surface_ids[i];
731 731
732 linked_ptr<VaapiPicture> picture(VaapiPicture::CreatePicture( 732 linked_ptr<VaapiPicture> picture(VaapiPicture::CreatePicture(
733 vaapi_wrapper_.get(), make_context_current_, buffers[i].id(), 733 vaapi_wrapper_, make_context_current_, buffers[i].id(),
734 buffers[i].texture_id(), requested_pic_size_)); 734 buffers[i].texture_id(), requested_pic_size_));
735 735
736 scoped_refptr<gl::GLImage> image = picture->GetImageToBind(); 736 scoped_refptr<gl::GLImage> image = picture->GetImageToBind();
737 if (image) { 737 if (image) {
738 bind_image_.Run(buffers[i].internal_texture_id(), 738 bind_image_.Run(buffers[i].internal_texture_id(),
739 VaapiPicture::GetGLTextureTarget(), image); 739 VaapiPicture::GetGLTextureTarget(), image);
740 } 740 }
741 741
742 RETURN_AND_NOTIFY_ON_FAILURE( 742 RETURN_AND_NOTIFY_ON_FAILURE(
743 picture.get(), "Failed assigning picture buffer to a texture.", 743 picture.get(), "Failed assigning picture buffer to a texture.",
(...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after
1732 return vaapi_pic->dec_surface(); 1732 return vaapi_pic->dec_surface();
1733 } 1733 }
1734 1734
1735 // static 1735 // static
1736 media::VideoDecodeAccelerator::SupportedProfiles 1736 media::VideoDecodeAccelerator::SupportedProfiles
1737 VaapiVideoDecodeAccelerator::GetSupportedProfiles() { 1737 VaapiVideoDecodeAccelerator::GetSupportedProfiles() {
1738 return VaapiWrapper::GetSupportedDecodeProfiles(); 1738 return VaapiWrapper::GetSupportedDecodeProfiles();
1739 } 1739 }
1740 1740
1741 } // namespace content 1741 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/media/vaapi_video_decode_accelerator.h ('k') | content/common/gpu/media/vaapi_video_encode_accelerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698