Lumiera  0.pre.03
»edityourfreedom«
XvDisplayer Class Reference

#include "gui/output/xvdisplayer.hpp"

Description

XvDisplayer is a class which is responsible for rendering a video image via XVideo.

Definition at line 62 of file xvdisplayer.hpp.

Public Member Functions

 XvDisplayer (Gtk::Widget *drawing_area, int width, int height)
 Constructor. More...
 
 ~XvDisplayer ()
 
void put (void *const image)
 Put an image of a given width and height with the expected input format (as indicated by the format method). More...
 
bool usable ()
 Indicates if this object can be used to render images on the running system. More...
 
- Public Member Functions inherited from Displayer
virtual ~Displayer ()
 
virtual DisplayerInput format ()
 Indicates the format required by the abstract put method. More...
 
virtual int preferredHeight ()
 Expected height of input to put. More...
 
virtual int preferredWidth ()
 Expected width of input to put. More...
 

Private Attributes

Displaydisplay
 The display that video will be drawn into. More...
 
Gtk::Widget * drawingArea
 The widget that video will be drawn into. More...
 
GC gc
 The graphics context which will be used when rendering video. More...
 
bool gotPort
 Specifies whether the object is currently attached to an XVideo port. More...
 
unsigned int grabbedPort
 The current port being used. More...
 
XShmSegmentInfo shmInfo
 Info about the shared memory segment. More...
 
Window window
 The X11 window that video will be drawn into. More...
 
XvImage * xvImage
 The shared memory image object which video will be written into. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from Displayer
static void calculateVideoLayout (int widget_width, int widget_height, int image_width, int image_height, int &video_x, int &video_y, int &video_width, int &video_height)
 Calculates the coordinates for placing a video image inside a widget. More...
 
- Protected Attributes inherited from Displayer
int imageHeight
 
int imageWidth
 

Constructor & Destructor Documentation

◆ XvDisplayer()

XvDisplayer ( Gtk::Widget *  drawing_area,
int  width,
int  height 
)

Constructor.

Parameters
drawing_areaThe widget into which the video image will be drawn. This value must not be NULL.
widthThe width of the video image in pixels. This value must be greater than zero.
heightThe height of the video image in pixels. This value must be greater than zero.

Definition at line 45 of file xvdisplayer.cpp.

References XvDisplayer::display, Displayer::format(), XvDisplayer::gc, XvDisplayer::gotPort, XvDisplayer::grabbedPort, Displayer::imageHeight, Displayer::imageWidth, NULL, XvDisplayer::shmInfo, XvDisplayer::window, and XvDisplayer::xvImage.

+ Here is the call graph for this function:

◆ ~XvDisplayer()

Member Function Documentation

◆ put()

void put ( void *const  image)
virtual

Put an image of a given width and height with the expected input format (as indicated by the format method).

Parameters
[in]imageThe video image array to draw.

Implements Displayer.

Definition at line 220 of file xvdisplayer.cpp.

References Displayer::calculateVideoLayout(), XvDisplayer::display, XvDisplayer::drawingArea, XvDisplayer::gc, XvDisplayer::grabbedPort, NULL, Displayer::preferredHeight(), Displayer::preferredWidth(), XvDisplayer::window, and XvDisplayer::xvImage.

+ Here is the call graph for this function:

◆ usable()

bool usable ( )
virtual

Indicates if this object can be used to render images on the running system.

Reimplemented from Displayer.

Definition at line 213 of file xvdisplayer.cpp.

References XvDisplayer::gotPort.

Member Data Documentation

◆ gotPort

bool gotPort
private

Specifies whether the object is currently attached to an XVideo port.

Remarks
This value is false until the constructor has finished successfully.

Definition at line 96 of file xvdisplayer.hpp.

Referenced by XvDisplayer::usable(), XvDisplayer::XvDisplayer(), and XvDisplayer::~XvDisplayer().

◆ grabbedPort

unsigned int grabbedPort
private

The current port being used.

Remarks
This value is meaningless unless gotPort is true.

Definition at line 102 of file xvdisplayer.hpp.

Referenced by XvDisplayer::put(), XvDisplayer::XvDisplayer(), and XvDisplayer::~XvDisplayer().

◆ drawingArea

Gtk::Widget* drawingArea
private

The widget that video will be drawn into.

Remarks
This value must be a valid pointer.

Definition at line 108 of file xvdisplayer.hpp.

Referenced by XvDisplayer::put().

◆ display

Display* display
private

The display that video will be drawn into.

Definition at line 113 of file xvdisplayer.hpp.

Referenced by XvDisplayer::put(), XvDisplayer::XvDisplayer(), and XvDisplayer::~XvDisplayer().

◆ window

Window window
private

The X11 window that video will be drawn into.

Definition at line 118 of file xvdisplayer.hpp.

Referenced by XvDisplayer::put(), and XvDisplayer::XvDisplayer().

◆ gc

GC gc
private

The graphics context which will be used when rendering video.

Definition at line 123 of file xvdisplayer.hpp.

Referenced by XvDisplayer::put(), and XvDisplayer::XvDisplayer().

◆ xvImage

XvImage* xvImage
private

The shared memory image object which video will be written into.

Definition at line 128 of file xvdisplayer.hpp.

Referenced by XvDisplayer::put(), XvDisplayer::XvDisplayer(), and XvDisplayer::~XvDisplayer().

◆ shmInfo

XShmSegmentInfo shmInfo
private

Info about the shared memory segment.

Remarks
shmInfo.shmaddr is set to NULL, when the SHM is detached.

Definition at line 134 of file xvdisplayer.hpp.

Referenced by XvDisplayer::XvDisplayer(), and XvDisplayer::~XvDisplayer().

+ Inheritance diagram for XvDisplayer:
+ Collaboration diagram for XvDisplayer:

The documentation for this class was generated from the following files: