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 #ifndef CONTENT_PUBLIC_GPU_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_H_ | 5 #ifndef CONTENT_PUBLIC_GPU_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_H_ |
6 #define CONTENT_PUBLIC_GPU_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_H_ | 6 #define CONTENT_PUBLIC_GPU_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
13 #include "gpu/config/gpu_info.h" | 13 #include "gpu/config/gpu_info.h" |
14 #include "media/video/video_decode_accelerator.h" | 14 #include "media/video/video_decode_accelerator.h" |
15 | 15 |
16 namespace gfx { | 16 namespace gl { |
17 class GLContext; | 17 class GLContext; |
18 } | |
19 | |
20 namespace gl { | |
21 class GLImage; | 18 class GLImage; |
22 } | 19 } |
23 | 20 |
24 namespace gpu { | 21 namespace gpu { |
25 namespace gles2 { | 22 namespace gles2 { |
26 class GLES2Decoder; | 23 class GLES2Decoder; |
27 } | 24 } |
28 } | 25 } |
29 | 26 |
30 namespace media { | 27 namespace media { |
31 class GpuVideoDecodeAcceleratorFactoryImpl; | 28 class GpuVideoDecodeAcceleratorFactoryImpl; |
32 } | 29 } |
33 | 30 |
34 namespace content { | 31 namespace content { |
35 | 32 |
36 // This factory allows creation of VideoDecodeAccelerator implementations, | 33 // This factory allows creation of VideoDecodeAccelerator implementations, |
37 // providing the most applicable VDA for current platform and given | 34 // providing the most applicable VDA for current platform and given |
38 // configuration. To be used in GPU process only. | 35 // configuration. To be used in GPU process only. |
39 class CONTENT_EXPORT GpuVideoDecodeAcceleratorFactory { | 36 class CONTENT_EXPORT GpuVideoDecodeAcceleratorFactory { |
40 public: | 37 public: |
41 virtual ~GpuVideoDecodeAcceleratorFactory(); | 38 virtual ~GpuVideoDecodeAcceleratorFactory(); |
42 | 39 |
43 // Return current GLContext. | 40 // Return current GLContext. |
44 using GetGLContextCallback = base::Callback<gfx::GLContext*(void)>; | 41 using GetGLContextCallback = base::Callback<gl::GLContext*(void)>; |
45 | 42 |
46 // Make the applicable GL context current. To be called by VDAs before | 43 // Make the applicable GL context current. To be called by VDAs before |
47 // executing any GL calls. Return true on success, false otherwise. | 44 // executing any GL calls. Return true on success, false otherwise. |
48 using MakeGLContextCurrentCallback = base::Callback<bool(void)>; | 45 using MakeGLContextCurrentCallback = base::Callback<bool(void)>; |
49 | 46 |
50 // Bind |image| to |client_texture_id| given |texture_target|. If | 47 // Bind |image| to |client_texture_id| given |texture_target|. If |
51 // |can_bind_to_sampler| is true, then the image may be used as a sampler | 48 // |can_bind_to_sampler| is true, then the image may be used as a sampler |
52 // directly, otherwise a copy to a staging buffer is required. | 49 // directly, otherwise a copy to a staging buffer is required. |
53 // Return true on success, false otherwise. | 50 // Return true on success, false otherwise. |
54 using BindGLImageCallback = | 51 using BindGLImageCallback = |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 std::unique_ptr<media::GpuVideoDecodeAcceleratorFactoryImpl> | 95 std::unique_ptr<media::GpuVideoDecodeAcceleratorFactoryImpl> |
99 gvdafactory_impl); | 96 gvdafactory_impl); |
100 | 97 |
101 std::unique_ptr<media::GpuVideoDecodeAcceleratorFactoryImpl> | 98 std::unique_ptr<media::GpuVideoDecodeAcceleratorFactoryImpl> |
102 gvdafactory_impl_; | 99 gvdafactory_impl_; |
103 }; | 100 }; |
104 | 101 |
105 } // namespace content | 102 } // namespace content |
106 | 103 |
107 #endif // CONTENT_PUBLIC_GPU_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_H_ | 104 #endif // CONTENT_PUBLIC_GPU_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_H_ |
OLD | NEW |