| 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_H_ | 5 #ifndef MEDIA_GPU_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_H_ |
| 6 #define MEDIA_GPU_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_H_ | 6 #define MEDIA_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/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_driver_bug_workarounds.h" | 13 #include "gpu/config/gpu_driver_bug_workarounds.h" |
| 14 #include "gpu/config/gpu_info.h" | 14 #include "gpu/config/gpu_info.h" |
| 15 #include "media/base/android_overlay_mojo_factory.h" |
| 15 #include "media/gpu/media_gpu_export.h" | 16 #include "media/gpu/media_gpu_export.h" |
| 16 #include "media/video/video_decode_accelerator.h" | 17 #include "media/video/video_decode_accelerator.h" |
| 17 | 18 |
| 18 namespace gl { | 19 namespace gl { |
| 19 class GLContext; | 20 class GLContext; |
| 20 class GLImage; | 21 class GLImage; |
| 21 } | 22 } |
| 22 | 23 |
| 23 namespace gpu { | 24 namespace gpu { |
| 24 struct GpuPreferences; | 25 struct GpuPreferences; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 static std::unique_ptr<GpuVideoDecodeAcceleratorFactory> Create( | 59 static std::unique_ptr<GpuVideoDecodeAcceleratorFactory> Create( |
| 59 const GetGLContextCallback& get_gl_context_cb, | 60 const GetGLContextCallback& get_gl_context_cb, |
| 60 const MakeGLContextCurrentCallback& make_context_current_cb, | 61 const MakeGLContextCurrentCallback& make_context_current_cb, |
| 61 const BindGLImageCallback& bind_image_cb); | 62 const BindGLImageCallback& bind_image_cb); |
| 62 | 63 |
| 63 static std::unique_ptr<GpuVideoDecodeAcceleratorFactory> | 64 static std::unique_ptr<GpuVideoDecodeAcceleratorFactory> |
| 64 CreateWithGLES2Decoder( | 65 CreateWithGLES2Decoder( |
| 65 const GetGLContextCallback& get_gl_context_cb, | 66 const GetGLContextCallback& get_gl_context_cb, |
| 66 const MakeGLContextCurrentCallback& make_context_current_cb, | 67 const MakeGLContextCurrentCallback& make_context_current_cb, |
| 67 const BindGLImageCallback& bind_image_cb, | 68 const BindGLImageCallback& bind_image_cb, |
| 68 const GetGLES2DecoderCallback& get_gles2_decoder_cb); | 69 const GetGLES2DecoderCallback& get_gles2_decoder_cb, |
| 70 const AndroidOverlayMojoFactoryCB& overlay_factory_cb); |
| 69 | 71 |
| 70 static std::unique_ptr<GpuVideoDecodeAcceleratorFactory> CreateWithNoGL(); | 72 static std::unique_ptr<GpuVideoDecodeAcceleratorFactory> CreateWithNoGL(); |
| 71 | 73 |
| 72 static gpu::VideoDecodeAcceleratorCapabilities GetDecoderCapabilities( | 74 static gpu::VideoDecodeAcceleratorCapabilities GetDecoderCapabilities( |
| 73 const gpu::GpuPreferences& gpu_preferences, | 75 const gpu::GpuPreferences& gpu_preferences, |
| 74 const gpu::GpuDriverBugWorkarounds& workarounds); | 76 const gpu::GpuDriverBugWorkarounds& workarounds); |
| 75 | 77 |
| 76 std::unique_ptr<VideoDecodeAccelerator> CreateVDA( | 78 std::unique_ptr<VideoDecodeAccelerator> CreateVDA( |
| 77 VideoDecodeAccelerator::Client* client, | 79 VideoDecodeAccelerator::Client* client, |
| 78 const VideoDecodeAccelerator::Config& config, | 80 const VideoDecodeAccelerator::Config& config, |
| 79 const gpu::GpuDriverBugWorkarounds& workarounds, | 81 const gpu::GpuDriverBugWorkarounds& workarounds, |
| 80 const gpu::GpuPreferences& gpu_preferences); | 82 const gpu::GpuPreferences& gpu_preferences); |
| 81 | 83 |
| 82 private: | 84 private: |
| 83 GpuVideoDecodeAcceleratorFactory( | 85 GpuVideoDecodeAcceleratorFactory( |
| 84 const GetGLContextCallback& get_gl_context_cb, | 86 const GetGLContextCallback& get_gl_context_cb, |
| 85 const MakeGLContextCurrentCallback& make_context_current_cb, | 87 const MakeGLContextCurrentCallback& make_context_current_cb, |
| 86 const BindGLImageCallback& bind_image_cb, | 88 const BindGLImageCallback& bind_image_cb, |
| 87 const GetGLES2DecoderCallback& get_gles2_decoder_cb); | 89 const GetGLES2DecoderCallback& get_gles2_decoder_cb, |
| 90 const AndroidOverlayMojoFactoryCB& overlay_factory_cb); |
| 88 | 91 |
| 89 #if defined(OS_WIN) | 92 #if defined(OS_WIN) |
| 90 std::unique_ptr<VideoDecodeAccelerator> CreateD3D11VDA( | 93 std::unique_ptr<VideoDecodeAccelerator> CreateD3D11VDA( |
| 91 const gpu::GpuDriverBugWorkarounds& workarounds, | 94 const gpu::GpuDriverBugWorkarounds& workarounds, |
| 92 const gpu::GpuPreferences& gpu_preferences) const; | 95 const gpu::GpuPreferences& gpu_preferences) const; |
| 93 std::unique_ptr<VideoDecodeAccelerator> CreateDXVAVDA( | 96 std::unique_ptr<VideoDecodeAccelerator> CreateDXVAVDA( |
| 94 const gpu::GpuDriverBugWorkarounds& workarounds, | 97 const gpu::GpuDriverBugWorkarounds& workarounds, |
| 95 const gpu::GpuPreferences& gpu_preferences) const; | 98 const gpu::GpuPreferences& gpu_preferences) const; |
| 96 #endif | 99 #endif |
| 97 #if defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC) | 100 #if defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC) |
| (...skipping 17 matching lines...) Expand all Loading... |
| 115 #if defined(OS_ANDROID) | 118 #if defined(OS_ANDROID) |
| 116 std::unique_ptr<VideoDecodeAccelerator> CreateAndroidVDA( | 119 std::unique_ptr<VideoDecodeAccelerator> CreateAndroidVDA( |
| 117 const gpu::GpuDriverBugWorkarounds& workarounds, | 120 const gpu::GpuDriverBugWorkarounds& workarounds, |
| 118 const gpu::GpuPreferences& gpu_preferences) const; | 121 const gpu::GpuPreferences& gpu_preferences) const; |
| 119 #endif | 122 #endif |
| 120 | 123 |
| 121 const GetGLContextCallback get_gl_context_cb_; | 124 const GetGLContextCallback get_gl_context_cb_; |
| 122 const MakeGLContextCurrentCallback make_context_current_cb_; | 125 const MakeGLContextCurrentCallback make_context_current_cb_; |
| 123 const BindGLImageCallback bind_image_cb_; | 126 const BindGLImageCallback bind_image_cb_; |
| 124 const GetGLES2DecoderCallback get_gles2_decoder_cb_; | 127 const GetGLES2DecoderCallback get_gles2_decoder_cb_; |
| 128 const AndroidOverlayMojoFactoryCB overlay_factory_cb_; |
| 125 | 129 |
| 126 base::ThreadChecker thread_checker_; | 130 base::ThreadChecker thread_checker_; |
| 127 | 131 |
| 128 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAcceleratorFactory); | 132 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAcceleratorFactory); |
| 129 }; | 133 }; |
| 130 | 134 |
| 131 } // namespace media | 135 } // namespace media |
| 132 | 136 |
| 133 #endif // MEDIA_GPU_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_H_ | 137 #endif // MEDIA_GPU_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_H_ |
| OLD | NEW |