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

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: address xhwang's 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 unified diff | Download patch
« no previous file with comments | « no previous file | media/DEPS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/media_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::MediaOzonePlatform* platform =
282 media::MediaOzonePlatform::GetInstance();
283 video_decode_accelerator_.reset(platform->CreateVideoDecodeAccelerator(
284 make_context_current_));
285 if (!video_decode_accelerator_) {
286 SendCreateDecoderReply(init_done_msg, false);
287 return;
288 }
278 #elif defined(OS_ANDROID) 289 #elif defined(OS_ANDROID)
279 video_decode_accelerator_.reset(new AndroidVideoDecodeAccelerator( 290 video_decode_accelerator_.reset(new AndroidVideoDecodeAccelerator(
280 stub_->decoder()->AsWeakPtr(), 291 stub_->decoder()->AsWeakPtr(),
281 make_context_current_)); 292 make_context_current_));
282 #else 293 #else
283 NOTIMPLEMENTED() << "HW video decode acceleration not available."; 294 NOTIMPLEMENTED() << "HW video decode acceleration not available.";
284 SendCreateDecoderReply(init_done_msg, false); 295 SendCreateDecoderReply(init_done_msg, false);
285 return; 296 return;
286 #endif 297 #endif
287 298
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 return stub_->channel()->Send(message); 498 return stub_->channel()->Send(message);
488 } 499 }
489 500
490 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, 501 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message,
491 bool succeeded) { 502 bool succeeded) {
492 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); 503 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded);
493 Send(message); 504 Send(message);
494 } 505 }
495 506
496 } // namespace content 507 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | media/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698