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_COMMON_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_H_ | |
| 6 #define CONTENT_PUBLIC_COMMON_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_H_ | |
| 7 | |
| 8 #include "base/threading/thread_checker.h" | |
| 9 #include "content/common/content_export.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. | |
|
jam
2016/03/14 15:58:29
then this should be in content/public/gpu
| |
| 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::GetGLContextCallback& get_gl_context_cb, | |
| 26 const gpu_vda::MakeGLContextCurrentCallback& make_context_current_cb, | |
| 27 const gpu_vda::BindGLImageCallback& bind_image_cb); | |
| 28 | |
| 29 static scoped_ptr<GpuVideoDecodeAcceleratorFactory> CreateWithGLES2Decoder( | |
| 30 const gpu_vda::GetGLContextCallback& get_gl_context_cb, | |
| 31 const gpu_vda::MakeGLContextCurrentCallback& make_context_current_cb, | |
| 32 const gpu_vda::BindGLImageCallback& bind_image_cb, | |
| 33 const gpu_vda::GetGLES2DecoderCallback& 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( | |
|
jam
2016/03/14 15:58:29
this section in private is against the content api
jam
2016/03/16 20:56:43
this comment is still not addressed.
why is there
Pawel Osciak
2016/03/17 11:15:16
Sorry somehow missed this. Created a GpuVideoDecod
jam
2016/03/17 15:43:26
I'm not sure I understand the point of having both
jam
2016/03/18 01:18:56
ignore this comment, and thanks for the explanatio
| |
| 46 const gpu_vda::GetGLContextCallback& get_gl_context_cb, | |
| 47 const gpu_vda::MakeGLContextCurrentCallback& make_context_current_cb, | |
| 48 const gpu_vda::BindGLImageCallback& bind_image_cb, | |
| 49 const gpu_vda::GetGLES2DecoderCallback& get_gles2_decoder_cb); | |
| 50 | |
| 51 scoped_ptr<media::VideoDecodeAccelerator> CreateDXVAVDA() const; | |
| 52 scoped_ptr<media::VideoDecodeAccelerator> CreateV4L2VDA() const; | |
| 53 scoped_ptr<media::VideoDecodeAccelerator> CreateV4L2SVDA() const; | |
| 54 scoped_ptr<media::VideoDecodeAccelerator> CreateVaapiVDA() const; | |
| 55 scoped_ptr<media::VideoDecodeAccelerator> CreateVTVDA() const; | |
| 56 scoped_ptr<media::VideoDecodeAccelerator> CreateOzoneVDA() const; | |
| 57 scoped_ptr<media::VideoDecodeAccelerator> CreateAndroidVDA() const; | |
| 58 | |
| 59 const gpu_vda::GetGLContextCallback get_gl_context_cb_; | |
| 60 const gpu_vda::MakeGLContextCurrentCallback make_context_current_cb_; | |
| 61 const gpu_vda::BindGLImageCallback bind_image_cb_; | |
| 62 const gpu_vda::GetGLES2DecoderCallback& get_gles2_decoder_cb_; | |
| 63 | |
| 64 base::ThreadChecker thread_checker_; | |
| 65 | |
| 66 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAcceleratorFactory); | |
| 67 }; | |
| 68 | |
| 69 } // namespace content | |
| 70 | |
| 71 #endif // CONTENT_PUBLIC_COMMON_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_H_ | |
| OLD | NEW |