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

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

Issue 10411042: hook up new MacVideoDecodeAccelerator (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clean up Created 8 years, 7 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 4a44b11facf793736cd79ef9fe3f74190316d0da..30503df7b8373a005cbac77b267f3d4fc5d8274e 100644
--- a/content/common/gpu/media/gpu_video_decode_accelerator.cc
+++ b/content/common/gpu/media/gpu_video_decode_accelerator.cc
@@ -10,30 +10,26 @@
#include "base/logging.h"
#include "base/stl_util.h"
-#if defined(OS_WIN)
-#include "base/win/windows_version.h"
-#endif // OS_WIN
-
#include "content/common/gpu/gpu_channel.h"
#include "content/common/gpu/gpu_command_buffer_stub.h"
#include "content/common/gpu/gpu_messages.h"
#include "gpu/command_buffer/common/command_buffer.h"
+#include "gpu/command_buffer/service/texture_manager.h"
#include "ipc/ipc_message_macros.h"
#include "ipc/ipc_message_utils.h"
+#include "ui/gfx/size.h"
+#include "ui/gl/gl_context.h"
+#include "ui/gl/gl_surface_egl.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
+#include "base/win/windows_version.h"
jochen (gone - plz use gerrit) 2012/05/19 20:16:11 nit. alphabetical ordering
Ami GONE FROM CHROMIUM 2012/05/19 20:46:12 sort order
sail 2012/05/30 03:51:33 Done.
sail 2012/05/30 03:51:33 Done.
+#elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL)
#include "content/common/gpu/media/omx_video_decode_accelerator.h"
-#endif // OS_WIN
-#include "ui/gl/gl_context.h"
-#include "ui/gl/gl_surface_egl.h"
+#elif defined(OS_MACOSX)
+#include "content/common/gpu/media/mac_video_decode_accelerator.h"
#endif
-#include "gpu/command_buffer/service/texture_manager.h"
-#include "ui/gfx/size.h"
-
using gpu::gles2::TextureManager;
GpuVideoDecodeAccelerator::GpuVideoDecodeAccelerator(
@@ -127,8 +123,6 @@ void GpuVideoDecodeAccelerator::Initialize(
DCHECK(init_done_msg);
init_done_msg_ = init_done_msg;
-#if (defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL)) || defined(OS_WIN)
- DCHECK(stub_ && stub_->decoder());
#if defined(OS_WIN)
if (base::win::GetVersion() < base::win::VERSION_WIN7) {
NOTIMPLEMENTED() << "HW video decode acceleration not available.";
@@ -136,22 +130,29 @@ void GpuVideoDecodeAccelerator::Initialize(
return;
}
DLOG(INFO) << "Initializing DXVA HW decoder for windows.";
- DXVAVideoDecodeAccelerator* video_decoder =
- new DXVAVideoDecodeAccelerator(this);
-#else // OS_WIN
- OmxVideoDecodeAccelerator* video_decoder =
- new OmxVideoDecodeAccelerator(this);
+ scoped_refptr<DXVAVideoDecodeAccelerator> video_decoder(
Ami GONE FROM CHROMIUM 2012/05/19 20:46:12 Since you're already duplicating the assignment to
sail 2012/05/29 04:21:28 Unfortunately, the code still needs to be able to
+ new DXVAVideoDecodeAccelerator(this));
+ video_decode_accelerator_ = video_decoder;
+#elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL)
+ scoped_refptr<OmxVideoDecodeAccelerator> video_decoder(
+ new OmxVideoDecodeAccelerator(this));
video_decoder->SetEglState(
gfx::GLSurfaceEGL::GetHardwareDisplay(),
stub_->decoder()->GetGLContext()->GetHandle());
-#endif // OS_WIN
video_decode_accelerator_ = video_decoder;
- if (!video_decode_accelerator_->Initialize(profile, frame_size, extra_data))
- NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE);
+#elif defined(OS_MACOSX)
+ scoped_refptr<MacVideoDecodeAccelerator> video_decoder(
+ new MacVideoDecodeAccelerator(this));
+ video_decoder->SetGLContext(stub_->decoder()->GetGLContext()->GetHandle());
+ video_decode_accelerator_ = video_decoder;
#else // Update RenderViewImpl::createMediaPlayer when adding clauses.
Ami GONE FROM CHROMIUM 2012/05/19 20:46:12 I'm pretty sure you need to rebase this CL to pick
sail 2012/05/29 04:21:28 Yea definitely. I'll rebase all the CLs as things
NOTIMPLEMENTED() << "HW video decode acceleration not available.";
NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE);
-#endif // defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL)
+ return;
+#endif
+
+ if (!video_decode_accelerator_->Initialize(profile, frame_size, extra_data))
+ NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE);
}
void GpuVideoDecodeAccelerator::OnDecode(
« no previous file with comments | « no previous file | gpu/command_buffer/common/gles2_cmd_utils.cc » ('j') | ppapi/examples/video_decode/video_decode.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698