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

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

Issue 8510039: Initial implementation of the DXVA 2.0 H.264 hardware decoder for pepper for Windows. The decodin... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years 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
===================================================================
--- content/common/gpu/media/gpu_video_decode_accelerator.cc (revision 114547)
+++ content/common/gpu/media/gpu_video_decode_accelerator.cc (working copy)
@@ -9,17 +9,28 @@
#include "base/bind.h"
#include "base/logging.h"
#include "base/stl_util.h"
+
+#if defined(OS_WIN)
+#include "base/win/windows_version.h"
+#endif // OS_WIN
+
#include "gpu/command_buffer/common/command_buffer.h"
#include "ipc/ipc_message_macros.h"
#include "ipc/ipc_message_utils.h"
#include "content/common/gpu/gpu_channel.h"
#include "content/common/gpu/gpu_command_buffer_stub.h"
#include "content/common/gpu/gpu_messages.h"
-#if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL)
+
+#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
#include "content/common/gpu/media/omx_video_decode_accelerator.h"
+#endif // OS_WIN
#include "ui/gfx/gl/gl_context.h"
Ami GONE FROM CHROMIUM 2011/12/19 22:53:44 Now I see why you did that; it would be clearer IM
ananta 2011/12/20 02:27:22 Done. This would break the sorted include order th
Ami GONE FROM CHROMIUM 2011/12/20 21:00:24 I don't follow. Are you saying there are lint err
ananta 2011/12/20 22:27:27 Lint errors below:- +#if (defined(OS_CHROMEOS) &&
#include "ui/gfx/gl/gl_surface_egl.h"
#endif
+
#include "gpu/command_buffer/service/texture_manager.h"
#include "ui/gfx/size.h"
@@ -108,18 +119,32 @@
void GpuVideoDecodeAccelerator::Initialize(
const media::VideoDecodeAccelerator::Profile profile,
- IPC::Message* init_done_msg) {
+ IPC::Message* init_done_msg,
+ base::ProcessHandle renderer_process) {
DCHECK(!video_decode_accelerator_.get());
DCHECK(!init_done_msg_);
DCHECK(init_done_msg);
init_done_msg_ = init_done_msg;
-#if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL)
+
+#if (defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL)) || defined(OS_WIN)
DCHECK(stub_ && stub_->decoder());
- OmxVideoDecodeAccelerator* omx_decoder = new OmxVideoDecodeAccelerator(this);
- omx_decoder->SetEglState(
+#if defined(OS_WIN)
+ if (base::win::GetVersion() < base::win::VERSION_WIN7) {
+ NOTIMPLEMENTED() << "HW video decode acceleration not available.";
+ NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE);
+ return;
+ }
+ DLOG(INFO) << "Initializing DXVA HW decoder for windows.";
+ DXVAVideoDecodeAccelerator* video_decoder =
+ new DXVAVideoDecodeAccelerator(this, renderer_process);
+#else // OS_WIN
+ OmxVideoDecodeAccelerator* video_decoder =
+ new OmxVideoDecodeAccelerator(this);
+ video_decoder->SetEglState(
gfx::GLSurfaceEGL::GetHardwareDisplay(),
stub_->decoder()->GetGLContext()->GetHandle());
- video_decode_accelerator_ = omx_decoder;
+#endif // OS_WIN
+ video_decode_accelerator_ = video_decoder;
video_decode_accelerator_->Initialize(profile);
#else // Update RenderViewImpl::createMediaPlayer when adding clauses.
NOTIMPLEMENTED() << "HW video decode acceleration not available.";

Powered by Google App Engine
This is Rietveld 408576698