| 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/avda_codec_allocator.h" |
| 32 #endif | 33 #endif |
| 33 | 34 |
| 34 namespace media { | 35 namespace media { |
| 35 | 36 |
| 36 // static | 37 // static |
| 37 MEDIA_GPU_EXPORT std::unique_ptr<GpuVideoDecodeAcceleratorFactory> | 38 MEDIA_GPU_EXPORT std::unique_ptr<GpuVideoDecodeAcceleratorFactory> |
| 38 GpuVideoDecodeAcceleratorFactory::Create( | 39 GpuVideoDecodeAcceleratorFactory::Create( |
| 39 const GetGLContextCallback& get_gl_context_cb, | 40 const GetGLContextCallback& get_gl_context_cb, |
| 40 const MakeGLContextCurrentCallback& make_context_current_cb, | 41 const MakeGLContextCurrentCallback& make_context_current_cb, |
| 41 const BindGLImageCallback& bind_image_cb) { | 42 const BindGLImageCallback& bind_image_cb) { |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 return decoder; | 241 return decoder; |
| 241 } | 242 } |
| 242 #endif | 243 #endif |
| 243 | 244 |
| 244 #if defined(OS_ANDROID) | 245 #if defined(OS_ANDROID) |
| 245 std::unique_ptr<VideoDecodeAccelerator> | 246 std::unique_ptr<VideoDecodeAccelerator> |
| 246 GpuVideoDecodeAcceleratorFactory::CreateAndroidVDA( | 247 GpuVideoDecodeAcceleratorFactory::CreateAndroidVDA( |
| 247 const gpu::GpuDriverBugWorkarounds& workarounds, | 248 const gpu::GpuDriverBugWorkarounds& workarounds, |
| 248 const gpu::GpuPreferences& gpu_preferences) const { | 249 const gpu::GpuPreferences& gpu_preferences) const { |
| 249 std::unique_ptr<VideoDecodeAccelerator> decoder; | 250 std::unique_ptr<VideoDecodeAccelerator> decoder; |
| 250 decoder.reset(new AndroidVideoDecodeAccelerator(make_context_current_cb_, | 251 decoder.reset(new AndroidVideoDecodeAccelerator( |
| 251 get_gles2_decoder_cb_)); | 252 AVDACodecAllocator::Instance(), make_context_current_cb_, |
| 253 get_gles2_decoder_cb_)); |
| 252 return decoder; | 254 return decoder; |
| 253 } | 255 } |
| 254 #endif | 256 #endif |
| 255 | 257 |
| 256 GpuVideoDecodeAcceleratorFactory::GpuVideoDecodeAcceleratorFactory( | 258 GpuVideoDecodeAcceleratorFactory::GpuVideoDecodeAcceleratorFactory( |
| 257 const GetGLContextCallback& get_gl_context_cb, | 259 const GetGLContextCallback& get_gl_context_cb, |
| 258 const MakeGLContextCurrentCallback& make_context_current_cb, | 260 const MakeGLContextCurrentCallback& make_context_current_cb, |
| 259 const BindGLImageCallback& bind_image_cb, | 261 const BindGLImageCallback& bind_image_cb, |
| 260 const GetGLES2DecoderCallback& get_gles2_decoder_cb) | 262 const GetGLES2DecoderCallback& get_gles2_decoder_cb) |
| 261 : get_gl_context_cb_(get_gl_context_cb), | 263 : get_gl_context_cb_(get_gl_context_cb), |
| 262 make_context_current_cb_(make_context_current_cb), | 264 make_context_current_cb_(make_context_current_cb), |
| 263 bind_image_cb_(bind_image_cb), | 265 bind_image_cb_(bind_image_cb), |
| 264 get_gles2_decoder_cb_(get_gles2_decoder_cb) {} | 266 get_gles2_decoder_cb_(get_gles2_decoder_cb) {} |
| 265 | 267 |
| 266 GpuVideoDecodeAcceleratorFactory::~GpuVideoDecodeAcceleratorFactory() {} | 268 GpuVideoDecodeAcceleratorFactory::~GpuVideoDecodeAcceleratorFactory() {} |
| 267 | 269 |
| 268 } // namespace media | 270 } // namespace media |
| OLD | NEW |