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" |
| 6 |
5 #include "content/common/gpu/media/gpu_video_decode_accelerator_factory_impl.h" | 7 #include "content/common/gpu/media/gpu_video_decode_accelerator_factory_impl.h" |
6 #include "content/public/gpu/gpu_video_decode_accelerator_factory.h" | 8 #include "content/gpu/gpu_child_thread.h" |
7 | 9 |
8 namespace content { | 10 namespace content { |
9 | 11 |
10 GpuVideoDecodeAcceleratorFactory::~GpuVideoDecodeAcceleratorFactory() {} | 12 GpuVideoDecodeAcceleratorFactory::~GpuVideoDecodeAcceleratorFactory() {} |
11 | 13 |
12 // static | 14 // static |
13 scoped_ptr<GpuVideoDecodeAcceleratorFactory> | 15 scoped_ptr<GpuVideoDecodeAcceleratorFactory> |
14 GpuVideoDecodeAcceleratorFactory::Create( | 16 GpuVideoDecodeAcceleratorFactory::Create( |
15 const GetGLContextCallback& get_gl_context_cb, | 17 const GetGLContextCallback& get_gl_context_cb, |
16 const MakeGLContextCurrentCallback& make_context_current_cb, | 18 const MakeGLContextCurrentCallback& make_context_current_cb, |
(...skipping 20 matching lines...) Expand all Loading... |
37 get_gles2_decoder_cb); | 39 get_gles2_decoder_cb); |
38 if (!gvdafactory_impl) | 40 if (!gvdafactory_impl) |
39 return nullptr; | 41 return nullptr; |
40 | 42 |
41 return make_scoped_ptr( | 43 return make_scoped_ptr( |
42 new GpuVideoDecodeAcceleratorFactory(std::move(gvdafactory_impl))); | 44 new GpuVideoDecodeAcceleratorFactory(std::move(gvdafactory_impl))); |
43 } | 45 } |
44 | 46 |
45 // static | 47 // static |
46 gpu::VideoDecodeAcceleratorCapabilities | 48 gpu::VideoDecodeAcceleratorCapabilities |
47 GpuVideoDecodeAcceleratorFactory::GetDecoderCapabilities( | 49 GpuVideoDecodeAcceleratorFactory::GetDecoderCapabilities() { |
48 const gpu::GpuPreferences& gpu_preferences) { | 50 const gpu::GpuPreferences gpu_preferences = |
| 51 GpuChildThread::current()->gpu_preferences(); |
49 return GpuVideoDecodeAcceleratorFactoryImpl::GetDecoderCapabilities( | 52 return GpuVideoDecodeAcceleratorFactoryImpl::GetDecoderCapabilities( |
50 gpu_preferences); | 53 gpu_preferences); |
51 } | 54 } |
52 | 55 |
53 scoped_ptr<media::VideoDecodeAccelerator> | 56 scoped_ptr<media::VideoDecodeAccelerator> |
54 GpuVideoDecodeAcceleratorFactory::CreateVDA( | 57 GpuVideoDecodeAcceleratorFactory::CreateVDA( |
55 media::VideoDecodeAccelerator::Client* client, | 58 media::VideoDecodeAccelerator::Client* client, |
56 const media::VideoDecodeAccelerator::Config& config, | 59 const media::VideoDecodeAccelerator::Config& config) { |
57 const gpu::GpuPreferences& gpu_preferences) { | |
58 if (!gvdafactory_impl_) | 60 if (!gvdafactory_impl_) |
59 return nullptr; | 61 return nullptr; |
60 | 62 |
| 63 const gpu::GpuPreferences gpu_preferences = |
| 64 GpuChildThread::current()->gpu_preferences(); |
61 return gvdafactory_impl_->CreateVDA(client, config, gpu_preferences); | 65 return gvdafactory_impl_->CreateVDA(client, config, gpu_preferences); |
62 } | 66 } |
63 | 67 |
64 GpuVideoDecodeAcceleratorFactory::GpuVideoDecodeAcceleratorFactory( | 68 GpuVideoDecodeAcceleratorFactory::GpuVideoDecodeAcceleratorFactory( |
65 scoped_ptr<GpuVideoDecodeAcceleratorFactoryImpl> gvdafactory_impl) | 69 scoped_ptr<GpuVideoDecodeAcceleratorFactoryImpl> gvdafactory_impl) |
66 : gvdafactory_impl_(std::move(gvdafactory_impl)) {} | 70 : gvdafactory_impl_(std::move(gvdafactory_impl)) {} |
67 | 71 |
68 } // namespace content | 72 } // namespace content |
OLD | NEW |