Phonon  4.7.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
Public Slots | Signals | Public Member Functions | List of all members
Phonon::VideoGraphicsObject Class Reference

#include <videographicsobject.h>

Inheritance diagram for Phonon::VideoGraphicsObject:
Phonon::MediaNode

Public Slots

void setSpyFormats (QMap< GraphicsPainterType, QList< VideoFrame::Format > > formats)
 

Signals

void ready ()
 
void gotPaint ()
 

Public Member Functions

 VideoGraphicsObject (QGraphicsItem *parent=0)
 
virtual ~VideoGraphicsObject ()
 
virtual QRectF boundingRect () const
 
void setGeometry (const QRectF &newGeometry)
 
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
 
bool isReady () const
 
bool canNegotiate () const
 
- Public Member Functions inherited from Phonon::MediaNode
bool isValid () const
 
QList< PathinputPaths () const
 
QList< PathoutputPaths () const
 

Additional Inherited Members

- Protected Member Functions inherited from Phonon::MediaNode
 MediaNode (MediaNodePrivate &dd)
 
- Protected Attributes inherited from Phonon::MediaNode
MediaNodePrivate *const k_ptr
 

Detailed Description

This class is a video representation implementation for QGraphicsViews/Scenes.

It manually obtaines raw frame data from the Phonon backends using the VideoGraphicsObjectInterface and draws them using an implemntation of AbstractVideoGraphicsPainter.

The VideoGraphicsObject can be used like any other QGraphicsItem, simply add it to a scene and be done with it. You should however keep in mind that due to the amount of work involved in redrawing an area of screen ~25 times per second that some things possible with other VideoGraphicsItems are not possible with a Phonon VideoGraphicsObject. Also not every painter can deliver all the functionality required for more complex things.

For ultimate performance and user experience you should use a Phonon VideoGraphicsObject only in a QGraphicsView with OpenGL viewport. Please take a look at the QGraphicsView documentation for information on how to set an OpenGL viewport.

As the QGraphicsView system does not provide implicit size hints you can explicitly request a target geometry for the VideoGraphicsObject using setGeometry().

QGraphicsView view;
QGraphicsScene scene;
view.setScene(&scene);
Phonon::createPath(&mo, &vgo);
vgo.setGeometry(QRectF(0,0,320,240));
scene.addItem(&vgo);
mo.play();
view.show();
Author
Harald Sitter sitte.nosp@m.r@kd.nosp@m.e.org

Constructor & Destructor Documentation

Phonon::VideoGraphicsObject::VideoGraphicsObject ( QGraphicsItem *  parent = 0)
explicit

Constructor.

Parameters
parentthe parent of the object.
Phonon::VideoGraphicsObject::~VideoGraphicsObject ( )
virtual

Destructor.

Member Function Documentation

QRectF Phonon::VideoGraphicsObject::boundingRect ( ) const
virtual
Returns
the rectangle in which the object will paint, either equal or smaller than the set .
bool Phonon::VideoGraphicsObject::isReady ( ) const

Whether the VideoGraphicsObject is ready to begin playback. Usually it would only be ready when it negotiated the format to use. To do this it most of the time requires at least one paint call. Before the VGO is ready a connected MediaObject will refuse to start playback!

Should play be called before the VideoGraphicsObject the MediaObject will put the command on a pending list and wait for the ready signal to be emitted.

See Also
ready()
void Phonon::VideoGraphicsObject::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget 
)
Reimplemented from superclass.
void Phonon::VideoGraphicsObject::setGeometry ( const QRectF &  newGeometry)
Parameters
newGeometrythe geometry this object should at most occupy.

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