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

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

Issue 2938543005: media: Add GLES2DecoderHelper (Closed)
Patch Set: Don't check for guaranteed non-nulls. Created 3 years, 5 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
« no previous file with comments | « media/gpu/BUILD.gn ('k') | media/gpu/gles2_decoder_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_GLES2_DECODER_HELPER_H_
6 #define MEDIA_GPU_GLES2_DECODER_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 struct Mailbox;
19 namespace gles2 {
20 class GLES2Decoder;
21 class TextureRef;
22 } // namespace gles2
23 } // namespace gpu
24
25 namespace media {
26
27 // Utility methods to simplify working with a gpu::gles2::GLES2Decoder from
28 // inside VDAs.
29 class MEDIA_GPU_EXPORT GLES2DecoderHelper {
30 public:
31 static std::unique_ptr<GLES2DecoderHelper> Create(
32 gpu::gles2::GLES2Decoder* decoder);
33
34 virtual ~GLES2DecoderHelper() {}
35
36 // TODO(sandersd): Provide scoped version?
37 virtual bool MakeContextCurrent() = 0;
38
39 // Creates a texture and configures it as a video frame (linear filtering,
40 // clamp to edge, no mipmaps). The context must be current.
41 //
42 // See glTexImage2D() for parameter definitions.
43 //
44 // Returns nullptr on failure, but there are currently no failure paths.
45 virtual scoped_refptr<gpu::gles2::TextureRef> CreateTexture(
46 GLenum target,
47 GLenum internal_format,
48 GLsizei width,
49 GLsizei height,
50 GLenum format,
51 GLenum type) = 0;
52
53 // Creates a mailbox for a texture.
54 virtual gpu::Mailbox CreateMailbox(gpu::gles2::TextureRef* texture_ref) = 0;
55 };
56
57 } // namespace media
58
59 #endif // MEDIA_GPU_GLES2_DECODER_HELPER_H_
OLDNEW
« no previous file with comments | « media/gpu/BUILD.gn ('k') | media/gpu/gles2_decoder_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698