| 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 "content/public/gpu/gpu_video_decode_accelerator_factory.h" | 5 #include "content/public/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 "content/common/gpu/media/gpu_video_decode_accelerator_factory_impl.h" | 8 #include "content/common/gpu/media/gpu_video_decode_accelerator_factory_impl.h" |
| 9 #include "content/gpu/gpu_child_thread.h" | 9 #include "content/gpu/gpu_child_thread.h" |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 get_gl_context_cb, make_context_current_cb, bind_image_cb, | 39 get_gl_context_cb, make_context_current_cb, bind_image_cb, |
| 40 get_gles2_decoder_cb); | 40 get_gles2_decoder_cb); |
| 41 if (!gvdafactory_impl) | 41 if (!gvdafactory_impl) |
| 42 return nullptr; | 42 return nullptr; |
| 43 | 43 |
| 44 return base::WrapUnique( | 44 return base::WrapUnique( |
| 45 new GpuVideoDecodeAcceleratorFactory(std::move(gvdafactory_impl))); | 45 new GpuVideoDecodeAcceleratorFactory(std::move(gvdafactory_impl))); |
| 46 } | 46 } |
| 47 | 47 |
| 48 // static | 48 // static |
| 49 std::unique_ptr<GpuVideoDecodeAcceleratorFactory> |
| 50 GpuVideoDecodeAcceleratorFactory::CreateWithNoGL() { |
| 51 auto gvdafactory_impl = |
| 52 GpuVideoDecodeAcceleratorFactoryImpl::CreateWithNoGL(); |
| 53 if (!gvdafactory_impl) |
| 54 return nullptr; |
| 55 |
| 56 return base::WrapUnique( |
| 57 new GpuVideoDecodeAcceleratorFactory(std::move(gvdafactory_impl))); |
| 58 } |
| 59 |
| 60 // static |
| 49 gpu::VideoDecodeAcceleratorCapabilities | 61 gpu::VideoDecodeAcceleratorCapabilities |
| 50 GpuVideoDecodeAcceleratorFactory::GetDecoderCapabilities() { | 62 GpuVideoDecodeAcceleratorFactory::GetDecoderCapabilities() { |
| 51 const gpu::GpuPreferences gpu_preferences = | 63 const gpu::GpuPreferences gpu_preferences = |
| 52 GpuChildThread::current()->gpu_preferences(); | 64 GpuChildThread::current()->gpu_preferences(); |
| 53 return GpuVideoDecodeAcceleratorFactoryImpl::GetDecoderCapabilities( | 65 return GpuVideoDecodeAcceleratorFactoryImpl::GetDecoderCapabilities( |
| 54 gpu_preferences); | 66 gpu_preferences); |
| 55 } | 67 } |
| 56 | 68 |
| 57 std::unique_ptr<media::VideoDecodeAccelerator> | 69 std::unique_ptr<media::VideoDecodeAccelerator> |
| 58 GpuVideoDecodeAcceleratorFactory::CreateVDA( | 70 GpuVideoDecodeAcceleratorFactory::CreateVDA( |
| 59 media::VideoDecodeAccelerator::Client* client, | 71 media::VideoDecodeAccelerator::Client* client, |
| 60 const media::VideoDecodeAccelerator::Config& config) { | 72 const media::VideoDecodeAccelerator::Config& config) { |
| 61 if (!gvdafactory_impl_) | 73 if (!gvdafactory_impl_) |
| 62 return nullptr; | 74 return nullptr; |
| 63 | 75 |
| 64 const gpu::GpuPreferences gpu_preferences = | 76 const gpu::GpuPreferences gpu_preferences = |
| 65 GpuChildThread::current()->gpu_preferences(); | 77 GpuChildThread::current()->gpu_preferences(); |
| 66 return gvdafactory_impl_->CreateVDA(client, config, gpu_preferences); | 78 return gvdafactory_impl_->CreateVDA(client, config, gpu_preferences); |
| 67 } | 79 } |
| 68 | 80 |
| 69 GpuVideoDecodeAcceleratorFactory::GpuVideoDecodeAcceleratorFactory( | 81 GpuVideoDecodeAcceleratorFactory::GpuVideoDecodeAcceleratorFactory( |
| 70 std::unique_ptr<GpuVideoDecodeAcceleratorFactoryImpl> gvdafactory_impl) | 82 std::unique_ptr<GpuVideoDecodeAcceleratorFactoryImpl> gvdafactory_impl) |
| 71 : gvdafactory_impl_(std::move(gvdafactory_impl)) {} | 83 : gvdafactory_impl_(std::move(gvdafactory_impl)) {} |
| 72 | 84 |
| 73 } // namespace content | 85 } // namespace content |
| OLD | NEW |