Merge lp:~phablet-team/qtvideo-node/support_qt52 into lp:qtvideo-node

Proposed by Timo Jyrinki
Status: Merged
Approved by: Jim Hodapp
Approved revision: 47
Merged at revision: 44
Proposed branch: lp:~phablet-team/qtvideo-node/support_qt52
Merge into: lp:qtvideo-node
Diff against target: 402 lines (+308/-4)
8 files modified
debian/control (+0/-1)
src/private/qsgvideonode_p.h (+93/-0)
src/private/qtmultimediaquickdefs_p.h (+70/-0)
src/qsgvideonode_p.cpp (+128/-0)
src/shadervideomaterial.h (+5/-0)
src/shadervideoshader.h (+5/-0)
src/src.pro (+3/-2)
unittests/shadervideonode/shadervideonode.pro (+4/-1)
To merge this branch: bzr merge lp:~phablet-team/qtvideo-node/support_qt52
Reviewer Review Type Date Requested Status
Timo Jyrinki Approve
PS Jenkins bot continuous-integration Approve
Jim Hodapp (community) code Approve
Review via email: mp+204170@code.launchpad.net

Commit message

Initial Qt 5.2 support. Copy two header files from qtmultimedia private headers. Only use Qt Declarative private headers (quick-private) otherwise, and use version detection to support both 5.0 and 5.2.

Disable unit tests temporarily.

To post a comment you must log in.
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

See the bug comments. This revision 44 has tested to be building against Qt 5.2, but with the disabled tests:
https://launchpad.net/~canonical-qt5-edgers/+archive/qt5-beta2/+sourcepub/3883608/+listing-archive-extra

Revision history for this message
Ricardo Salveti (rsalveti) wrote :

What is the reason to disable the tests?

Revision history for this message
Jim Hodapp (jhodapp) wrote :

Looks good, thanks.

review: Approve (code)
45. By Ricardo Salveti

Merging lp:~sergiusens/qtvideo-node/qsgvideonode_p

46. By Ricardo Salveti

videonode.pro: adding back the unit tests

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
47. By Ricardo Salveti

Adding needed files for the unittests

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

