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

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

Issue 596055: Implement GLES video renderer in player_x11 (Closed)
Patch Set: nits fixed Created 10 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
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // LICENSE file.
4 4
5 #ifndef MEDIA_TOOLS_PLAYER_X11_X11_VIDEO_RENDERER_H_ 5 #ifndef MEDIA_TOOLS_PLAYER_X11_X11_VIDEO_RENDERER_H_
6 #define MEDIA_TOOLS_PLAYER_X11_X11_VIDEO_RENDERER_H_ 6 #define MEDIA_TOOLS_PLAYER_X11_X11_VIDEO_RENDERER_H_
7 7
8 #include <GL/glew.h>
9 #include <GL/glxew.h>
10 #include <X11/Xlib.h> 8 #include <X11/Xlib.h>
11 9
12 #include "base/lock.h" 10 #include "base/lock.h"
13 #include "base/scoped_ptr.h" 11 #include "base/scoped_ptr.h"
14 #include "media/base/factory.h" 12 #include "media/base/factory.h"
15 #include "media/filters/video_renderer_base.h" 13 #include "media/filters/video_renderer_base.h"
16 14
17 class X11VideoRenderer : public media::VideoRendererBase { 15 class X11VideoRenderer : public media::VideoRendererBase {
18 public: 16 public:
19 static media::FilterFactory* CreateFactory(Display* display, 17 static media::FilterFactory* CreateFactory(Display* display,
20 Window window) { 18 Window window) {
21 return new media::FilterFactoryImpl2< 19 return new media::FilterFactoryImpl2<
22 X11VideoRenderer, Display*, Window>(display, window); 20 X11VideoRenderer, Display*, Window>(display, window);
23 } 21 }
24 22
25 X11VideoRenderer(Display* display, Window window); 23 X11VideoRenderer(Display* display, Window window);
26 24
27 // This method is called to paint the current video frame to the assigned 25 // This method is called to paint the current video frame to the assigned
28 // window. 26 // window.
29 void Paint(); 27 virtual void Paint();
scherkus (not reviewing) 2010/02/12 01:04:20 this no longers need to be virtual
30 28
31 // media::FilterFactoryImpl2 Implementation. 29 // media::FilterFactoryImpl2 Implementation.
32 static bool IsMediaFormatSupported(const media::MediaFormat& media_format); 30 static bool IsMediaFormatSupported(const media::MediaFormat& media_format);
33 31
34 // Returns the instance of this class.
35 static X11VideoRenderer* instance() { return instance_; } 32 static X11VideoRenderer* instance() { return instance_; }
36 33
37 protected: 34 protected:
38 // VideoRendererBase implementation. 35 // VideoRendererBase implementation.
39 virtual bool OnInitialize(media::VideoDecoder* decoder); 36 virtual bool OnInitialize(media::VideoDecoder* decoder);
40 virtual void OnStop(); 37 virtual void OnStop();
41 virtual void OnFrameAvailable(); 38 virtual void OnFrameAvailable();
42 39
43 private: 40 private:
44 // Only allow to be deleted by reference counting. 41 // Only allow to be deleted by reference counting.
(...skipping 12 matching lines...) Expand all
57 // Protects |new_frame_|. 54 // Protects |new_frame_|.
58 Lock lock_; 55 Lock lock_;
59 bool new_frame_; 56 bool new_frame_;
60 57
61 // Picture represents the paint target. This is a picture located 58 // Picture represents the paint target. This is a picture located
62 // in the server. 59 // in the server.
63 unsigned long picture_; 60 unsigned long picture_;
64 61
65 bool use_render_; 62 bool use_render_;
66 63
67 bool use_gl_;
68
69 // GL context.
70 GLXContext gl_context_;
71
72 // 3 textures, one for each plane.
73 GLuint textures_[3];
74
75 // Shaders and program for YUV->RGB conversion.
76 GLuint vertex_shader_;
77 GLuint fragment_shader_;
78 GLuint program_;
79
80 static X11VideoRenderer* instance_; 64 static X11VideoRenderer* instance_;
81 65
82 DISALLOW_COPY_AND_ASSIGN(X11VideoRenderer); 66 DISALLOW_COPY_AND_ASSIGN(X11VideoRenderer);
83 }; 67 };
84 68
85 #endif // MEDIA_TOOLS_PLAYER_X11_X11_VIDEO_RENDERER_H_ 69 #endif // MEDIA_TOOLS_PLAYER_X11_X11_VIDEO_RENDERER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698