Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(376)

Side by Side Diff: content/common/gpu/media/gpu_video_decode_accelerator_helpers.h

Issue 1839193003: Reland: Introduce GpuVideoDecodeAcceleratorFactory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_HELPERS_H_
6 #define CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_HELPERS_H_
7
8 #include "base/callback.h"
9 #include "base/memory/weak_ptr.h"
10
11 namespace gfx {
12 class GLContext;
13 }
14
15 namespace gl {
16 class GLImage;
17 }
18
19 namespace gpu {
20 namespace gles2 {
21 class GLES2Decoder;
22 }
23 }
24
25 namespace content {
26
27 // Helpers/defines for specific VideoDecodeAccelerator implementations in GPU
28 // process. Which callbacks are required depends on the implementation.
29 //
30 // Note that these callbacks may be called more than once, and so must own/share
31 // ownership of any objects bound to them.
32 //
33 // Unless specified otherwise, these callbacks must be executed on the GPU Child
34 // thread (i.e. the thread which the VDAs are initialized on).
35
36 // Return current GLContext.
37 using GetGLContextCallback = base::Callback<gfx::GLContext*(void)>;
38
39 // Make the applicable GL context current. To be called by VDAs before
40 // executing any GL calls. Return true on success, false otherwise.
41 using MakeGLContextCurrentCallback = base::Callback<bool(void)>;
42
43 // Bind |image| to |client_texture_id| given |texture_target|. If
44 // |can_bind_to_sampler| is true, then the image may be used as a sampler
45 // directly, otherwise a copy to a staging buffer is required.
46 // Return true on success, false otherwise.
47 using BindGLImageCallback =
48 base::Callback<bool(uint32_t client_texture_id,
49 uint32_t texture_target,
50 const scoped_refptr<gl::GLImage>& image,
51 bool can_bind_to_sampler)>;
52
53 // Return a WeakPtr to a GLES2Decoder, if one is available.
54 using GetGLES2DecoderCallback =
55 base::Callback<base::WeakPtr<gpu::gles2::GLES2Decoder>(void)>;
56
57 } // namespace content
58
59 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_HELPERS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698