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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/gpu/BUILD.gn ('k') | media/gpu/gles2_decoder_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/gpu/gles2_decoder_helper.h
diff --git a/media/gpu/gles2_decoder_helper.h b/media/gpu/gles2_decoder_helper.h
new file mode 100644
index 0000000000000000000000000000000000000000..60f8dfae805ea87104b58798aaca69c640584a57
--- /dev/null
+++ b/media/gpu/gles2_decoder_helper.h
@@ -0,0 +1,59 @@
+// Copyright 2017 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 MEDIA_GPU_GLES2_DECODER_HELPER_H_
+#define MEDIA_GPU_GLES2_DECODER_HELPER_H_
+
+#include <stdint.h>
+
+#include <memory>
+
+#include "base/memory/ref_counted.h"
+#include "base/optional.h"
+#include "media/gpu/media_gpu_export.h"
+#include "ui/gl/gl_bindings.h"
+
+namespace gpu {
+struct Mailbox;
+namespace gles2 {
+class GLES2Decoder;
+class TextureRef;
+} // namespace gles2
+} // namespace gpu
+
+namespace media {
+
+// Utility methods to simplify working with a gpu::gles2::GLES2Decoder from
+// inside VDAs.
+class MEDIA_GPU_EXPORT GLES2DecoderHelper {
+ public:
+ static std::unique_ptr<GLES2DecoderHelper> Create(
+ gpu::gles2::GLES2Decoder* decoder);
+
+ virtual ~GLES2DecoderHelper() {}
+
+ // TODO(sandersd): Provide scoped version?
+ virtual bool MakeContextCurrent() = 0;
+
+ // Creates a texture and configures it as a video frame (linear filtering,
+ // clamp to edge, no mipmaps). The context must be current.
+ //
+ // See glTexImage2D() for parameter definitions.
+ //
+ // Returns nullptr on failure, but there are currently no failure paths.
+ virtual scoped_refptr<gpu::gles2::TextureRef> CreateTexture(
+ GLenum target,
+ GLenum internal_format,
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ GLenum type) = 0;
+
+ // Creates a mailbox for a texture.
+ virtual gpu::Mailbox CreateMailbox(gpu::gles2::TextureRef* texture_ref) = 0;
+};
+
+} // namespace media
+
+#endif // MEDIA_GPU_GLES2_DECODER_HELPER_H_
« 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