Chromium Code Reviews| Index: content/public/common/gpu_video_decode_accelerator_helpers.h |
| diff --git a/content/public/common/gpu_video_decode_accelerator_helpers.h b/content/public/common/gpu_video_decode_accelerator_helpers.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c7d072f16bca2125a2aa2a56da224ff75c54b860 |
| --- /dev/null |
| +++ b/content/public/common/gpu_video_decode_accelerator_helpers.h |
| @@ -0,0 +1,50 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| +#ifndef CONTENT_PUBLIC_GPU_GPU_VIDEO_DECODE_ACCELERATOR_HELPERS_H_ |
| +#define CONTENT_PUBLIC_GPU_GPU_VIDEO_DECODE_ACCELERATOR_HELPERS_H_ |
| + |
| +#include "base/callback.h" |
| +#include "base/memory/weak_ptr.h" |
| + |
| +namespace gfx { |
| +class GLContext; |
| +} |
| + |
| +namespace gl { |
| +class GLImage; |
| +} |
| + |
| +namespace gpu { |
| +namespace gles2 { |
| +class GLES2Decoder; |
| +} |
| +} |
| + |
| +namespace content { |
| + |
| +// Helpers/defines for specific VideoDecodeAccelerator implementations in GPU |
| +// process. Which callbacks are required depends on the implementation. |
|
kcwu
2016/03/01 10:25:06
However, the client is still tightly coupled with
Pawel Osciak
2016/03/02 07:17:12
As per offline discussion, moved callback checks t
|
| +struct gpu_vda_helpers { |
|
kcwu
2016/03/01 10:25:06
Add comments that what threads can call these call
Pawel Osciak
2016/03/02 07:17:12
Great comment, thanks.
|
| + // Return current GLContext. |
| + using GetGLContextCb = base::Callback<gfx::GLContext*(void)>; |
| + |
| + // Make the applicable GL context current. To be called by VDAs before |
| + // executing any GL calls. Return true on success, false otherwise. |
| + using MakeGLContextCurrentCb = base::Callback<bool(void)>; |
| + |
| + // Bind |image| to |client_texture_id| given |texture_target|. |
| + // Return true on success, false otherwise. |
| + using BindGLImageCb = |
| + base::Callback<bool(uint32_t client_texture_id, |
| + uint32_t texture_target, |
| + const scoped_refptr<gl::GLImage>& image)>; |
| + |
| + // Return a WeakPtr to a GLES2Decoder, if one is available. |
| + using GetGLES2DecoderCb = |
| + base::Callback<base::WeakPtr<gpu::gles2::GLES2Decoder>(void)>; |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_PUBLIC_GPU_GPU_VIDEO_DECODE_ACCELERATOR_HELPERS_H_ |