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

Side by Side Diff: media/tools/player_x11/gles_video_renderer.h

Issue 2765005: revert cl 49121 since the way of using glEglImageTargetTexture2DOES is undefined and (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 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
« no previous file with comments | « no previous file | media/tools/player_x11/gles_video_renderer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_TOOLS_PLAYER_X11_GL_VIDEO_RENDERER_H_ 5 #ifndef MEDIA_TOOLS_PLAYER_X11_GL_VIDEO_RENDERER_H_
6 #define MEDIA_TOOLS_PLAYER_X11_GL_VIDEO_RENDERER_H_ 6 #define MEDIA_TOOLS_PLAYER_X11_GL_VIDEO_RENDERER_H_
7 7
8 #include <EGL/egl.h> 8 #include <EGL/egl.h>
9 #include <EGL/eglext.h> 9 #include <EGL/eglext.h>
10 #include <GLES2/gl2.h> 10 #include <GLES2/gl2.h>
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 // VideoRendererBase implementation. 47 // VideoRendererBase implementation.
48 virtual bool OnInitialize(media::VideoDecoder* decoder); 48 virtual bool OnInitialize(media::VideoDecoder* decoder);
49 virtual void OnStop(); 49 virtual void OnStop();
50 virtual void OnFrameAvailable(); 50 virtual void OnFrameAvailable();
51 51
52 private: 52 private:
53 // Only allow to be deleted by reference counting. 53 // Only allow to be deleted by reference counting.
54 friend class scoped_refptr<GlesVideoRenderer>; 54 friend class scoped_refptr<GlesVideoRenderer>;
55 virtual ~GlesVideoRenderer(); 55 virtual ~GlesVideoRenderer();
56 56
57 GLuint FindTexture(scoped_refptr<media::VideoFrame> video_frame);
57 bool InitializeGles(); 58 bool InitializeGles();
58 void CreateShader(GLuint program, GLenum type, 59 void CreateShader(GLuint program, GLenum type,
59 const char* vs_source, int vs_size); 60 const char* vs_source, int vs_size);
60 void LinkProgram(GLuint program); 61 void LinkProgram(GLuint program);
61 void CreateTextureAndProgramEgl(); 62 void CreateTextureAndProgramEgl();
62 void CreateTextureAndProgramYuv2Rgb(); 63 void CreateTextureAndProgramYuv2Rgb();
63 64
64 PFNEGLCREATEIMAGEKHRPROC egl_create_image_khr_; 65 PFNEGLCREATEIMAGEKHRPROC egl_create_image_khr_;
65 PFNEGLDESTROYIMAGEKHRPROC egl_destroy_image_khr_; 66 PFNEGLDESTROYIMAGEKHRPROC egl_destroy_image_khr_;
66 PFNGLEGLIMAGETARGETTEXTURE2DOESPROC gl_eglimage_target_texture2d_oes_;
67 67
68 int width_; 68 int width_;
69 int height_; 69 int height_;
70 bool uses_egl_image_; 70 bool uses_egl_image_;
71 71
72 Display* display_; 72 Display* display_;
73 Window window_; 73 Window window_;
74 74
75 // EGL context. 75 // EGL context.
76 EGLDisplay egl_display_; 76 EGLDisplay egl_display_;
77 EGLSurface egl_surface_; 77 EGLSurface egl_surface_;
78 EGLContext egl_context_; 78 EGLContext egl_context_;
79 79
80 // textures for EGL image 80 // textures for EGL image
81 typedef std::pair<scoped_refptr<media::VideoFrame>, GLuint> EglFrame; 81 typedef std::pair<scoped_refptr<media::VideoFrame>, GLuint> EglFrame;
82 std::vector<EglFrame> egl_frames_; 82 std::vector<EglFrame> egl_frames_;
83 83
84 // 3 textures, one for each plane. 84 // 3 textures, one for each plane.
85 GLuint textures_[3]; 85 GLuint textures_[3];
86 86
87 MessageLoop* glx_thread_message_loop_; 87 MessageLoop* glx_thread_message_loop_;
88 static GlesVideoRenderer* instance_; 88 static GlesVideoRenderer* instance_;
89 89
90 DISALLOW_COPY_AND_ASSIGN(GlesVideoRenderer); 90 DISALLOW_COPY_AND_ASSIGN(GlesVideoRenderer);
91 }; 91 };
92 92
93 #endif // MEDIA_TOOLS_PLAYER_X11_GLES_VIDEO_RENDERER_H_ 93 #endif // MEDIA_TOOLS_PLAYER_X11_GLES_VIDEO_RENDERER_H_
OLDNEW
« no previous file with comments | « no previous file | media/tools/player_x11/gles_video_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698