OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "content/common/gpu/media/gpu_video_decode_accelerator_factory_impl.h" | |
6 #include "content/public/gpu/gpu_video_decode_accelerator_factory.h" | |
7 | |
8 namespace content { | |
9 | |
10 GpuVideoDecodeAcceleratorFactory::~GpuVideoDecodeAcceleratorFactory() {} | |
11 | |
12 // static | |
13 scoped_ptr<GpuVideoDecodeAcceleratorFactory> | |
14 GpuVideoDecodeAcceleratorFactory::Create( | |
15 const GetGLContextCallback& get_gl_context_cb, | |
16 const MakeGLContextCurrentCallback& make_context_current_cb, | |
17 const BindGLImageCallback& bind_image_cb) { | |
18 auto gvdafactory_impl = GpuVideoDecodeAcceleratorFactoryImpl::Create( | |
19 get_gl_context_cb, make_context_current_cb, bind_image_cb); | |
20 if (!gvdafactory_impl) | |
21 return nullptr; | |
22 | |
23 return make_scoped_ptr( | |
24 new GpuVideoDecodeAcceleratorFactory(std::move(gvdafactory_impl))); | |
25 } | |
26 | |
27 // static | |
28 scoped_ptr<GpuVideoDecodeAcceleratorFactory> | |
29 GpuVideoDecodeAcceleratorFactory::CreateWithGLES2Decoder( | |
30 const GetGLContextCallback& get_gl_context_cb, | |
31 const MakeGLContextCurrentCallback& make_context_current_cb, | |
32 const BindGLImageCallback& bind_image_cb, | |
33 const GetGLES2DecoderCallback& get_gles2_decoder_cb) { | |
34 auto gvdafactory_impl = | |
35 GpuVideoDecodeAcceleratorFactoryImpl::CreateWithGLES2Decoder( | |
36 get_gl_context_cb, make_context_current_cb, bind_image_cb, | |
37 get_gles2_decoder_cb); | |
38 if (!gvdafactory_impl) | |
39 return nullptr; | |
40 | |
41 return make_scoped_ptr( | |
42 new GpuVideoDecodeAcceleratorFactory(std::move(gvdafactory_impl))); | |
43 } | |
44 | |
45 // static | |
46 gpu::VideoDecodeAcceleratorCapabilities | |
47 GpuVideoDecodeAcceleratorFactory::GetDecoderCapabilities( | |
48 const gpu::GpuPreferences& gpu_preferences) { | |
49 return GpuVideoDecodeAcceleratorFactoryImpl::GetDecoderCapabilities( | |
50 gpu_preferences); | |
51 } | |
52 | |
53 scoped_ptr<media::VideoDecodeAccelerator> | |
54 GpuVideoDecodeAcceleratorFactory::CreateVDA( | |
55 media::VideoDecodeAccelerator::Client* client, | |
56 const media::VideoDecodeAccelerator::Config& config, | |
57 const gpu::GpuPreferences& gpu_preferences) { | |
58 if (!gvdafactory_impl_) | |
59 return nullptr; | |
60 | |
61 return gvdafactory_impl_->CreateVDA(client, config, gpu_preferences); | |
62 } | |
63 | |
64 GpuVideoDecodeAcceleratorFactory::GpuVideoDecodeAcceleratorFactory( | |
65 scoped_ptr<GpuVideoDecodeAcceleratorFactoryImpl> gvdafactory_impl) | |
66 : gvdafactory_impl_(std::move(gvdafactory_impl)) {} | |
67 | |
68 } // namespace content | |
OLD | NEW |