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

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

Issue 828063009: Clean up V4L2 codec-related flags and defines (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: arm use use_v4l2_codec Created 5 years, 11 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/common.gni ('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 12 matching lines...) Expand all
23 #include "media/base/limits.h" 23 #include "media/base/limits.h"
24 #include "ui/gl/gl_context.h" 24 #include "ui/gl/gl_context.h"
25 #include "ui/gl/gl_surface_egl.h" 25 #include "ui/gl/gl_surface_egl.h"
26 26
27 #if defined(OS_WIN) 27 #if defined(OS_WIN)
28 #include "base/win/windows_version.h" 28 #include "base/win/windows_version.h"
29 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" 29 #include "content/common/gpu/media/dxva_video_decode_accelerator.h"
30 #elif defined(OS_MACOSX) 30 #elif defined(OS_MACOSX)
31 #include "content/common/gpu/media/vt_video_decode_accelerator.h" 31 #include "content/common/gpu/media/vt_video_decode_accelerator.h"
32 #elif defined(OS_CHROMEOS) 32 #elif defined(OS_CHROMEOS)
33 #if defined(ARCH_CPU_ARMEL) && defined(USE_LIBV4L2) 33 #if defined(USE_V4L2_CODEC)
34 #include "content/common/gpu/media/v4l2_slice_video_decode_accelerator.h" 34 #include "content/common/gpu/media/v4l2_slice_video_decode_accelerator.h"
35 #endif // defined(ARCH_CPU_ARMEL)
36 #if defined(ARCH_CPU_ARMEL) || (defined(USE_OZONE) && defined(USE_V4L2_CODEC))
37 #include "content/common/gpu/media/v4l2_video_decode_accelerator.h" 35 #include "content/common/gpu/media/v4l2_video_decode_accelerator.h"
38 #include "content/common/gpu/media/v4l2_video_device.h" 36 #include "content/common/gpu/media/v4l2_video_device.h"
39 // defined(ARCH_CPU_ARMEL) || (defined(USE_OZONE) && defined(USE_V4L2_CODEC))
40 #endif 37 #endif
41 #if defined(ARCH_CPU_X86_FAMILY) 38 #if defined(ARCH_CPU_X86_FAMILY)
42 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" 39 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h"
43 #include "ui/gl/gl_implementation.h" 40 #include "ui/gl/gl_implementation.h"
44 #endif // defined(ARCH_CPU_X86_FAMILY) 41 #endif
45 #elif defined(USE_OZONE) 42 #elif defined(USE_OZONE)
46 #include "media/ozone/media_ozone_platform.h" 43 #include "media/ozone/media_ozone_platform.h"
47 #elif defined(OS_ANDROID) 44 #elif defined(OS_ANDROID)
48 #include "content/common/gpu/media/android_video_decode_accelerator.h" 45 #include "content/common/gpu/media/android_video_decode_accelerator.h"
49 #endif 46 #endif
50 47
51 #include "ui/gfx/geometry/size.h" 48 #include "ui/gfx/geometry/size.h"
52 49
53 namespace content { 50 namespace content {
54 51
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 } else { 293 } else {
297 NOTIMPLEMENTED() << "HW video decode acceleration not available."; 294 NOTIMPLEMENTED() << "HW video decode acceleration not available.";
298 } 295 }
299 #endif 296 #endif
300 return decoder.Pass(); 297 return decoder.Pass();
301 } 298 }
302 299
303 scoped_ptr<media::VideoDecodeAccelerator> 300 scoped_ptr<media::VideoDecodeAccelerator>
304 GpuVideoDecodeAccelerator::CreateV4L2VDA() { 301 GpuVideoDecodeAccelerator::CreateV4L2VDA() {
305 scoped_ptr<media::VideoDecodeAccelerator> decoder; 302 scoped_ptr<media::VideoDecodeAccelerator> decoder;
306 #if defined(OS_CHROMEOS) && (defined(ARCH_CPU_ARMEL) || \ 303 #if defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC)
307 (defined(USE_OZONE) && defined(USE_V4L2_CODEC)))
308 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); 304 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder);
309 if (device.get()) { 305 if (device.get()) {
310 decoder.reset(new V4L2VideoDecodeAccelerator( 306 decoder.reset(new V4L2VideoDecodeAccelerator(
311 gfx::GLSurfaceEGL::GetHardwareDisplay(), 307 gfx::GLSurfaceEGL::GetHardwareDisplay(),
312 stub_->decoder()->GetGLContext()->GetHandle(), 308 stub_->decoder()->GetGLContext()->GetHandle(),
313 weak_factory_for_io_.GetWeakPtr(), 309 weak_factory_for_io_.GetWeakPtr(),
314 make_context_current_, 310 make_context_current_,
315 device, 311 device,
316 io_message_loop_)); 312 io_message_loop_));
317 } 313 }
318 #endif 314 #endif
319 return decoder.Pass(); 315 return decoder.Pass();
320 } 316 }
321 317
322 scoped_ptr<media::VideoDecodeAccelerator> 318 scoped_ptr<media::VideoDecodeAccelerator>
323 GpuVideoDecodeAccelerator::CreateV4L2SliceVDA() { 319 GpuVideoDecodeAccelerator::CreateV4L2SliceVDA() {
324 scoped_ptr<media::VideoDecodeAccelerator> decoder; 320 scoped_ptr<media::VideoDecodeAccelerator> decoder;
325 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_LIBV4L2) 321 #if defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC)
326 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); 322 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder);
327 if (device.get()) { 323 if (device.get()) {
328 decoder.reset(new V4L2SliceVideoDecodeAccelerator( 324 decoder.reset(new V4L2SliceVideoDecodeAccelerator(
329 device, 325 device,
330 gfx::GLSurfaceEGL::GetHardwareDisplay(), 326 gfx::GLSurfaceEGL::GetHardwareDisplay(),
331 stub_->decoder()->GetGLContext()->GetHandle(), 327 stub_->decoder()->GetGLContext()->GetHandle(),
332 weak_factory_for_io_.GetWeakPtr(), 328 weak_factory_for_io_.GetWeakPtr(),
333 make_context_current_, 329 make_context_current_,
334 io_message_loop_)); 330 io_message_loop_));
335 } 331 }
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 return stub_->channel()->Send(message); 574 return stub_->channel()->Send(message);
579 } 575 }
580 576
581 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, 577 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message,
582 bool succeeded) { 578 bool succeeded) {
583 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); 579 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded);
584 Send(message); 580 Send(message);
585 } 581 }
586 582
587 } // namespace content 583 } // namespace content
OLDNEW
« no previous file with comments | « content/common/common.gni ('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