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

Side by Side Diff: content/common/gpu/media/gpu_video_decode_accelerator.cc

Issue 269673005: media: Add MediaOzonePlatform support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: using OzonePlatformMedia 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/common/gpu/media/gpu_video_decode_accelerator.h" 5 #include "content/common/gpu/media/gpu_video_decode_accelerator.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 15 matching lines...) Expand all
26 #if defined(OS_WIN) 26 #if defined(OS_WIN)
27 #include "base/win/windows_version.h" 27 #include "base/win/windows_version.h"
28 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" 28 #include "content/common/gpu/media/dxva_video_decode_accelerator.h"
29 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11) 29 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11)
30 #include "content/common/gpu/media/v4l2_video_decode_accelerator.h" 30 #include "content/common/gpu/media/v4l2_video_decode_accelerator.h"
31 #include "content/common/gpu/media/v4l2_video_device.h" 31 #include "content/common/gpu/media/v4l2_video_device.h"
32 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) && defined(USE_X11) 32 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) && defined(USE_X11)
33 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" 33 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h"
34 #include "ui/gl/gl_context_glx.h" 34 #include "ui/gl/gl_context_glx.h"
35 #include "ui/gl/gl_implementation.h" 35 #include "ui/gl/gl_implementation.h"
36 #elif defined(USE_OZONE)
37 #include "media/ozone/ozone_platform.h"
36 #elif defined(OS_ANDROID) 38 #elif defined(OS_ANDROID)
37 #include "content/common/gpu/media/android_video_decode_accelerator.h" 39 #include "content/common/gpu/media/android_video_decode_accelerator.h"
38 #endif 40 #endif
39 41
40 #include "ui/gfx/size.h" 42 #include "ui/gfx/size.h"
41 43
42 namespace content { 44 namespace content {
43 45
44 static bool MakeDecoderContextCurrent( 46 static bool MakeDecoderContextCurrent(
45 const base::WeakPtr<GpuCommandBufferStub> stub) { 47 const base::WeakPtr<GpuCommandBufferStub> stub) {
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 if (gfx::GetGLImplementation() != gfx::kGLImplementationDesktopGL) { 270 if (gfx::GetGLImplementation() != gfx::kGLImplementationDesktopGL) {
269 VLOG(1) << "HW video decode acceleration not available without " 271 VLOG(1) << "HW video decode acceleration not available without "
270 "DesktopGL (GLX)."; 272 "DesktopGL (GLX).";
271 SendCreateDecoderReply(init_done_msg, false); 273 SendCreateDecoderReply(init_done_msg, false);
272 return; 274 return;
273 } 275 }
274 gfx::GLContextGLX* glx_context = 276 gfx::GLContextGLX* glx_context =
275 static_cast<gfx::GLContextGLX*>(stub_->decoder()->GetGLContext()); 277 static_cast<gfx::GLContextGLX*>(stub_->decoder()->GetGLContext());
276 video_decode_accelerator_.reset(new VaapiVideoDecodeAccelerator( 278 video_decode_accelerator_.reset(new VaapiVideoDecodeAccelerator(
277 glx_context->display(), make_context_current_)); 279 glx_context->display(), make_context_current_));
280 #elif defined(USE_OZONE)
281 media::OzonePlatformMedia* platform =
282 media::OzonePlatformMedia::GetInstance();
283 video_decode_accelerator_.reset(platform->CreateVideoDecodeFactoryOzone(
284 make_context_current_));
spang 2014/06/09 19:17:32 Probably need to check for NULL return here: if (
vignatti (out of this project) 2014/06/09 20:30:27 Done.
278 #elif defined(OS_ANDROID) 285 #elif defined(OS_ANDROID)
279 video_decode_accelerator_.reset(new AndroidVideoDecodeAccelerator( 286 video_decode_accelerator_.reset(new AndroidVideoDecodeAccelerator(
280 stub_->decoder()->AsWeakPtr(), 287 stub_->decoder()->AsWeakPtr(),
281 make_context_current_)); 288 make_context_current_));
282 #else 289 #else
283 NOTIMPLEMENTED() << "HW video decode acceleration not available."; 290 NOTIMPLEMENTED() << "HW video decode acceleration not available.";
284 SendCreateDecoderReply(init_done_msg, false); 291 SendCreateDecoderReply(init_done_msg, false);
285 return; 292 return;
286 #endif 293 #endif
287 294
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 return stub_->channel()->Send(message); 494 return stub_->channel()->Send(message);
488 } 495 }
489 496
490 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, 497 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message,
491 bool succeeded) { 498 bool succeeded) {
492 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); 499 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded);
493 Send(message); 500 Send(message);
494 } 501 }
495 502
496 } // namespace content 503 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/media/DEPS ('k') | media/DEPS » ('j') | media/media.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698