| 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 gfx { |
| 17 class GLContext; | 17 class GLContext; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace gl { | 20 namespace gl { |
| 21 class GLImage; | 21 class GLImage; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace gpu { | 24 namespace gpu { |
| 25 namespace gles2 { | 25 namespace gles2 { |
| 26 class GLES2Decoder; | 26 class GLES2Decoder; |
| 27 } | 27 } |
| 28 } | 28 } |
| 29 | 29 |
| 30 namespace media { |
| 31 class GpuVideoDecodeAcceleratorFactoryImpl; |
| 32 } |
| 33 |
| 30 namespace content { | 34 namespace content { |
| 31 | 35 |
| 32 class GpuVideoDecodeAcceleratorFactoryImpl; | |
| 33 | |
| 34 // This factory allows creation of VideoDecodeAccelerator implementations, | 36 // This factory allows creation of VideoDecodeAccelerator implementations, |
| 35 // providing the most applicable VDA for current platform and given | 37 // providing the most applicable VDA for current platform and given |
| 36 // configuration. To be used in GPU process only. | 38 // configuration. To be used in GPU process only. |
| 37 class CONTENT_EXPORT GpuVideoDecodeAcceleratorFactory { | 39 class CONTENT_EXPORT GpuVideoDecodeAcceleratorFactory { |
| 38 public: | 40 public: |
| 39 virtual ~GpuVideoDecodeAcceleratorFactory(); | 41 virtual ~GpuVideoDecodeAcceleratorFactory(); |
| 40 | 42 |
| 41 // Return current GLContext. | 43 // Return current GLContext. |
| 42 using GetGLContextCallback = base::Callback<gfx::GLContext*(void)>; | 44 using GetGLContextCallback = base::Callback<gfx::GLContext*(void)>; |
| 43 | 45 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 static gpu::VideoDecodeAcceleratorCapabilities GetDecoderCapabilities(); | 85 static gpu::VideoDecodeAcceleratorCapabilities GetDecoderCapabilities(); |
| 84 | 86 |
| 85 // Create a VDA for the current platform for |client| with the given |config| | 87 // Create a VDA for the current platform for |client| with the given |config| |
| 86 // and for given |gpu_preferences|. Return nullptr on failure. | 88 // and for given |gpu_preferences|. Return nullptr on failure. |
| 87 virtual std::unique_ptr<media::VideoDecodeAccelerator> CreateVDA( | 89 virtual std::unique_ptr<media::VideoDecodeAccelerator> CreateVDA( |
| 88 media::VideoDecodeAccelerator::Client* client, | 90 media::VideoDecodeAccelerator::Client* client, |
| 89 const media::VideoDecodeAccelerator::Config& config); | 91 const media::VideoDecodeAccelerator::Config& config); |
| 90 | 92 |
| 91 private: | 93 private: |
| 92 // TODO(posciak): This is temporary and will not be needed once | 94 // TODO(posciak): This is temporary and will not be needed once |
| 93 // GpuVideoDecodeAcceleratorFactoryImpl implements | 95 // media::GpuVideoDecodeAcceleratorFactoryImpl implements |
| 94 // GpuVideoDecodeAcceleratorFactory, see crbug.com/597150 and related. | 96 // GpuVideoDecodeAcceleratorFactory, see crbug.com/597150 and related. |
| 95 GpuVideoDecodeAcceleratorFactory( | 97 GpuVideoDecodeAcceleratorFactory( |
| 96 std::unique_ptr<GpuVideoDecodeAcceleratorFactoryImpl> gvdafactory_impl); | 98 std::unique_ptr<media::GpuVideoDecodeAcceleratorFactoryImpl> |
| 99 gvdafactory_impl); |
| 97 | 100 |
| 98 std::unique_ptr<GpuVideoDecodeAcceleratorFactoryImpl> gvdafactory_impl_; | 101 std::unique_ptr<media::GpuVideoDecodeAcceleratorFactoryImpl> |
| 102 gvdafactory_impl_; |
| 99 }; | 103 }; |
| 100 | 104 |
| 101 } // namespace content | 105 } // namespace content |
| 102 | 106 |
| 103 #endif // CONTENT_PUBLIC_GPU_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_H_ | 107 #endif // CONTENT_PUBLIC_GPU_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_H_ |
| OLD | NEW |