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

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

Issue 9814001: Add VAVDA, the VAAPI Video Decode Accelerator for Intel CPUs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix for occasional decode freeze on output falling behind for more demanding streams. Created 8 years, 8 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 224ba3ab5cd820cdb67acf00a5709fdb39a28101..fe46d67803b2cf6bedd2d4c675303e9a02b83eb5 100644
--- a/content/common/gpu/media/gpu_video_decode_accelerator.cc
+++ b/content/common/gpu/media/gpu_video_decode_accelerator.cc
@@ -21,15 +21,24 @@
#include "content/common/gpu/gpu_command_buffer_stub.h"
#include "content/common/gpu/gpu_messages.h"
-#if (defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL)) || defined(OS_WIN)
#if defined(OS_WIN)
#include "content/common/gpu/media/dxva_video_decode_accelerator.h"
-#else // OS_WIN
+
+#elif defined(OS_CHROMEOS)
Ami GONE FROM CHROMIUM 2012/04/09 02:41:47 else isn't buying you clarity here; I'd close the
Pawel Osciak 2012/05/03 16:22:07 Done.
+#if defined(ARCH_CPU_ARMEL)
#include "content/common/gpu/media/omx_video_decode_accelerator.h"
+#elif defined(ARCH_CPU_X86_FAMILY)
Ami GONE FROM CHROMIUM 2012/04/09 02:41:47 Is it the case that all cros/intel have VA HW supp
Pawel Osciak 2012/05/03 16:22:07 No, not all of them, but it's harmless, libva will
+#include "ui/gfx/gl/gl_context_glx.h"
+#include "ui/gfx/gl/gl_surface_glx.h"
+#include "content/common/gpu/media/vaapi_video_decode_accelerator.h"
+#endif // OS_CHROMEOS
+
#endif // OS_WIN
+
+#if defined(OS_WIN) || defined(OS_CHROMEOS)
#include "ui/gfx/gl/gl_context.h"
#include "ui/gfx/gl/gl_surface_egl.h"
-#endif
+#endif // OS_WIN || OS_CHROMEOS
#include "gpu/command_buffer/service/texture_manager.h"
#include "ui/gfx/size.h"
@@ -123,7 +132,7 @@ void GpuVideoDecodeAccelerator::Initialize(
DCHECK(init_done_msg);
init_done_msg_ = init_done_msg;
-#if (defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL)) || defined(OS_WIN)
+#if defined(OS_CHROMEOS) || defined(OS_WIN)
DCHECK(stub_ && stub_->decoder());
#if defined(OS_WIN)
if (base::win::GetVersion() < base::win::VERSION_WIN7) {
@@ -134,12 +143,23 @@ void GpuVideoDecodeAccelerator::Initialize(
DLOG(INFO) << "Initializing DXVA HW decoder for windows.";
DXVAVideoDecodeAccelerator* video_decoder =
new DXVAVideoDecodeAccelerator(this, renderer_process);
-#else // OS_WIN
+#elif defined(OS_CHROMEOS) // OS_WIN
+#if defined(ARCH_CPU_ARMEL)
OmxVideoDecodeAccelerator* video_decoder =
new OmxVideoDecodeAccelerator(this);
video_decoder->SetEglState(
gfx::GLSurfaceEGL::GetHardwareDisplay(),
stub_->decoder()->GetGLContext()->GetHandle());
+#elif defined(ARCH_CPU_X86_FAMILY)
+ VaapiVideoDecodeAccelerator* video_decoder =
+ new VaapiVideoDecodeAccelerator(this);
+ gfx::GLContextGLX* glx_context =
+ static_cast<gfx::GLContextGLX*>(stub_->decoder()->GetGLContext());
+ Display* display = glx_context->GetDisplay();
+ GLXContext glx_context_handle =
+ static_cast<GLXContext>(glx_context->GetHandle());
+ video_decoder->SetGlxState(display, glx_context_handle);
+#endif // ARCH_CPU_ARMEL
#endif // OS_WIN
video_decode_accelerator_ = video_decoder;
if (!video_decode_accelerator_->Initialize(profile))
@@ -147,7 +167,7 @@ void GpuVideoDecodeAccelerator::Initialize(
#else // Update RenderViewImpl::createMediaPlayer when adding clauses.
NOTIMPLEMENTED() << "HW video decode acceleration not available.";
NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE);
-#endif // defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL)
+#endif // defined(OS_CHROMEOS) || defined(OS_WIN)
}
void GpuVideoDecodeAccelerator::OnDecode(

Powered by Google App Engine
This is Rietveld 408576698