Add orientation support to VideoOutput.

Just uses an integer to represent the degrees rotation from standard.
Only supports multiples of 90 - other rotation can be done with
standard QML.

Change-Id: Id4013169c5d9da473b6e5be94ba341da21c2f2a3
Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
This commit is contained in:
Michael Goddard
2011-11-25 15:25:22 +10:00
committed by Qt by Nokia
parent 581564c990
commit be7cc17cbf
4 changed files with 126 additions and 11 deletions

View File

@@ -65,6 +65,7 @@ class QDeclarativeVideoOutput : public QQuickItem
Q_DISABLE_COPY(QDeclarativeVideoOutput)
Q_PROPERTY(QObject* source READ source WRITE setSource NOTIFY sourceChanged)
Q_PROPERTY(FillMode fillMode READ fillMode WRITE setFillMode NOTIFY fillModeChanged)
Q_PROPERTY(int orientation READ orientation WRITE setOrientation NOTIFY orientationChanged)
Q_ENUMS(FillMode)
public:
@@ -84,9 +85,13 @@ public:
FillMode fillMode() const;
void setFillMode(FillMode mode);
int orientation() const;
void setOrientation(int);
Q_SIGNALS:
void sourceChanged();
void fillModeChanged(QDeclarativeVideoOutput::FillMode);
void orientationChanged();
protected:
QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *);
@@ -122,6 +127,7 @@ private:
QSize m_nativeSize;
QRectF m_boundingRect;
QRectF m_sourceRect;
int m_orientation;
QMutex m_frameMutex;
};