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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2013 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_GLES2_EXTERNAL_TEXTURE_COPIER_H_
6 #define CONTENT_COMMON_GPU_MEDIA_GLES2_EXTERNAL_TEXTURE_COPIER_H_
7
8 #include "base/basictypes.h"
9
10 // XXX: apply the scheme for GL access. http://crbug.com/169433
11 #include "third_party/angle/include/GLES2/gl2.h"
12 #include "third_party/angle/include/GLES2/gl2ext.h"
13
14 namespace content {
15
16 // A utility class which copies the given external texture
17 // (GL_TEXTURE_EXTERNAL_OES) to the target texture (GL_TEXTURE_2D) by using
18 // framebuffer.
19 class Gles2ExternalTextureCopier {
20 public:
21 Gles2ExternalTextureCopier();
22 virtual ~Gles2ExternalTextureCopier();
23
24 bool Init(int32 width, int32 height);
25
26 bool Copy(GLuint source_texture_id, GLuint destination_texture_id,
27 const float transfrom_matrix[16]);
28
29 private:
30 bool SetupGraphics();
31 void RenderFrame(int32 width, int32 height, GLuint texture_id,
32 const float transfrom_matrix[16]);
33 bool SetupFrameBuffer();
34
35 bool initialized_;
36 int32 width_;
37 int32 height_;
38 GLuint framebuffer_id_;
39 GLuint renderbuffer_id_;
40 GLuint program_;
41 GLuint position_handle_;
42 GLuint st_matrix_handle_;
43 GLuint mvp_matrix_handle_;
44 GLuint texture_handle_;
45 GLfloat st_matrix_[16];
46
47 DISALLOW_COPY_AND_ASSIGN(Gles2ExternalTextureCopier);
48 };
49
50 } // namespace content
51
52 #endif // CONTENT_COMMON_GPU_MEDIA_GLES2_EXTERNAL_TEXTURE_COPIER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698