Approving as per functionality testing, builds in the PPA and camera works now!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/control'
--- debian/control 2013-12-23 20:26:24 +0000
+++ debian/control 2014-02-27 03:41:33 +0000
@@ -15,7 +15,6 @@
15 qtdeclarative5-dev,15 qtdeclarative5-dev,
16 qtdeclarative5-private-dev,16 qtdeclarative5-private-dev,
17 qtmultimedia5-dev,17 qtmultimedia5-dev,
18 qtmultimedia5-private-dev,
19Standards-Version: 3.9.418Standards-Version: 3.9.4
20Homepage: https://launchpad.net/qtvideo-node19Homepage: https://launchpad.net/qtvideo-node
21# If you aren't a member of ~phablet-team but need to upload packaging changes,20# If you aren't a member of ~phablet-team but need to upload packaging changes,
2221
=== added directory 'src/private'
=== added file 'src/private/qsgvideonode_p.h'
--- src/private/qsgvideonode_p.h 1970-01-01 00:00:00 +0000
+++ src/private/qsgvideonode_p.h 2014-02-27 03:41:33 +0000
@@ -0,0 +1,93 @@
1/****************************************************************************
2**
3** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4** Contact: http://www.qt-project.org/legal
5**
6** This file is part of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and Digia. For licensing terms and
14** conditions see http://qt.digia.com/licensing. For further information
15** use the contact form at http://qt.digia.com/contact-us.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 2.1 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPL included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 2.1 requirements
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24**
25** In addition, as a special exception, Digia gives you certain additional
26** rights. These rights are described in the Digia Qt LGPL Exception
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28**
29** GNU General Public License Usage
30** Alternatively, this file may be used under the terms of the GNU
31** General Public License version 3.0 as published by the Free Software
32** Foundation and appearing in the file LICENSE.GPL included in the
33** packaging of this file. Please review the following information to
34** ensure the GNU General Public License version 3.0 requirements will be
35** met: http://www.gnu.org/copyleft/gpl.html.
36**
37**
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42#ifndef QSGVIDEONODE_P_H
43#define QSGVIDEONODE_P_H
44
45#include <QtQuick/qsgnode.h>
46#include <private/qtmultimediaquickdefs_p.h>
47
48#include <QtMultimedia/qvideoframe.h>
49#include <QtMultimedia/qvideosurfaceformat.h>
50#include <QtGui/qopenglfunctions.h>
51
52QT_BEGIN_NAMESPACE
53
54const QLatin1String QSGVideoNodeFactoryPluginKey("sgvideonodes");
55
56class Q_MULTIMEDIAQUICK_EXPORT QSGVideoNode : public QSGGeometryNode
57{
58public:
59 QSGVideoNode();
60
61 virtual void setCurrentFrame(const QVideoFrame &frame) = 0;
62 virtual QVideoFrame::PixelFormat pixelFormat() const = 0;
63
64 void setTexturedRectGeometry(const QRectF &boundingRect, const QRectF &textureRect, int orientation);
65
66private:
67 QRectF m_rect;
68 QRectF m_textureRect;
69 int m_orientation;
70};
71
72class Q_MULTIMEDIAQUICK_EXPORT QSGVideoNodeFactoryInterface
73{
74public:
75 virtual QList<QVideoFrame::PixelFormat> supportedPixelFormats(QAbstractVideoBuffer::HandleType handleType) const = 0;
76 virtual QSGVideoNode *createNode(const QVideoSurfaceFormat &format) = 0;
77};
78
79#define QSGVideoNodeFactoryInterface_iid "org.qt-project.qt.sgvideonodefactory/5.0"
80Q_DECLARE_INTERFACE(QSGVideoNodeFactoryInterface, QSGVideoNodeFactoryInterface_iid)
81
82class Q_MULTIMEDIAQUICK_EXPORT QSGVideoNodeFactoryPlugin : public QObject, public QSGVideoNodeFactoryInterface
83{
84 Q_OBJECT
85 Q_INTERFACES(QSGVideoNodeFactoryInterface)
86public:
87 virtual QList<QVideoFrame::PixelFormat> supportedPixelFormats(QAbstractVideoBuffer::HandleType handleType) const = 0;
88 virtual QSGVideoNode *createNode(const QVideoSurfaceFormat &format) = 0;
89};
90
91QT_END_NAMESPACE
92
93#endif // QSGVIDEONODE_H
094
=== added file 'src/private/qtmultimediaquickdefs_p.h'
--- src/private/qtmultimediaquickdefs_p.h 1970-01-01 00:00:00 +0000
+++ src/private/qtmultimediaquickdefs_p.h 2014-02-27 03:41:33 +0000
@@ -0,0 +1,70 @@
1/****************************************************************************
2**
3** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4** Contact: http://www.qt-project.org/legal
5**
6** This file is part of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and Digia. For licensing terms and
14** conditions see http://qt.digia.com/licensing. For further information
15** use the contact form at http://qt.digia.com/contact-us.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 2.1 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPL included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 2.1 requirements
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24**
25** In addition, as a special exception, Digia gives you certain additional
26** rights. These rights are described in the Digia Qt LGPL Exception
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28**
29** GNU General Public License Usage
30** Alternatively, this file may be used under the terms of the GNU
31** General Public License version 3.0 as published by the Free Software
32** Foundation and appearing in the file LICENSE.GPL included in the
33** packaging of this file. Please review the following information to
34** ensure the GNU General Public License version 3.0 requirements will be
35** met: http://www.gnu.org/copyleft/gpl.html.
36**
37**
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42//
43// W A R N I N G
44// -------------
45//
46// This file is not part of the Qt API. It exists purely as an
47// implementation detail. This header file may change from version to
48// version without notice, or even be removed.
49//
50// We mean it.
51//
52
53#ifndef QMULTIMEDIAQUICKDEFS_P_H
54#define QMULTIMEDIAQUICKDEFS_P_H
55
56#include <QtCore/qglobal.h>
57
58#ifndef QT_STATIC
59# if defined(QT_BUILD_QTMM_QUICK_LIB)
60# define Q_MULTIMEDIAQUICK_EXPORT Q_DECL_EXPORT
61# else
62# define Q_MULTIMEDIAQUICK_EXPORT Q_DECL_IMPORT
63# endif
64#else
65# define Q_MULTIMEDIAQUICK_EXPORT
66#endif
67
68
69#endif // QMULTIMEDIAQUICKDEFS_P_H
70
071
=== added file 'src/qsgvideonode_p.cpp'
--- src/qsgvideonode_p.cpp 1970-01-01 00:00:00 +0000
+++ src/qsgvideonode_p.cpp 2014-02-27 03:41:33 +0000
@@ -0,0 +1,128 @@
1/****************************************************************************
2**
3** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4** Contact: http://www.qt-project.org/legal
5**
6** This file is part of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and Digia. For licensing terms and
14** conditions see http://qt.digia.com/licensing. For further information
15** use the contact form at http://qt.digia.com/contact-us.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 2.1 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPL included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 2.1 requirements
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24**
25** In addition, as a special exception, Digia gives you certain additional
26** rights. These rights are described in the Digia Qt LGPL Exception
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28**
29** GNU General Public License Usage
30** Alternatively, this file may be used under the terms of the GNU
31** General Public License version 3.0 as published by the Free Software
32** Foundation and appearing in the file LICENSE.GPL included in the
33** packaging of this file. Please review the following information to
34** ensure the GNU General Public License version 3.0 requirements will be
35** met: http://www.gnu.org/copyleft/gpl.html.
36**
37**
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42#include "private/qsgvideonode_p.h"
43
44QT_BEGIN_NAMESPACE
45
46QSGVideoNode::QSGVideoNode()
47 : m_orientation(-1)
48{
49}
50
51/* Helpers */
52static inline void qSetGeom(QSGGeometry::TexturedPoint2D *v, const QPointF &p)
53{
54 v->x = p.x();
55 v->y = p.y();
56}
57
58static inline void qSetTex(QSGGeometry::TexturedPoint2D *v, const QPointF &p)
59{
60 v->tx = p.x();
61 v->ty = p.y();
62}
63
64/* Update the vertices and texture coordinates. Orientation must be in {0,90,180,270} */
65void QSGVideoNode::setTexturedRectGeometry(const QRectF &rect, const QRectF &textureRect, int orientation)
66{
67 if (rect == m_rect && textureRect == m_textureRect && orientation == m_orientation)
68 return;
69
70 m_rect = rect;
71 m_textureRect = textureRect;
72 m_orientation = orientation;
73
74 QSGGeometry *g = geometry();
75
76 if (g == 0)
77 g = new QSGGeometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 4);
78
79 QSGGeometry::TexturedPoint2D *v = g->vertexDataAsTexturedPoint2D();
80
81 // Set geometry first
82 qSetGeom(v + 0, rect.topLeft());
83 qSetGeom(v + 1, rect.bottomLeft());
84 qSetGeom(v + 2, rect.topRight());
85 qSetGeom(v + 3, rect.bottomRight());
86
87 // and then texture coordinates
88 switch (orientation) {
89 default:
90 // tl, bl, tr, br
91 qSetTex(v + 0, textureRect.topLeft());
92 qSetTex(v + 1, textureRect.bottomLeft());
93 qSetTex(v + 2, textureRect.topRight());
94 qSetTex(v + 3, textureRect.bottomRight());
95 break;
96
97 case 90:
98 // tr, tl, br, bl
99 qSetTex(v + 0, textureRect.topRight());
100 qSetTex(v + 1, textureRect.topLeft());
101 qSetTex(v + 2, textureRect.bottomRight());
102 qSetTex(v + 3, textureRect.bottomLeft());
103 break;
104
105 case 180:
106 // br, tr, bl, tl
107 qSetTex(v + 0, textureRect.bottomRight());
108 qSetTex(v + 1, textureRect.topRight());
109 qSetTex(v + 2, textureRect.bottomLeft());
110 qSetTex(v + 3, textureRect.topLeft());
111 break;
112
113 case 270:
114 // bl, br, tl, tr
115 qSetTex(v + 0, textureRect.bottomLeft());
116 qSetTex(v + 1, textureRect.bottomRight());
117 qSetTex(v + 2, textureRect.topLeft());
118 qSetTex(v + 3, textureRect.topRight());
119 break;
120 }
121
122 if (!geometry())
123 setGeometry(g);
124
125 markDirty(DirtyGeometry);
126}
127
128QT_END_NAMESPACE
0129
=== modified file 'src/shadervideomaterial.h'
--- src/shadervideomaterial.h 2013-12-05 16:48:46 +0000
+++ src/shadervideomaterial.h 2014-02-27 03:41:33 +0000
@@ -17,7 +17,12 @@
17#ifndef SHADERVIDEOMATERIAL_H17#ifndef SHADERVIDEOMATERIAL_H
18#define SHADERVIDEOMATERIAL_H18#define SHADERVIDEOMATERIAL_H
1919
20#include <qglobal.h>
21#if (QT_VERSION < QT_VERSION_CHECK(5, 2, 0))
20#include <QSGMaterial>22#include <QSGMaterial>
23#else
24#include <QtQuick/QSGMaterial>
25#endif
21#include <QVideoSurfaceFormat>26#include <QVideoSurfaceFormat>
22#include <qgl.h>27#include <qgl.h>
2328
2429
=== modified file 'src/shadervideoshader.h'
--- src/shadervideoshader.h 2013-02-12 14:04:56 +0000
+++ src/shadervideoshader.h 2014-02-27 03:41:33 +0000
@@ -17,7 +17,12 @@
17#ifndef SHADERVIDEOSHADER_H17#ifndef SHADERVIDEOSHADER_H
18#define SHADERVIDEOSHADER_H18#define SHADERVIDEOSHADER_H
1919
20#include <qglobal.h>
21#if (QT_VERSION < QT_VERSION_CHECK(5, 2, 0))
20#include <QSGMaterialShader>22#include <QSGMaterialShader>
23#else
24#include <QtQuick/QSGMaterialShader>
25#endif
21#include <QVideoFrame>26#include <QVideoFrame>
2227
23class ShaderVideoShader : public QSGMaterialShader28class ShaderVideoShader : public QSGMaterialShader
2429
=== modified file 'src/src.pro'
--- src/src.pro 2013-06-05 11:44:20 +0000
+++ src/src.pro 2014-02-27 03:41:33 +0000
@@ -1,7 +1,7 @@
1TARGET = shadervideonode1TARGET = shadervideonode
2TEMPLATE = lib2TEMPLATE = lib
3CONFIG += plugin3CONFIG += plugin
4QT += multimedia-private qtmultimediaquicktools-private opengl4QT += multimedia opengl quick-private
55
6include(../coverage.pri)6include(../coverage.pri)
77
@@ -27,4 +27,5 @@
27 shadervideomaterial.cpp \27 shadervideomaterial.cpp \
28 shadervideoshader.cpp \28 shadervideoshader.cpp \
29 shadervideonode.cpp \29 shadervideonode.cpp \
30 snapshotgenerator.cpp30 snapshotgenerator.cpp \
31 qsgvideonode_p.cpp
3132
=== modified file 'unittests/shadervideonode/shadervideonode.pro'
--- unittests/shadervideonode/shadervideonode.pro 2013-09-10 13:28:07 +0000
+++ unittests/shadervideonode/shadervideonode.pro 2014-02-27 03:41:33 +0000
@@ -7,7 +7,7 @@
77
8include(../../coverage.pri)8include(../../coverage.pri)
99
10QT += testlib multimedia-private qtmultimediaquicktools-private opengl10QT += testlib multimedia opengl quick-private
1111
12# This is to avoid a segfault in shadervideonode.cpp when it tries to call12# This is to avoid a segfault in shadervideonode.cpp when it tries to call
13# glGenTextures(), since the platform currently does not support real OpenGL13# glGenTextures(), since the platform currently does not support real OpenGL
@@ -19,6 +19,7 @@
19 ../../src/shadervideonode.cpp \19 ../../src/shadervideonode.cpp \
20 ../../src/shadervideoshader.cpp \20 ../../src/shadervideoshader.cpp \
21 ../../src/snapshotgenerator.cpp \21 ../../src/snapshotgenerator.cpp \
22 ../../src/qsgvideonode_p.cpp \
22 camera.cpp \23 camera.cpp \
23 player.cpp24 player.cpp
2425
@@ -26,6 +27,8 @@
26 ../../src/shadervideonode.h \27 ../../src/shadervideonode.h \
27 ../../src/shadervideoshader.h \28 ../../src/shadervideoshader.h \
28 ../../src/snapshotgenerator.h \29 ../../src/snapshotgenerator.h \
30 ../../src/private/qtmultimediaquickdefs_p.h \
31 ../../src/private/qsgvideonode_p.h \
29 camera_compatibility_layer.h \32 camera_compatibility_layer.h \
30 media_compatibility_layer.h \33 media_compatibility_layer.h \
31 surface_texture_client_hybris.h34 surface_texture_client_hybris.h

Subscribers

People subscribed via source and target branches

to all changes: