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

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

Issue 1127343003: Revert of media: Add MediaOzonePlatform support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 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"
38 #elif defined(OS_ANDROID) 36 #elif defined(OS_ANDROID)
39 #include "content/common/gpu/media/android_video_decode_accelerator.h" 37 #include "content/common/gpu/media/android_video_decode_accelerator.h"
40 #endif 38 #endif
41 39
42 #include "ui/gfx/size.h" 40 #include "ui/gfx/size.h"
43 41
44 namespace content { 42 namespace content {
45 43
46 static bool MakeDecoderContextCurrent( 44 static bool MakeDecoderContextCurrent(
47 const base::WeakPtr<GpuCommandBufferStub> stub) { 45 const base::WeakPtr<GpuCommandBufferStub> stub) {
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 if (gfx::GetGLImplementation() != gfx::kGLImplementationDesktopGL) { 268 if (gfx::GetGLImplementation() != gfx::kGLImplementationDesktopGL) {
271 VLOG(1) << "HW video decode acceleration not available without " 269 VLOG(1) << "HW video decode acceleration not available without "
272 "DesktopGL (GLX)."; 270 "DesktopGL (GLX).";
273 SendCreateDecoderReply(init_done_msg, false); 271 SendCreateDecoderReply(init_done_msg, false);
274 return; 272 return;
275 } 273 }
276 gfx::GLContextGLX* glx_context = 274 gfx::GLContextGLX* glx_context =
277 static_cast<gfx::GLContextGLX*>(stub_->decoder()->GetGLContext()); 275 static_cast<gfx::GLContextGLX*>(stub_->decoder()->GetGLContext());
278 video_decode_accelerator_.reset(new VaapiVideoDecodeAccelerator( 276 video_decode_accelerator_.reset(new VaapiVideoDecodeAccelerator(
279 glx_context->display(), make_context_current_)); 277 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 }
289 #elif defined(OS_ANDROID) 278 #elif defined(OS_ANDROID)
290 video_decode_accelerator_.reset(new AndroidVideoDecodeAccelerator( 279 video_decode_accelerator_.reset(new AndroidVideoDecodeAccelerator(
291 stub_->decoder()->AsWeakPtr(), 280 stub_->decoder()->AsWeakPtr(),
292 make_context_current_)); 281 make_context_current_));
293 #else 282 #else
294 NOTIMPLEMENTED() << "HW video decode acceleration not available."; 283 NOTIMPLEMENTED() << "HW video decode acceleration not available.";
295 SendCreateDecoderReply(init_done_msg, false); 284 SendCreateDecoderReply(init_done_msg, false);
296 return; 285 return;
297 #endif 286 #endif
298 287
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 return stub_->channel()->Send(message); 487 return stub_->channel()->Send(message);
499 } 488 }
500 489
501 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, 490 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message,
502 bool succeeded) { 491 bool succeeded) {
503 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); 492 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded);
504 Send(message); 493 Send(message);
505 } 494 }
506 495
507 } // namespace content 496 } // 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