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

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

Issue 490233002: VaapiVideoAccelerator: make Vaapi accelerator work with ozone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update test field Created 6 years, 3 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 | « content/common/BUILD.gn ('k') | content/common/gpu/media/gpu_video_encode_accelerator.cc » ('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 13 matching lines...) Expand all
24 #include "ui/gl/gl_surface_egl.h" 24 #include "ui/gl/gl_surface_egl.h"
25 25
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_MACOSX) 29 #elif defined(OS_MACOSX)
30 #include "content/common/gpu/media/vt_video_decode_accelerator.h" 30 #include "content/common/gpu/media/vt_video_decode_accelerator.h"
31 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11) 31 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11)
32 #include "content/common/gpu/media/v4l2_video_decode_accelerator.h" 32 #include "content/common/gpu/media/v4l2_video_decode_accelerator.h"
33 #include "content/common/gpu/media/v4l2_video_device.h" 33 #include "content/common/gpu/media/v4l2_video_device.h"
34 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) && defined(USE_X11) 34 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
35 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" 35 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h"
36 #include "ui/gl/gl_context_glx.h"
37 #include "ui/gl/gl_implementation.h" 36 #include "ui/gl/gl_implementation.h"
38 #elif defined(USE_OZONE) 37 #elif defined(USE_OZONE)
39 #include "media/ozone/media_ozone_platform.h" 38 #include "media/ozone/media_ozone_platform.h"
40 #elif defined(OS_ANDROID) 39 #elif defined(OS_ANDROID)
41 #include "content/common/gpu/media/android_video_decode_accelerator.h" 40 #include "content/common/gpu/media/android_video_decode_accelerator.h"
42 #endif 41 #endif
43 42
44 #include "ui/gfx/size.h" 43 #include "ui/gfx/size.h"
45 44
46 namespace content { 45 namespace content {
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 SendCreateDecoderReply(init_done_msg, false); 265 SendCreateDecoderReply(init_done_msg, false);
267 return; 266 return;
268 } 267 }
269 video_decode_accelerator_.reset(new V4L2VideoDecodeAccelerator( 268 video_decode_accelerator_.reset(new V4L2VideoDecodeAccelerator(
270 gfx::GLSurfaceEGL::GetHardwareDisplay(), 269 gfx::GLSurfaceEGL::GetHardwareDisplay(),
271 stub_->decoder()->GetGLContext()->GetHandle(), 270 stub_->decoder()->GetGLContext()->GetHandle(),
272 weak_factory_for_io_.GetWeakPtr(), 271 weak_factory_for_io_.GetWeakPtr(),
273 make_context_current_, 272 make_context_current_,
274 device.Pass(), 273 device.Pass(),
275 io_message_loop_)); 274 io_message_loop_));
276 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) && defined(USE_X11) 275 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
277 if (gfx::GetGLImplementation() != gfx::kGLImplementationDesktopGL) {
278 VLOG(1) << "HW video decode acceleration not available without "
279 "DesktopGL (GLX).";
280 SendCreateDecoderReply(init_done_msg, false);
281 return;
282 }
283 gfx::GLContextGLX* glx_context =
284 static_cast<gfx::GLContextGLX*>(stub_->decoder()->GetGLContext());
285 video_decode_accelerator_.reset(new VaapiVideoDecodeAccelerator( 276 video_decode_accelerator_.reset(new VaapiVideoDecodeAccelerator(
286 glx_context->display(), make_context_current_)); 277 stub_->decoder()->GetGLContext(), make_context_current_));
287 #elif defined(USE_OZONE)
spang 2014/08/29 18:51:27 I'm concerned about removing this without providin
llandwerlin-old 2014/09/01 09:39:13 Ok, I wasn't aware there was another project out t
vignatti (out of this project) 2014/09/01 09:49:50 yeah, Ozone-Wayland is using it at the moment: htt
288 media::MediaOzonePlatform* platform =
289 media::MediaOzonePlatform::GetInstance();
290 video_decode_accelerator_.reset(platform->CreateVideoDecodeAccelerator(
291 make_context_current_));
292 if (!video_decode_accelerator_) {
293 SendCreateDecoderReply(init_done_msg, false);
294 return;
295 }
296 #elif defined(OS_ANDROID) 278 #elif defined(OS_ANDROID)
297 video_decode_accelerator_.reset(new AndroidVideoDecodeAccelerator( 279 video_decode_accelerator_.reset(new AndroidVideoDecodeAccelerator(
298 stub_->decoder()->AsWeakPtr(), 280 stub_->decoder()->AsWeakPtr(),
299 make_context_current_)); 281 make_context_current_));
300 #else 282 #else
301 NOTIMPLEMENTED() << "HW video decode acceleration not available."; 283 NOTIMPLEMENTED() << "HW video decode acceleration not available.";
302 SendCreateDecoderReply(init_done_msg, false); 284 SendCreateDecoderReply(init_done_msg, false);
303 return; 285 return;
304 #endif 286 #endif
305 287
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 return stub_->channel()->Send(message); 489 return stub_->channel()->Send(message);
508 } 490 }
509 491
510 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, 492 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message,
511 bool succeeded) { 493 bool succeeded) {
512 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); 494 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded);
513 Send(message); 495 Send(message);
514 } 496 }
515 497
516 } // namespace content 498 } // namespace content
OLDNEW
« no previous file with comments | « content/common/BUILD.gn ('k') | content/common/gpu/media/gpu_video_encode_accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698