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 #ifndef CONTENT_PUBLIC_GPU_GPU_VIDEO_DECODE_ACCELERATOR_HELPERS_H_ | |
5 #define CONTENT_PUBLIC_GPU_GPU_VIDEO_DECODE_ACCELERATOR_HELPERS_H_ | |
6 | |
7 #include "base/callback.h" | |
8 #include "base/memory/weak_ptr.h" | |
9 | |
10 namespace gfx { | |
11 class GLContext; | |
12 } | |
13 | |
14 namespace gl { | |
15 class GLImage; | |
16 } | |
17 | |
18 namespace gpu { | |
19 namespace gles2 { | |
20 class GLES2Decoder; | |
21 } | |
22 } | |
23 | |
24 namespace content { | |
25 | |
26 // Helpers/defines for specific VideoDecodeAccelerator implementations in GPU | |
27 // 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
| |
28 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.
| |
29 // Return current GLContext. | |
30 using GetGLContextCb = base::Callback<gfx::GLContext*(void)>; | |
31 | |
32 // Make the applicable GL context current. To be called by VDAs before | |
33 // executing any GL calls. Return true on success, false otherwise. | |
34 using MakeGLContextCurrentCb = base::Callback<bool(void)>; | |
35 | |
36 // Bind |image| to |client_texture_id| given |texture_target|. | |
37 // Return true on success, false otherwise. | |
38 using BindGLImageCb = | |
39 base::Callback<bool(uint32_t client_texture_id, | |
40 uint32_t texture_target, | |
41 const scoped_refptr<gl::GLImage>& image)>; | |
42 | |
43 // Return a WeakPtr to a GLES2Decoder, if one is available. | |
44 using GetGLES2DecoderCb = | |
45 base::Callback<base::WeakPtr<gpu::gles2::GLES2Decoder>(void)>; | |
46 }; | |
47 | |
48 } // namespace content | |
49 | |
50 #endif // CONTENT_PUBLIC_GPU_GPU_VIDEO_DECODE_ACCELERATOR_HELPERS_H_ | |
OLD | NEW |