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

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

Issue 2724005: player_x11 : change X/GL thread to message loop for injecting task (Closed)
Patch Set: fixing nits 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
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_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 <X11/Xlib.h> 8 #include <X11/Xlib.h>
9 9
10 #include "base/lock.h" 10 #include "base/lock.h"
(...skipping 13 matching lines...) Expand all
24 24
25 // 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
26 // window. 26 // window.
27 void Paint(); 27 void Paint();
28 28
29 // media::FilterFactoryImpl2 Implementation. 29 // media::FilterFactoryImpl2 Implementation.
30 static bool IsMediaFormatSupported(const media::MediaFormat& media_format); 30 static bool IsMediaFormatSupported(const media::MediaFormat& media_format);
31 31
32 static X11VideoRenderer* instance() { return instance_; } 32 static X11VideoRenderer* instance() { return instance_; }
33 33
34 void set_glx_thread_message_loop(MessageLoop* message_loop) {
35 glx_thread_message_loop_ = message_loop;
36 }
37
38 MessageLoop* glx_thread_message_loop() {
39 return glx_thread_message_loop_;
40 }
41
34 protected: 42 protected:
35 // VideoRendererBase implementation. 43 // VideoRendererBase implementation.
36 virtual bool OnInitialize(media::VideoDecoder* decoder); 44 virtual bool OnInitialize(media::VideoDecoder* decoder);
37 virtual void OnStop(); 45 virtual void OnStop();
38 virtual void OnFrameAvailable(); 46 virtual void OnFrameAvailable();
39 47
40 private: 48 private:
41 // Only allow to be deleted by reference counting. 49 // Only allow to be deleted by reference counting.
42 friend class scoped_refptr<X11VideoRenderer>; 50 friend class scoped_refptr<X11VideoRenderer>;
43 virtual ~X11VideoRenderer(); 51 virtual ~X11VideoRenderer();
44 52
45 int width_; 53 int width_;
46 int height_; 54 int height_;
47 bool uses_egl_image_; 55 bool uses_egl_image_;
48 56
49 Display* display_; 57 Display* display_;
50 Window window_; 58 Window window_;
51 59
52 // Image in heap that contains the RGBA data of the video frame. 60 // Image in heap that contains the RGBA data of the video frame.
53 XImage* image_; 61 XImage* image_;
54 62
55 // Protects |new_frame_|.
56 Lock lock_;
57 bool new_frame_;
58
59 // Picture represents the paint target. This is a picture located 63 // Picture represents the paint target. This is a picture located
60 // in the server. 64 // in the server.
61 unsigned long picture_; 65 unsigned long picture_;
62 66
63 bool use_render_; 67 bool use_render_;
64 68
69 MessageLoop* glx_thread_message_loop_;
65 static X11VideoRenderer* instance_; 70 static X11VideoRenderer* instance_;
66 71
67 DISALLOW_COPY_AND_ASSIGN(X11VideoRenderer); 72 DISALLOW_COPY_AND_ASSIGN(X11VideoRenderer);
68 }; 73 };
69 74
70 #endif // MEDIA_TOOLS_PLAYER_X11_X11_VIDEO_RENDERER_H_ 75 #endif // MEDIA_TOOLS_PLAYER_X11_X11_VIDEO_RENDERER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698