#include <videographicsobject.h>
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< Path > | inputPaths () const |
QList< Path > | outputPaths () const |
Additional Inherited Members | |
Protected Member Functions inherited from Phonon::MediaNode | |
MediaNode (MediaNodePrivate &dd) | |
Protected Attributes inherited from Phonon::MediaNode | |
MediaNodePrivate *const | k_ptr |
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().
|
explicit |
Constructor.
parent | the parent of the object. |
|
virtual |
Destructor.
|
virtual |
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.
void Phonon::VideoGraphicsObject::paint | ( | QPainter * | painter, |
const QStyleOptionGraphicsItem * | option, | ||
QWidget * | widget | ||
) |
void Phonon::VideoGraphicsObject::setGeometry | ( | const QRectF & | newGeometry) |
newGeometry | the geometry this object should at most occupy. |