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 "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 const MakeGLContextCurrentCallback& make_context_current_cb, | 63 const MakeGLContextCurrentCallback& make_context_current_cb, |
64 const BindGLImageCallback& bind_image_cb); | 64 const BindGLImageCallback& bind_image_cb); |
65 | 65 |
66 static std::unique_ptr<GpuVideoDecodeAcceleratorFactory> | 66 static std::unique_ptr<GpuVideoDecodeAcceleratorFactory> |
67 CreateWithGLES2Decoder( | 67 CreateWithGLES2Decoder( |
68 const GetGLContextCallback& get_gl_context_cb, | 68 const GetGLContextCallback& get_gl_context_cb, |
69 const MakeGLContextCurrentCallback& make_context_current_cb, | 69 const MakeGLContextCurrentCallback& make_context_current_cb, |
70 const BindGLImageCallback& bind_image_cb, | 70 const BindGLImageCallback& bind_image_cb, |
71 const GetGLES2DecoderCallback& get_gles2_decoder_cb); | 71 const GetGLES2DecoderCallback& get_gles2_decoder_cb); |
72 | 72 |
| 73 // Create a factory capable of producing VDA instances for current platform |
| 74 // with no GL support. |
| 75 // A factory created with this method will only be able to produce VDAs with |
| 76 // no ability to call GL functions/access GL state. This also implies no |
| 77 // ability to decode into textures provided by the client. |
| 78 static std::unique_ptr<GpuVideoDecodeAcceleratorFactory> CreateWithNoGL(); |
| 79 |
73 // Return decoder capabilities supported on the current platform. | 80 // Return decoder capabilities supported on the current platform. |
74 static gpu::VideoDecodeAcceleratorCapabilities GetDecoderCapabilities(); | 81 static gpu::VideoDecodeAcceleratorCapabilities GetDecoderCapabilities(); |
75 | 82 |
76 // Create a VDA for the current platform for |client| with the given |config| | 83 // Create a VDA for the current platform for |client| with the given |config| |
77 // and for given |gpu_preferences|. Return nullptr on failure. | 84 // and for given |gpu_preferences|. Return nullptr on failure. |
78 virtual std::unique_ptr<media::VideoDecodeAccelerator> CreateVDA( | 85 virtual std::unique_ptr<media::VideoDecodeAccelerator> CreateVDA( |
79 media::VideoDecodeAccelerator::Client* client, | 86 media::VideoDecodeAccelerator::Client* client, |
80 const media::VideoDecodeAccelerator::Config& config); | 87 const media::VideoDecodeAccelerator::Config& config); |
81 | 88 |
82 private: | 89 private: |
83 // TODO(posciak): This is temporary and will not be needed once | 90 // TODO(posciak): This is temporary and will not be needed once |
84 // GpuVideoDecodeAcceleratorFactoryImpl implements | 91 // GpuVideoDecodeAcceleratorFactoryImpl implements |
85 // GpuVideoDecodeAcceleratorFactory, see crbug.com/597150 and related. | 92 // GpuVideoDecodeAcceleratorFactory, see crbug.com/597150 and related. |
86 GpuVideoDecodeAcceleratorFactory( | 93 GpuVideoDecodeAcceleratorFactory( |
87 std::unique_ptr<GpuVideoDecodeAcceleratorFactoryImpl> gvdafactory_impl); | 94 std::unique_ptr<GpuVideoDecodeAcceleratorFactoryImpl> gvdafactory_impl); |
88 | 95 |
89 std::unique_ptr<GpuVideoDecodeAcceleratorFactoryImpl> gvdafactory_impl_; | 96 std::unique_ptr<GpuVideoDecodeAcceleratorFactoryImpl> gvdafactory_impl_; |
90 }; | 97 }; |
91 | 98 |
92 } // namespace content | 99 } // namespace content |
93 | 100 |
94 #endif // CONTENT_PUBLIC_GPU_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_H_ | 101 #endif // CONTENT_PUBLIC_GPU_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_H_ |
OLD | NEW |