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

Unified Diff: content/common/gpu/media/gles2_external_texture_copier.h

Issue 11973010: AndroidVDA by using Android's MediaCodec API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: using flush() for reset(). Created 7 years, 10 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
Index: content/common/gpu/media/gles2_external_texture_copier.h
diff --git a/content/common/gpu/media/gles2_external_texture_copier.h b/content/common/gpu/media/gles2_external_texture_copier.h
new file mode 100644
index 0000000000000000000000000000000000000000..7108610783aca1bb787669307a9afb9b491f6214
--- /dev/null
+++ b/content/common/gpu/media/gles2_external_texture_copier.h
@@ -0,0 +1,50 @@
+// Copyright (c) 2013 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 CONTENT_COMMON_GPU_MEDIA_GLES2_EXTERNAL_TEXTURE_COPIER_H_
+#define CONTENT_COMMON_GPU_MEDIA_GLES2_EXTERNAL_TEXTURE_COPIER_H_
+
+#include "base/basictypes.h"
+#include "third_party/angle/include/GLES2/gl2.h"
+#include "third_party/angle/include/GLES2/gl2ext.h"
+
+namespace content {
+
+// A utility class which copies the given external texture
Ami GONE FROM CHROMIUM 2013/02/05 20:24:33 What happened to using the proper gl headers?
dwkang1 2013/02/07 14:01:36 I was not able to handle this today. Let me mark t
+// (GL_TEXTURE_EXTERNAL_OES) to the target texture (GL_TEXTURE_2D) by using
+// framebuffer.
+class Gles2ExternalTextureCopier {
+ public:
+ Gles2ExternalTextureCopier();
+ virtual ~Gles2ExternalTextureCopier();
+
+ bool Init(int32 width, int32 height);
+
+ bool Copy(GLuint source_texture_id, GLuint destination_texture_id,
+ const float transfrom_matrix[16]);
+
+ private:
+ bool SetupGraphics();
+ void RenderFrame(int32 width, int32 height, GLuint texture_id,
+ const float transfrom_matrix[16]);
+ bool SetupFrameBuffer();
+
+ bool initialized_;
+ int32 width_;
+ int32 height_;
+ GLuint framebuffer_id_;
+ GLuint renderbuffer_id_;
+ GLuint program_;
+ GLuint position_handle_;
+ GLuint st_matrix_handle_;
+ GLuint mvp_matrix_handle_;
+ GLuint texture_handle_;
+ GLfloat st_matrix_[16];
+
+ DISALLOW_COPY_AND_ASSIGN(Gles2ExternalTextureCopier);
+};
+
+} // namespace content
+
+#endif // CONTENT_COMMON_GPU_MEDIA_GLES2_EXTERNAL_TEXTURE_COPIER_H_

Powered by Google App Engine
This is Rietveld 408576698