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

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

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