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

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

Issue 858653002: vaapi plumbing to allow hardware video overlays (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unittests build Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/gpu/media/vaapi_drm_picture.h ('k') | content/common/gpu/media/vaapi_picture.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/media/vaapi_drm_picture.cc
diff --git a/content/common/gpu/media/vaapi_drm_picture.cc b/content/common/gpu/media/vaapi_drm_picture.cc
index 82e16ece31ad9a927aa289b6f8647d8574b3d7c1..628b4c8d4146eecaa214ff5bbdee105bd9249c49 100644
--- a/content/common/gpu/media/vaapi_drm_picture.cc
+++ b/content/common/gpu/media/vaapi_drm_picture.cc
@@ -13,6 +13,7 @@
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_image_linux_dma_buffer.h"
#include "ui/gl/scoped_binders.h"
+#include "ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.h"
#include "ui/ozone/public/native_pixmap.h"
#include "ui/ozone/public/ozone_platform.h"
#include "ui/ozone/public/surface_factory_ozone.h"
@@ -101,17 +102,14 @@ bool VaapiDrmPicture::Initialize() {
if (!make_context_current_.Run())
return false;
- // Create an EGLImage out of the same buffer.
- gl_image_ = new gfx::GLImageLinuxDMABuffer(size(), GL_RGBA);
- if (!gl_image_->Initialize(base::FileDescriptor(dmabuf_fd, false),
- gfx::GpuMemoryBuffer::BGRA_8888, dmabuf_pitch)) {
- LOG(ERROR) << "Failed to create a GLImageLinuxDMABuffer for a NativePixmap";
- return false;
- }
-
- // Bind the EGLImage to the given GL texture.
gfx::ScopedTextureBinder texture_binder(GL_TEXTURE_EXTERNAL_OES,
texture_id());
+ gl_image_ = ui::GpuMemoryBufferFactoryOzoneNativeBuffer::CreateImageForPixmap(
+ pixmap_, size(), gfx::GpuMemoryBuffer::RGBA_8888, GL_RGBA);
+ if (!gl_image_) {
+ LOG(ERROR) << "Failed to create GLImage";
+ return false;
+ }
if (!gl_image_->BindTexImage(GL_TEXTURE_EXTERNAL_OES)) {
LOG(ERROR) << "Failed to bind texture to GLImage";
return false;
@@ -126,4 +124,12 @@ bool VaapiDrmPicture::DownloadFromSurface(
va_surface_->id(), va_surface_->size());
}
+scoped_refptr<gfx::GLImage> VaapiDrmPicture::GetImageToBind() {
+ return gl_image_;
+}
+
+bool VaapiDrmPicture::AllowOverlay() const {
+ return true;
+}
+
} // namespace
« no previous file with comments | « content/common/gpu/media/vaapi_drm_picture.h ('k') | content/common/gpu/media/vaapi_picture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698