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

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

Issue 322433004: Create VTVideoDecodeAccelerator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation issues. Created 6 years, 6 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 ab97618ca0b111d1a522d12be5272337107e98ad..0f15ad92bdd007ec64eb5c29b3550ee0af2db13d 100644
--- a/content/common/gpu/media/gpu_video_decode_accelerator.cc
+++ b/content/common/gpu/media/gpu_video_decode_accelerator.cc
@@ -26,6 +26,8 @@
#if defined(OS_WIN)
#include "base/win/windows_version.h"
#include "content/common/gpu/media/dxva_video_decode_accelerator.h"
+#elif defined(OS_MACOSX)
+#include "content/common/gpu/media/vt_video_decode_accelerator.h"
#elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11)
#include "content/common/gpu/media/v4l2_video_decode_accelerator.h"
#include "content/common/gpu/media/v4l2_video_device.h"
@@ -251,6 +253,10 @@ void GpuVideoDecodeAccelerator::Initialize(
DVLOG(0) << "Initializing DXVA HW decoder for windows.";
video_decode_accelerator_.reset(
new DXVAVideoDecodeAccelerator(make_context_current_));
+#elif defined(OS_MACOSX)
+ video_decode_accelerator_.reset(new VTVideoDecodeAccelerator(
+ static_cast<CGLContextObj>(
+ stub_->decoder()->GetGLContext()->GetHandle())));
#elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11)
scoped_ptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder);
if (!device.get()) {
@@ -353,11 +359,12 @@ void GpuVideoDecodeAccelerator::OnAssignPictureBuffers(
NotifyError(media::VideoDecodeAccelerator::INVALID_ARGUMENT);
return;
}
- if (texture_target_ == GL_TEXTURE_EXTERNAL_OES) {
- // GL_TEXTURE_EXTERNAL_OES textures have their dimensions defined by the
+ if (texture_target_ == GL_TEXTURE_EXTERNAL_OES ||
+ texture_target_ == GL_TEXTURE_RECTANGLE) {
scherkus (not reviewing) 2014/06/09 16:02:06 do we need this change right now? in general I pr
sandersd (OOO until July 31) 2014/06/10 01:02:44 Done.
+ // These textures have their dimensions defined by the
// underlying EGLImage. Use |texture_dimensions_| for this size.
texture_manager->SetLevelInfo(texture_ref,
- GL_TEXTURE_EXTERNAL_OES,
+ texture_target_,
0,
0,
texture_dimensions_.width(),
@@ -459,7 +466,6 @@ void GpuVideoDecodeAccelerator::OnWillDestroyStub() {
stub_->channel()->RemoveRoute(host_route_id_);
stub_->RemoveDestructionObserver(this);
- video_decode_accelerator_.reset();
scherkus (not reviewing) 2014/06/09 16:02:06 ditto
sandersd (OOO until July 31) 2014/06/10 01:02:44 More bad merging :-(
delete this;
}

Powered by Google App Engine
This is Rietveld 408576698