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

Side by Side Diff: media/gpu/command_buffer_helper.h

Issue 2938543005: media: Add GLES2DecoderHelper (Closed)
Patch Set: Created 3 years, 6 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 2017 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 MEDIA_GPU_COMMAND_BUFFER_HELPER_H_
6 #define MEDIA_GPU_COMMAND_BUFFER_HELPER_H_
7
8 #include <stdint.h>
9
10 #include <memory>
11
12 #include "base/memory/ref_counted.h"
13 #include "base/optional.h"
14 #include "media/gpu/media_gpu_export.h"
15 #include "ui/gl/gl_bindings.h"
16
17 namespace gpu {
18 class GpuCommandBufferStub;
19 struct Mailbox;
20 struct SyncToken;
21 namespace gles2 {
22 class TextureRef;
23 } // namespace gles2
24 } // namespace gpu
25
26 namespace media {
27
28 // Utility methods to simplify working with a gpu::GpuCommandBufferStub from
29 // inside VDAs.
30 class MEDIA_GPU_EXPORT CommandBufferHelper {
31 public:
32 static std::unique_ptr<CommandBufferHelper> Create(
33 gpu::GpuCommandBufferStub* stub);
34
35 virtual ~CommandBufferHelper() {}
36
37 // TODO(sandersd): Provide scoped version?
38 virtual bool MakeContextCurrent() = 0;
39
40 // Creates a texture and configures it as a video frame (linear filtering,
41 // clamp to edge, no mipmaps). The context must be current.
42 //
43 // See glTexImage2D() for parameter definitions.
44 //
45 // Returns nullptr on failure.
46 virtual scoped_refptr<gpu::gles2::TextureRef> CreateTexture(
47 GLenum target,
48 GLenum internal_format,
49 GLsizei width,
50 GLsizei height,
51 GLenum format,
52 GLenum type) = 0;
53
54 // Creates a sync token that has already been released.
55 virtual base::Optional<gpu::SyncToken> CreateSyncToken() = 0;
56
57 // Creates a malbox for a texture.
watk 2017/06/14 00:01:38 mailbox
sandersd (OOO until July 31) 2017/06/16 22:31:38 Done.
58 virtual base::Optional<gpu::Mailbox> CreateMailbox(
59 gpu::gles2::TextureRef* texture_ref) = 0;
60 };
61
62 } // namespace media
63
64 #endif // MEDIA_GPU_COMMAND_BUFFER_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698