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

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: Created 8 years, 9 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 5f9444fd3d4dfa223cea47a7290e03bb1da0a7b1..a06974d3024719911f6c1f5945cf4a2d17004828 100644
--- a/content/common/gpu/media/gpu_video_decode_accelerator.cc
+++ b/content/common/gpu/media/gpu_video_decode_accelerator.cc
@@ -21,15 +21,25 @@
#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_CHROMEOS) || defined(OS_WIN)
#if defined(OS_WIN)
#include "content/common/gpu/media/dxva_video_decode_accelerator.h"
#else // OS_WIN
Ami GONE FROM CHROMIUM 2012/03/21 13:16:24 Having #else\n#if is confusing; replace with #elif
Pawel Osciak 2012/04/05 10:37:20 Done.
+#if defined(ARCH_CPU_ARMEL)
#include "content/common/gpu/media/omx_video_decode_accelerator.h"
+#elif defined(ARCH_CPU_X86_FAMILY)
+#include "content/common/gpu/media/vaapi_video_decode_accelerator.h"
+#include "ui/gfx/gl/gl_context_glx.h"
+#include "ui/gfx/gl/gl_surface_glx.h"
+#endif // ARCH_CPU_ARMEL
+
+#include "ui/gfx/gl/gl_context.h"
Ami GONE FROM CHROMIUM 2012/03/21 13:16:24 dup of l.40 below?
Pawel Osciak 2012/04/05 10:37:20 Done.
+
#endif // OS_WIN
+
#include "ui/gfx/gl/gl_context.h"
#include "ui/gfx/gl/gl_surface_egl.h"
-#endif
+#endif // OS_CHROMEOS || OS_WIN
#include "gpu/command_buffer/service/texture_manager.h"
#include "ui/gfx/size.h"
@@ -123,7 +133,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 +144,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)
+ DLOG(INFO) << "Initializing VAAPI HW decoder.";
Ami GONE FROM CHROMIUM 2012/03/21 13:16:24 drop
Pawel Osciak 2012/04/05 10:37:20 Ok, although there is a similar print for DXVA a f
+ VaapiVideoDecodeAccelerator* video_decoder =
+ new VaapiVideoDecodeAccelerator(this);
+ gfx::GLContextGLX* glx_context =
+ (gfx::GLContextGLX*) stub_->decoder()->GetGLContext();
Ami GONE FROM CHROMIUM 2012/03/21 13:16:24 Both this and the cast below should be static_cast
Pawel Osciak 2012/04/05 10:37:20 Done.
+ Display* display = glx_context->GetDisplay();
+ GLXContext glx_context_handle = (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 +168,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