| 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 MEDIA_GPU_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_IMPL_H_ | 5 #ifndef MEDIA_GPU_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_IMPL_H_ |
| 6 #define MEDIA_GPU_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_IMPL_H_ | 6 #define MEDIA_GPU_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/threading/thread_checker.h" | 11 #include "base/threading/thread_checker.h" |
| 12 #include "gpu/command_buffer/service/gpu_preferences.h" | 12 #include "gpu/command_buffer/service/gpu_preferences.h" |
| 13 #include "gpu/config/gpu_info.h" | 13 #include "gpu/config/gpu_info.h" |
| 14 #include "media/gpu/media_gpu_export.h" | 14 #include "media/gpu/media_gpu_export.h" |
| 15 #include "media/video/video_decode_accelerator.h" | 15 #include "media/video/video_decode_accelerator.h" |
| 16 | 16 |
| 17 namespace gfx { | 17 namespace gl { |
| 18 class GLContext; | 18 class GLContext; |
| 19 } | |
| 20 | |
| 21 namespace gl { | |
| 22 class GLImage; | 19 class GLImage; |
| 23 } | 20 } |
| 24 | 21 |
| 25 namespace gpu { | 22 namespace gpu { |
| 26 struct GpuPreferences; | 23 struct GpuPreferences; |
| 27 | 24 |
| 28 namespace gles2 { | 25 namespace gles2 { |
| 29 class GLES2Decoder; | 26 class GLES2Decoder; |
| 30 } | 27 } |
| 31 } | 28 } |
| 32 | 29 |
| 33 namespace media { | 30 namespace media { |
| 34 | 31 |
| 35 // TODO(posciak): this class should be an implementation of | 32 // TODO(posciak): this class should be an implementation of |
| 36 // content::GpuVideoDecodeAcceleratorFactory, however that can only be achieved | 33 // content::GpuVideoDecodeAcceleratorFactory, however that can only be achieved |
| 37 // once this is moved out of content/common, see crbug.com/597150 and related. | 34 // once this is moved out of content/common, see crbug.com/597150 and related. |
| 38 class MEDIA_GPU_EXPORT GpuVideoDecodeAcceleratorFactoryImpl { | 35 class MEDIA_GPU_EXPORT GpuVideoDecodeAcceleratorFactoryImpl { |
| 39 public: | 36 public: |
| 40 ~GpuVideoDecodeAcceleratorFactoryImpl(); | 37 ~GpuVideoDecodeAcceleratorFactoryImpl(); |
| 41 | 38 |
| 42 // Return current GLContext. | 39 // Return current GLContext. |
| 43 using GetGLContextCallback = base::Callback<gfx::GLContext*(void)>; | 40 using GetGLContextCallback = base::Callback<gl::GLContext*(void)>; |
| 44 | 41 |
| 45 // Make the applicable GL context current. To be called by VDAs before | 42 // Make the applicable GL context current. To be called by VDAs before |
| 46 // executing any GL calls. Return true on success, false otherwise. | 43 // executing any GL calls. Return true on success, false otherwise. |
| 47 using MakeGLContextCurrentCallback = base::Callback<bool(void)>; | 44 using MakeGLContextCurrentCallback = base::Callback<bool(void)>; |
| 48 | 45 |
| 49 // Bind |image| to |client_texture_id| given |texture_target|. If | 46 // Bind |image| to |client_texture_id| given |texture_target|. If |
| 50 // |can_bind_to_sampler| is true, then the image may be used as a sampler | 47 // |can_bind_to_sampler| is true, then the image may be used as a sampler |
| 51 // directly, otherwise a copy to a staging buffer is required. | 48 // directly, otherwise a copy to a staging buffer is required. |
| 52 // Return true on success, false otherwise. | 49 // Return true on success, false otherwise. |
| 53 using BindGLImageCallback = | 50 using BindGLImageCallback = |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 const GetGLES2DecoderCallback get_gles2_decoder_cb_; | 115 const GetGLES2DecoderCallback get_gles2_decoder_cb_; |
| 119 | 116 |
| 120 base::ThreadChecker thread_checker_; | 117 base::ThreadChecker thread_checker_; |
| 121 | 118 |
| 122 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAcceleratorFactoryImpl); | 119 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAcceleratorFactoryImpl); |
| 123 }; | 120 }; |
| 124 | 121 |
| 125 } // namespace media | 122 } // namespace media |
| 126 | 123 |
| 127 #endif // MEDIA_GPU_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_IMPL_H_ | 124 #endif // MEDIA_GPU_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_IMPL_H_ |
| OLD | NEW |