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

Side by Side Diff: content/common/gpu/media/vaapi_drm_picture.cc

Issue 886353005: [VAAPI-DRM] Fix GpuMemoryBuffer format when creating a pixmap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/file_descriptor_posix.h" 5 #include "base/file_descriptor_posix.h"
6 #include "content/common/gpu/media/va_surface.h" 6 #include "content/common/gpu/media/va_surface.h"
7 #include "content/common/gpu/media/vaapi_drm_picture.h" 7 #include "content/common/gpu/media/vaapi_drm_picture.h"
8 #include "content/common/gpu/media/vaapi_wrapper.h" 8 #include "content/common/gpu/media/vaapi_wrapper.h"
9 #include "third_party/libva/va/drm/va_drm.h" 9 #include "third_party/libva/va/drm/va_drm.h"
10 #include "third_party/libva/va/va.h" 10 #include "third_party/libva/va/va.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 LOG(ERROR) << "Failed to create VASurface for an Ozone NativePixmap"; 98 LOG(ERROR) << "Failed to create VASurface for an Ozone NativePixmap";
99 return false; 99 return false;
100 } 100 }
101 101
102 if (!make_context_current_.Run()) 102 if (!make_context_current_.Run())
103 return false; 103 return false;
104 104
105 gfx::ScopedTextureBinder texture_binder(GL_TEXTURE_EXTERNAL_OES, 105 gfx::ScopedTextureBinder texture_binder(GL_TEXTURE_EXTERNAL_OES,
106 texture_id()); 106 texture_id());
107 gl_image_ = ui::GpuMemoryBufferFactoryOzoneNativeBuffer::CreateImageForPixmap( 107 gl_image_ = ui::GpuMemoryBufferFactoryOzoneNativeBuffer::CreateImageForPixmap(
108 pixmap_, size(), gfx::GpuMemoryBuffer::RGBA_8888, GL_RGBA); 108 pixmap_, size(), gfx::GpuMemoryBuffer::BGRA_8888, GL_RGBA);
109 if (!gl_image_) { 109 if (!gl_image_) {
110 LOG(ERROR) << "Failed to create GLImage"; 110 LOG(ERROR) << "Failed to create GLImage";
111 return false; 111 return false;
112 } 112 }
113 if (!gl_image_->BindTexImage(GL_TEXTURE_EXTERNAL_OES)) { 113 if (!gl_image_->BindTexImage(GL_TEXTURE_EXTERNAL_OES)) {
114 LOG(ERROR) << "Failed to bind texture to GLImage"; 114 LOG(ERROR) << "Failed to bind texture to GLImage";
115 return false; 115 return false;
116 } 116 }
117 117
118 return true; 118 return true;
119 } 119 }
120 120
121 bool VaapiDrmPicture::DownloadFromSurface( 121 bool VaapiDrmPicture::DownloadFromSurface(
122 const scoped_refptr<VASurface>& va_surface) { 122 const scoped_refptr<VASurface>& va_surface) {
123 return vaapi_wrapper_->BlitSurface(va_surface->id(), va_surface->size(), 123 return vaapi_wrapper_->BlitSurface(va_surface->id(), va_surface->size(),
124 va_surface_->id(), va_surface_->size()); 124 va_surface_->id(), va_surface_->size());
125 } 125 }
126 126
127 scoped_refptr<gfx::GLImage> VaapiDrmPicture::GetImageToBind() { 127 scoped_refptr<gfx::GLImage> VaapiDrmPicture::GetImageToBind() {
128 return gl_image_; 128 return gl_image_;
129 } 129 }
130 130
131 bool VaapiDrmPicture::AllowOverlay() const { 131 bool VaapiDrmPicture::AllowOverlay() const {
132 return true; 132 return true;
133 } 133 }
134 134
135 } // namespace 135 } // namespace
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698