Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_PUBLIC_GPU_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_H_ | |
| 6 #define CONTENT_PUBLIC_GPU_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_H_ | |
| 7 | |
| 8 #include "base/memory/weak_ptr.h" | |
|
kcwu
2016/03/01 10:25:06
unused
Pawel Osciak
2016/03/02 07:17:11
Done.
| |
| 9 #include "base/threading/thread_checker.h" | |
| 10 #include "content/public/common/gpu_video_decode_accelerator_helpers.h" | |
| 11 #include "gpu/config/gpu_info.h" | |
| 12 #include "media/video/video_decode_accelerator.h" | |
| 13 | |
| 14 namespace content { | |
| 15 | |
| 16 // This factory allows creation of VideoDecodeAccelerator implementations, | |
| 17 // providing the most applicable VDA for current platform and given | |
| 18 // configuration. To be used in GPU process only. | |
| 19 class CONTENT_EXPORT GpuVideoDecodeAcceleratorFactory { | |
| 20 public: | |
| 21 ~GpuVideoDecodeAcceleratorFactory(); | |
| 22 | |
| 23 // Create a factory capable of producing VDA instances for current platform. | |
| 24 static scoped_ptr<GpuVideoDecodeAcceleratorFactory> Create( | |
| 25 const gpu_vda_helpers::GetGLContextCb& get_gl_context_cb, | |
| 26 const gpu_vda_helpers::MakeGLContextCurrentCb& make_context_current_cb, | |
| 27 const gpu_vda_helpers::BindGLImageCb& bind_image_cb); | |
| 28 | |
| 29 static scoped_ptr<GpuVideoDecodeAcceleratorFactory> CreateWithGLES2Decoder( | |
| 30 const gpu_vda_helpers::GetGLContextCb& get_gl_context_cb, | |
| 31 const gpu_vda_helpers::MakeGLContextCurrentCb& make_context_current_cb, | |
| 32 const gpu_vda_helpers::BindGLImageCb& bind_image_cb, | |
| 33 const gpu_vda_helpers::GetGLES2DecoderCb& get_gles2_decoder_cb); | |
| 34 | |
| 35 // Return decoder capabilities supported on the current platform. | |
| 36 static gpu::VideoDecodeAcceleratorCapabilities GetDecoderCapabilities(); | |
| 37 | |
| 38 // Create a VDA for the current platform for |client| with the given |config|. | |
| 39 // Return nullptr on failure. | |
| 40 scoped_ptr<media::VideoDecodeAccelerator> CreateVDA( | |
| 41 media::VideoDecodeAccelerator::Client* client, | |
| 42 const media::VideoDecodeAccelerator::Config& config); | |
| 43 | |
| 44 private: | |
| 45 GpuVideoDecodeAcceleratorFactory( | |
| 46 const gpu_vda_helpers::GetGLContextCb& get_gl_context_cb, | |
| 47 const gpu_vda_helpers::MakeGLContextCurrentCb& make_context_current_cb, | |
| 48 const gpu_vda_helpers::BindGLImageCb& bind_image_cb, | |
| 49 const gpu_vda_helpers::GetGLES2DecoderCb& get_gles2_decoder_cb); | |
| 50 | |
| 51 using CreateVDAFp = scoped_ptr<media::VideoDecodeAccelerator> ( | |
|
kcwu
2016/03/01 10:25:06
How about move this type into .cc file? This type
Pawel Osciak
2016/03/02 07:17:11
Done.
| |
| 52 GpuVideoDecodeAcceleratorFactory::*)(); | |
| 53 | |
| 54 scoped_ptr<media::VideoDecodeAccelerator> CreateDXVAVDA(); | |
| 55 scoped_ptr<media::VideoDecodeAccelerator> CreateV4L2VDA(); | |
| 56 scoped_ptr<media::VideoDecodeAccelerator> CreateV4L2SVDA(); | |
| 57 scoped_ptr<media::VideoDecodeAccelerator> CreateVaapiVDA(); | |
| 58 scoped_ptr<media::VideoDecodeAccelerator> CreateVTVDA(); | |
| 59 scoped_ptr<media::VideoDecodeAccelerator> CreateOzoneVDA(); | |
| 60 scoped_ptr<media::VideoDecodeAccelerator> CreateAndroidVDA(); | |
| 61 | |
| 62 const gpu_vda_helpers::GetGLContextCb get_gl_context_cb_; | |
| 63 const gpu_vda_helpers::MakeGLContextCurrentCb make_context_current_cb_; | |
| 64 const gpu_vda_helpers::BindGLImageCb bind_image_cb_; | |
| 65 const gpu_vda_helpers::GetGLES2DecoderCb& get_gles2_decoder_cb_; | |
| 66 | |
| 67 base::ThreadChecker thread_checker_; | |
| 68 | |
| 69 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAcceleratorFactory); | |
| 70 }; | |
| 71 | |
| 72 } // namespace content | |
| 73 | |
| 74 #endif // CONTENT_PUBLIC_GPU_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_H_ | |
| OLD | NEW |