OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "media/gpu/gpu_video_decode_accelerator_factory.h" | 5 #include "media/gpu/gpu_video_decode_accelerator_factory.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "gpu/command_buffer/service/gpu_preferences.h" | 8 #include "gpu/command_buffer/service/gpu_preferences.h" |
9 #include "media/base/media_switches.h" | 9 #include "media/base/media_switches.h" |
10 #include "media/gpu/gpu_video_accelerator_util.h" | 10 #include "media/gpu/gpu_video_accelerator_util.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "media/gpu/v4l2_slice_video_decode_accelerator.h" | 22 #include "media/gpu/v4l2_slice_video_decode_accelerator.h" |
23 #include "media/gpu/v4l2_video_decode_accelerator.h" | 23 #include "media/gpu/v4l2_video_decode_accelerator.h" |
24 #include "ui/gl/gl_surface_egl.h" | 24 #include "ui/gl/gl_surface_egl.h" |
25 #endif | 25 #endif |
26 #if defined(ARCH_CPU_X86_FAMILY) | 26 #if defined(ARCH_CPU_X86_FAMILY) |
27 #include "media/gpu/vaapi_video_decode_accelerator.h" | 27 #include "media/gpu/vaapi_video_decode_accelerator.h" |
28 #include "ui/gl/gl_implementation.h" | 28 #include "ui/gl/gl_implementation.h" |
29 #endif | 29 #endif |
30 #elif defined(OS_ANDROID) | 30 #elif defined(OS_ANDROID) |
31 #include "media/gpu/android_video_decode_accelerator.h" | 31 #include "media/gpu/android_video_decode_accelerator.h" |
| 32 #include "media/gpu/android_video_surface_chooser_impl.h" |
32 #include "media/gpu/avda_codec_allocator.h" | 33 #include "media/gpu/avda_codec_allocator.h" |
33 #endif | 34 #endif |
34 | 35 |
35 namespace media { | 36 namespace media { |
36 | 37 |
37 // static | 38 // static |
38 MEDIA_GPU_EXPORT std::unique_ptr<GpuVideoDecodeAcceleratorFactory> | 39 MEDIA_GPU_EXPORT std::unique_ptr<GpuVideoDecodeAcceleratorFactory> |
39 GpuVideoDecodeAcceleratorFactory::Create( | 40 GpuVideoDecodeAcceleratorFactory::Create( |
40 const GetGLContextCallback& get_gl_context_cb, | 41 const GetGLContextCallback& get_gl_context_cb, |
41 const MakeGLContextCurrentCallback& make_context_current_cb, | 42 const MakeGLContextCurrentCallback& make_context_current_cb, |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 } | 243 } |
243 #endif | 244 #endif |
244 | 245 |
245 #if defined(OS_ANDROID) | 246 #if defined(OS_ANDROID) |
246 std::unique_ptr<VideoDecodeAccelerator> | 247 std::unique_ptr<VideoDecodeAccelerator> |
247 GpuVideoDecodeAcceleratorFactory::CreateAndroidVDA( | 248 GpuVideoDecodeAcceleratorFactory::CreateAndroidVDA( |
248 const gpu::GpuDriverBugWorkarounds& workarounds, | 249 const gpu::GpuDriverBugWorkarounds& workarounds, |
249 const gpu::GpuPreferences& gpu_preferences) const { | 250 const gpu::GpuPreferences& gpu_preferences) const { |
250 std::unique_ptr<VideoDecodeAccelerator> decoder; | 251 std::unique_ptr<VideoDecodeAccelerator> decoder; |
251 decoder.reset(new AndroidVideoDecodeAccelerator( | 252 decoder.reset(new AndroidVideoDecodeAccelerator( |
252 AVDACodecAllocator::GetInstance(), make_context_current_cb_, | 253 AVDACodecAllocator::GetInstance(), |
253 get_gles2_decoder_cb_)); | 254 base::MakeUnique<AndroidVideoSurfaceChooserImpl>(), |
| 255 make_context_current_cb_, get_gles2_decoder_cb_, |
| 256 AndroidVideoDecodeAccelerator::PlatformConfig::CreateDefault())); |
254 return decoder; | 257 return decoder; |
255 } | 258 } |
256 #endif | 259 #endif |
257 | 260 |
258 GpuVideoDecodeAcceleratorFactory::GpuVideoDecodeAcceleratorFactory( | 261 GpuVideoDecodeAcceleratorFactory::GpuVideoDecodeAcceleratorFactory( |
259 const GetGLContextCallback& get_gl_context_cb, | 262 const GetGLContextCallback& get_gl_context_cb, |
260 const MakeGLContextCurrentCallback& make_context_current_cb, | 263 const MakeGLContextCurrentCallback& make_context_current_cb, |
261 const BindGLImageCallback& bind_image_cb, | 264 const BindGLImageCallback& bind_image_cb, |
262 const GetGLES2DecoderCallback& get_gles2_decoder_cb) | 265 const GetGLES2DecoderCallback& get_gles2_decoder_cb) |
263 : get_gl_context_cb_(get_gl_context_cb), | 266 : get_gl_context_cb_(get_gl_context_cb), |
264 make_context_current_cb_(make_context_current_cb), | 267 make_context_current_cb_(make_context_current_cb), |
265 bind_image_cb_(bind_image_cb), | 268 bind_image_cb_(bind_image_cb), |
266 get_gles2_decoder_cb_(get_gles2_decoder_cb) {} | 269 get_gles2_decoder_cb_(get_gles2_decoder_cb) {} |
267 | 270 |
268 GpuVideoDecodeAcceleratorFactory::~GpuVideoDecodeAcceleratorFactory() {} | 271 GpuVideoDecodeAcceleratorFactory::~GpuVideoDecodeAcceleratorFactory() {} |
269 | 272 |
270 } // namespace media | 273 } // namespace media |
OLD | NEW |