Lumiera  0.pre.03
»edit your freedom«
xvdisplayer.hpp
Go to the documentation of this file.
1 /*
2  XVDISPLAYER.hpp - XVideo display
3 
4  Copyright (C) Lumiera.org
5  2000, Arne Schirmacher <arne@schirmacher.de>
6  2001-2007, Dan Dennedy <dan@dennedy.org>
7  2008, Joel Holdsworth <joel@airwebreathe.org.uk>
8 
9  This program is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License as
11  published by the Free Software Foundation; either version 2 of
12  the License, or (at your option) any later version.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 
23 */
24 
25 
37 #ifndef STAGE_OUTPUT_XVDISPLAYER_H
38 #define STAGE_OUTPUT_XVDISPLAYER_H
39 
40 
42 #include "stage/gtk-base.hpp"
43 
44 #include <X11/Xlib.h>
45 #include <sys/ipc.h>
46 #include <sys/shm.h>
47 #include <X11/extensions/XShm.h>
48 #include <X11/extensions/Xvlib.h>
49 
50 
51 namespace Gtk {
52  class Widget;
53 }
54 
55 namespace stage {
56 namespace output {
57 
62  class XvDisplayer
63  : public Displayer
64  {
65  public:
75  XvDisplayer (Gtk::Widget *drawing_area, int width, int height);
76 
77  ~XvDisplayer();
78 
79 
85  void put (void* const image);
86 
88  bool usable();
89 
90  private:
91 
96  bool gotPort;
97 
102  unsigned int grabbedPort;
103 
108  Gtk::Widget *drawingArea;
109 
114 
118  Window window;
119 
123  GC gc;
124 
128  XvImage *xvImage;
129 
134  XShmSegmentInfo shmInfo;
135  };
136 
137 
138 }} // namespace stage::output
139 #endif // XVDISPLAYER_HPP
unsigned int grabbedPort
The current port being used.
GC gc
The graphics context which will be used when rendering video.
Interface for outputting frames to an (already allocated) viewer or display.
Window window
The X11 window that video will be drawn into.
bool gotPort
Specifies whether the object is currently attached to an XVideo port.
Definition: xvdisplayer.hpp:96
XShmSegmentInfo shmInfo
Info about the shared memory segment.
Lumiera GTK UI implementation root.
Definition: guifacade.cpp:46
Display * display
The display that video will be drawn into.
XvDisplayer is a class which is responsible for rendering a video image via XVideo.
Definition: xvdisplayer.hpp:62
Gtk::Widget * drawingArea
The widget that video will be drawn into.
The Displayer serves as base of all video display implementations.
XvImage * xvImage
The shared memory image object which video will be written into.
A set of basic GTK includes for the UI.
A Displayer is a class which is responsible for rendering an image in some way (ie: Xvideo...
Definition: displayer.hpp:74