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

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

Issue 43283002: Enable GLX/EGL backend switching while run HW video decode with libva. (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 2 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
Index: content/common/gpu/media/gpu_video_decode_accelerator.cc
diff --git a/content/common/gpu/media/gpu_video_decode_accelerator.cc b/content/common/gpu/media/gpu_video_decode_accelerator.cc
index 08e23a33e310b087d8a0874c9e77b768d3bb058a..3188c25c143fb6bbc10da1da1708df6ea30e2cec 100644
--- a/content/common/gpu/media/gpu_video_decode_accelerator.cc
+++ b/content/common/gpu/media/gpu_video_decode_accelerator.cc
@@ -27,8 +27,10 @@
#include "content/common/gpu/media/dxva_video_decode_accelerator.h"
#elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11)
#include "content/common/gpu/media/exynos_video_decode_accelerator.h"
-#elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) && defined(USE_X11)
+#elif defined(ARCH_CPU_X86_FAMILY) && defined(USE_X11)
+#if defined(VIDEO_TEXTURE_GLX_BACKEND)
#include "ui/gl/gl_context_glx.h"
+#endif
#include "content/common/gpu/media/vaapi_video_decode_accelerator.h"
#elif defined(OS_ANDROID)
#include "content/common/gpu/media/android_video_decode_accelerator.h"
@@ -277,7 +279,9 @@ void GpuVideoDecodeAccelerator::Initialize(
weak_factory_for_io_.GetWeakPtr(),
make_context_current_,
io_message_loop_));
-#elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) && defined(USE_X11)
+#elif defined(ARCH_CPU_X86_FAMILY) && defined(USE_X11)
+ DLOG(INFO) << "Initializing VAAPI HW decoder.";
+#if defined(VIDEO_TEXTURE_GLX_BACKEND)
gfx::GLContextGLX* glx_context =
static_cast<gfx::GLContextGLX*>(stub_->decoder()->GetGLContext());
GLXContext glx_context_handle =
@@ -285,6 +289,13 @@ void GpuVideoDecodeAccelerator::Initialize(
video_decode_accelerator_.reset(new VaapiVideoDecodeAccelerator(
glx_context->display(), glx_context_handle, this,
make_context_current_));
+#elif defined(VIDEO_TEXTURE_EGL_BACKEND)
+ video_decode_accelerator_.reset(new VaapiVideoDecodeAccelerator(
+ gfx::GLSurfaceEGL::GetHardwareDisplay(),
+ stub_->decoder()->GetGLContext()->GetHandle(),
+ this,
+ make_context_current_));
+#endif
#elif defined(OS_ANDROID)
video_decode_accelerator_.reset(new AndroidVideoDecodeAccelerator(
this,

Powered by Google App Engine
This is Rietveld 408576698