Merge lp:~phablet-team/qtvideo-node/support_qt52 into lp:qtvideo-node
- support_qt52
- Merge into trunk
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 |
Related bugs: |
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.
Description of the change
Timo Jyrinki (timo-jyrinki) wrote : | # |
Ricardo Salveti (rsalveti) wrote : | # |
What is the reason to disable the tests?
Jim Hodapp (jhodapp) wrote : | # |
Looks good, thanks.
- 45. By Ricardo Salveti
- 46. By Ricardo Salveti
-
videonode.pro: adding back the unit tests
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:46
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 47. By Ricardo Salveti
-
Adding needed files for the unittests
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:47
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Timo Jyrinki (timo-jyrinki) wrote : | # |
Approving as per functionality testing, builds in the PPA and camera works now!
Preview Diff
1 | === modified file 'debian/control' |
2 | --- debian/control 2013-12-23 20:26:24 +0000 |
3 | +++ debian/control 2014-02-27 03:41:33 +0000 |
4 | @@ -15,7 +15,6 @@ |
5 | qtdeclarative5-dev, |
6 | qtdeclarative5-private-dev, |
7 | qtmultimedia5-dev, |
8 | - qtmultimedia5-private-dev, |
9 | Standards-Version: 3.9.4 |
10 | Homepage: https://launchpad.net/qtvideo-node |
11 | # If you aren't a member of ~phablet-team but need to upload packaging changes, |
12 | |
13 | === added directory 'src/private' |
14 | === added file 'src/private/qsgvideonode_p.h' |
15 | --- src/private/qsgvideonode_p.h 1970-01-01 00:00:00 +0000 |
16 | +++ src/private/qsgvideonode_p.h 2014-02-27 03:41:33 +0000 |
17 | @@ -0,0 +1,93 @@ |
18 | +/**************************************************************************** |
19 | +** |
20 | +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). |
21 | +** Contact: http://www.qt-project.org/legal |
22 | +** |
23 | +** This file is part of the Qt Toolkit. |
24 | +** |
25 | +** $QT_BEGIN_LICENSE:LGPL$ |
26 | +** Commercial License Usage |
27 | +** Licensees holding valid commercial Qt licenses may use this file in |
28 | +** accordance with the commercial license agreement provided with the |
29 | +** Software or, alternatively, in accordance with the terms contained in |
30 | +** a written agreement between you and Digia. For licensing terms and |
31 | +** conditions see http://qt.digia.com/licensing. For further information |
32 | +** use the contact form at http://qt.digia.com/contact-us. |
33 | +** |
34 | +** GNU Lesser General Public License Usage |
35 | +** Alternatively, this file may be used under the terms of the GNU Lesser |
36 | +** General Public License version 2.1 as published by the Free Software |
37 | +** Foundation and appearing in the file LICENSE.LGPL included in the |
38 | +** packaging of this file. Please review the following information to |
39 | +** ensure the GNU Lesser General Public License version 2.1 requirements |
40 | +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
41 | +** |
42 | +** In addition, as a special exception, Digia gives you certain additional |
43 | +** rights. These rights are described in the Digia Qt LGPL Exception |
44 | +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
45 | +** |
46 | +** GNU General Public License Usage |
47 | +** Alternatively, this file may be used under the terms of the GNU |
48 | +** General Public License version 3.0 as published by the Free Software |
49 | +** Foundation and appearing in the file LICENSE.GPL included in the |
50 | +** packaging of this file. Please review the following information to |
51 | +** ensure the GNU General Public License version 3.0 requirements will be |
52 | +** met: http://www.gnu.org/copyleft/gpl.html. |
53 | +** |
54 | +** |
55 | +** $QT_END_LICENSE$ |
56 | +** |
57 | +****************************************************************************/ |
58 | + |
59 | +#ifndef QSGVIDEONODE_P_H |
60 | +#define QSGVIDEONODE_P_H |
61 | + |
62 | +#include <QtQuick/qsgnode.h> |
63 | +#include <private/qtmultimediaquickdefs_p.h> |
64 | + |
65 | +#include <QtMultimedia/qvideoframe.h> |
66 | +#include <QtMultimedia/qvideosurfaceformat.h> |
67 | +#include <QtGui/qopenglfunctions.h> |
68 | + |
69 | +QT_BEGIN_NAMESPACE |
70 | + |
71 | +const QLatin1String QSGVideoNodeFactoryPluginKey("sgvideonodes"); |
72 | + |
73 | +class Q_MULTIMEDIAQUICK_EXPORT QSGVideoNode : public QSGGeometryNode |
74 | +{ |
75 | +public: |
76 | + QSGVideoNode(); |
77 | + |
78 | + virtual void setCurrentFrame(const QVideoFrame &frame) = 0; |
79 | + virtual QVideoFrame::PixelFormat pixelFormat() const = 0; |
80 | + |
81 | + void setTexturedRectGeometry(const QRectF &boundingRect, const QRectF &textureRect, int orientation); |
82 | + |
83 | +private: |
84 | + QRectF m_rect; |
85 | + QRectF m_textureRect; |
86 | + int m_orientation; |
87 | +}; |
88 | + |
89 | +class Q_MULTIMEDIAQUICK_EXPORT QSGVideoNodeFactoryInterface |
90 | +{ |
91 | +public: |
92 | + virtual QList<QVideoFrame::PixelFormat> supportedPixelFormats(QAbstractVideoBuffer::HandleType handleType) const = 0; |
93 | + virtual QSGVideoNode *createNode(const QVideoSurfaceFormat &format) = 0; |
94 | +}; |
95 | + |
96 | +#define QSGVideoNodeFactoryInterface_iid "org.qt-project.qt.sgvideonodefactory/5.0" |
97 | +Q_DECLARE_INTERFACE(QSGVideoNodeFactoryInterface, QSGVideoNodeFactoryInterface_iid) |
98 | + |
99 | +class Q_MULTIMEDIAQUICK_EXPORT QSGVideoNodeFactoryPlugin : public QObject, public QSGVideoNodeFactoryInterface |
100 | +{ |
101 | + Q_OBJECT |
102 | + Q_INTERFACES(QSGVideoNodeFactoryInterface) |
103 | +public: |
104 | + virtual QList<QVideoFrame::PixelFormat> supportedPixelFormats(QAbstractVideoBuffer::HandleType handleType) const = 0; |
105 | + virtual QSGVideoNode *createNode(const QVideoSurfaceFormat &format) = 0; |
106 | +}; |
107 | + |
108 | +QT_END_NAMESPACE |
109 | + |
110 | +#endif // QSGVIDEONODE_H |
111 | |
112 | === added file 'src/private/qtmultimediaquickdefs_p.h' |
113 | --- src/private/qtmultimediaquickdefs_p.h 1970-01-01 00:00:00 +0000 |
114 | +++ src/private/qtmultimediaquickdefs_p.h 2014-02-27 03:41:33 +0000 |
115 | @@ -0,0 +1,70 @@ |
116 | +/**************************************************************************** |
117 | +** |
118 | +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). |
119 | +** Contact: http://www.qt-project.org/legal |
120 | +** |
121 | +** This file is part of the Qt Toolkit. |
122 | +** |
123 | +** $QT_BEGIN_LICENSE:LGPL$ |
124 | +** Commercial License Usage |
125 | +** Licensees holding valid commercial Qt licenses may use this file in |
126 | +** accordance with the commercial license agreement provided with the |
127 | +** Software or, alternatively, in accordance with the terms contained in |
128 | +** a written agreement between you and Digia. For licensing terms and |
129 | +** conditions see http://qt.digia.com/licensing. For further information |
130 | +** use the contact form at http://qt.digia.com/contact-us. |
131 | +** |
132 | +** GNU Lesser General Public License Usage |
133 | +** Alternatively, this file may be used under the terms of the GNU Lesser |
134 | +** General Public License version 2.1 as published by the Free Software |
135 | +** Foundation and appearing in the file LICENSE.LGPL included in the |
136 | +** packaging of this file. Please review the following information to |
137 | +** ensure the GNU Lesser General Public License version 2.1 requirements |
138 | +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
139 | +** |
140 | +** In addition, as a special exception, Digia gives you certain additional |
141 | +** rights. These rights are described in the Digia Qt LGPL Exception |
142 | +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
143 | +** |
144 | +** GNU General Public License Usage |
145 | +** Alternatively, this file may be used under the terms of the GNU |
146 | +** General Public License version 3.0 as published by the Free Software |
147 | +** Foundation and appearing in the file LICENSE.GPL included in the |
148 | +** packaging of this file. Please review the following information to |
149 | +** ensure the GNU General Public License version 3.0 requirements will be |
150 | +** met: http://www.gnu.org/copyleft/gpl.html. |
151 | +** |
152 | +** |
153 | +** $QT_END_LICENSE$ |
154 | +** |
155 | +****************************************************************************/ |
156 | + |
157 | +// |
158 | +// W A R N I N G |
159 | +// ------------- |
160 | +// |
161 | +// This file is not part of the Qt API. It exists purely as an |
162 | +// implementation detail. This header file may change from version to |
163 | +// version without notice, or even be removed. |
164 | +// |
165 | +// We mean it. |
166 | +// |
167 | + |
168 | +#ifndef QMULTIMEDIAQUICKDEFS_P_H |
169 | +#define QMULTIMEDIAQUICKDEFS_P_H |
170 | + |
171 | +#include <QtCore/qglobal.h> |
172 | + |
173 | +#ifndef QT_STATIC |
174 | +# if defined(QT_BUILD_QTMM_QUICK_LIB) |
175 | +# define Q_MULTIMEDIAQUICK_EXPORT Q_DECL_EXPORT |
176 | +# else |
177 | +# define Q_MULTIMEDIAQUICK_EXPORT Q_DECL_IMPORT |
178 | +# endif |
179 | +#else |
180 | +# define Q_MULTIMEDIAQUICK_EXPORT |
181 | +#endif |
182 | + |
183 | + |
184 | +#endif // QMULTIMEDIAQUICKDEFS_P_H |
185 | + |
186 | |
187 | === added file 'src/qsgvideonode_p.cpp' |
188 | --- src/qsgvideonode_p.cpp 1970-01-01 00:00:00 +0000 |
189 | +++ src/qsgvideonode_p.cpp 2014-02-27 03:41:33 +0000 |
190 | @@ -0,0 +1,128 @@ |
191 | +/**************************************************************************** |
192 | +** |
193 | +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). |
194 | +** Contact: http://www.qt-project.org/legal |
195 | +** |
196 | +** This file is part of the Qt Toolkit. |
197 | +** |
198 | +** $QT_BEGIN_LICENSE:LGPL$ |
199 | +** Commercial License Usage |
200 | +** Licensees holding valid commercial Qt licenses may use this file in |
201 | +** accordance with the commercial license agreement provided with the |
202 | +** Software or, alternatively, in accordance with the terms contained in |
203 | +** a written agreement between you and Digia. For licensing terms and |
204 | +** conditions see http://qt.digia.com/licensing. For further information |
205 | +** use the contact form at http://qt.digia.com/contact-us. |
206 | +** |
207 | +** GNU Lesser General Public License Usage |
208 | +** Alternatively, this file may be used under the terms of the GNU Lesser |
209 | +** General Public License version 2.1 as published by the Free Software |
210 | +** Foundation and appearing in the file LICENSE.LGPL included in the |
211 | +** packaging of this file. Please review the following information to |
212 | +** ensure the GNU Lesser General Public License version 2.1 requirements |
213 | +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
214 | +** |
215 | +** In addition, as a special exception, Digia gives you certain additional |
216 | +** rights. These rights are described in the Digia Qt LGPL Exception |
217 | +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
218 | +** |
219 | +** GNU General Public License Usage |
220 | +** Alternatively, this file may be used under the terms of the GNU |
221 | +** General Public License version 3.0 as published by the Free Software |
222 | +** Foundation and appearing in the file LICENSE.GPL included in the |
223 | +** packaging of this file. Please review the following information to |
224 | +** ensure the GNU General Public License version 3.0 requirements will be |
225 | +** met: http://www.gnu.org/copyleft/gpl.html. |
226 | +** |
227 | +** |
228 | +** $QT_END_LICENSE$ |
229 | +** |
230 | +****************************************************************************/ |
231 | + |
232 | +#include "private/qsgvideonode_p.h" |
233 | + |
234 | +QT_BEGIN_NAMESPACE |
235 | + |
236 | +QSGVideoNode::QSGVideoNode() |
237 | + : m_orientation(-1) |
238 | +{ |
239 | +} |
240 | + |
241 | +/* Helpers */ |
242 | +static inline void qSetGeom(QSGGeometry::TexturedPoint2D *v, const QPointF &p) |
243 | +{ |
244 | + v->x = p.x(); |
245 | + v->y = p.y(); |
246 | +} |
247 | + |
248 | +static inline void qSetTex(QSGGeometry::TexturedPoint2D *v, const QPointF &p) |
249 | +{ |
250 | + v->tx = p.x(); |
251 | + v->ty = p.y(); |
252 | +} |
253 | + |
254 | +/* Update the vertices and texture coordinates. Orientation must be in {0,90,180,270} */ |
255 | +void QSGVideoNode::setTexturedRectGeometry(const QRectF &rect, const QRectF &textureRect, int orientation) |
256 | +{ |
257 | + if (rect == m_rect && textureRect == m_textureRect && orientation == m_orientation) |
258 | + return; |
259 | + |
260 | + m_rect = rect; |
261 | + m_textureRect = textureRect; |
262 | + m_orientation = orientation; |
263 | + |
264 | + QSGGeometry *g = geometry(); |
265 | + |
266 | + if (g == 0) |
267 | + g = new QSGGeometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 4); |
268 | + |
269 | + QSGGeometry::TexturedPoint2D *v = g->vertexDataAsTexturedPoint2D(); |
270 | + |
271 | + // Set geometry first |
272 | + qSetGeom(v + 0, rect.topLeft()); |
273 | + qSetGeom(v + 1, rect.bottomLeft()); |
274 | + qSetGeom(v + 2, rect.topRight()); |
275 | + qSetGeom(v + 3, rect.bottomRight()); |
276 | + |
277 | + // and then texture coordinates |
278 | + switch (orientation) { |
279 | + default: |
280 | + // tl, bl, tr, br |
281 | + qSetTex(v + 0, textureRect.topLeft()); |
282 | + qSetTex(v + 1, textureRect.bottomLeft()); |
283 | + qSetTex(v + 2, textureRect.topRight()); |
284 | + qSetTex(v + 3, textureRect.bottomRight()); |
285 | + break; |
286 | + |
287 | + case 90: |
288 | + // tr, tl, br, bl |
289 | + qSetTex(v + 0, textureRect.topRight()); |
290 | + qSetTex(v + 1, textureRect.topLeft()); |
291 | + qSetTex(v + 2, textureRect.bottomRight()); |
292 | + qSetTex(v + 3, textureRect.bottomLeft()); |
293 | + break; |
294 | + |
295 | + case 180: |
296 | + // br, tr, bl, tl |
297 | + qSetTex(v + 0, textureRect.bottomRight()); |
298 | + qSetTex(v + 1, textureRect.topRight()); |
299 | + qSetTex(v + 2, textureRect.bottomLeft()); |
300 | + qSetTex(v + 3, textureRect.topLeft()); |
301 | + break; |
302 | + |
303 | + case 270: |
304 | + // bl, br, tl, tr |
305 | + qSetTex(v + 0, textureRect.bottomLeft()); |
306 | + qSetTex(v + 1, textureRect.bottomRight()); |
307 | + qSetTex(v + 2, textureRect.topLeft()); |
308 | + qSetTex(v + 3, textureRect.topRight()); |
309 | + break; |
310 | + } |
311 | + |
312 | + if (!geometry()) |
313 | + setGeometry(g); |
314 | + |
315 | + markDirty(DirtyGeometry); |
316 | +} |
317 | + |
318 | +QT_END_NAMESPACE |
319 | |
320 | === modified file 'src/shadervideomaterial.h' |
321 | --- src/shadervideomaterial.h 2013-12-05 16:48:46 +0000 |
322 | +++ src/shadervideomaterial.h 2014-02-27 03:41:33 +0000 |
323 | @@ -17,7 +17,12 @@ |
324 | #ifndef SHADERVIDEOMATERIAL_H |
325 | #define SHADERVIDEOMATERIAL_H |
326 | |
327 | +#include <qglobal.h> |
328 | +#if (QT_VERSION < QT_VERSION_CHECK(5, 2, 0)) |
329 | #include <QSGMaterial> |
330 | +#else |
331 | +#include <QtQuick/QSGMaterial> |
332 | +#endif |
333 | #include <QVideoSurfaceFormat> |
334 | #include <qgl.h> |
335 | |
336 | |
337 | === modified file 'src/shadervideoshader.h' |
338 | --- src/shadervideoshader.h 2013-02-12 14:04:56 +0000 |
339 | +++ src/shadervideoshader.h 2014-02-27 03:41:33 +0000 |
340 | @@ -17,7 +17,12 @@ |
341 | #ifndef SHADERVIDEOSHADER_H |
342 | #define SHADERVIDEOSHADER_H |
343 | |
344 | +#include <qglobal.h> |
345 | +#if (QT_VERSION < QT_VERSION_CHECK(5, 2, 0)) |
346 | #include <QSGMaterialShader> |
347 | +#else |
348 | +#include <QtQuick/QSGMaterialShader> |
349 | +#endif |
350 | #include <QVideoFrame> |
351 | |
352 | class ShaderVideoShader : public QSGMaterialShader |
353 | |
354 | === modified file 'src/src.pro' |
355 | --- src/src.pro 2013-06-05 11:44:20 +0000 |
356 | +++ src/src.pro 2014-02-27 03:41:33 +0000 |
357 | @@ -1,7 +1,7 @@ |
358 | TARGET = shadervideonode |
359 | TEMPLATE = lib |
360 | CONFIG += plugin |
361 | -QT += multimedia-private qtmultimediaquicktools-private opengl |
362 | +QT += multimedia opengl quick-private |
363 | |
364 | include(../coverage.pri) |
365 | |
366 | @@ -27,4 +27,5 @@ |
367 | shadervideomaterial.cpp \ |
368 | shadervideoshader.cpp \ |
369 | shadervideonode.cpp \ |
370 | - snapshotgenerator.cpp |
371 | + snapshotgenerator.cpp \ |
372 | + qsgvideonode_p.cpp |
373 | |
374 | === modified file 'unittests/shadervideonode/shadervideonode.pro' |
375 | --- unittests/shadervideonode/shadervideonode.pro 2013-09-10 13:28:07 +0000 |
376 | +++ unittests/shadervideonode/shadervideonode.pro 2014-02-27 03:41:33 +0000 |
377 | @@ -7,7 +7,7 @@ |
378 | |
379 | include(../../coverage.pri) |
380 | |
381 | -QT += testlib multimedia-private qtmultimediaquicktools-private opengl |
382 | +QT += testlib multimedia opengl quick-private |
383 | |
384 | # This is to avoid a segfault in shadervideonode.cpp when it tries to call |
385 | # glGenTextures(), since the platform currently does not support real OpenGL |
386 | @@ -19,6 +19,7 @@ |
387 | ../../src/shadervideonode.cpp \ |
388 | ../../src/shadervideoshader.cpp \ |
389 | ../../src/snapshotgenerator.cpp \ |
390 | + ../../src/qsgvideonode_p.cpp \ |
391 | camera.cpp \ |
392 | player.cpp |
393 | |
394 | @@ -26,6 +27,8 @@ |
395 | ../../src/shadervideonode.h \ |
396 | ../../src/shadervideoshader.h \ |
397 | ../../src/snapshotgenerator.h \ |
398 | + ../../src/private/qtmultimediaquickdefs_p.h \ |
399 | + ../../src/private/qsgvideonode_p.h \ |
400 | camera_compatibility_layer.h \ |
401 | media_compatibility_layer.h \ |
402 | surface_texture_client_hybris.h |
See the bug comments. This revision 44 has tested to be building against Qt 5.2, but with the disabled tests: /launchpad. net/~canonical- qt5-edgers/ +archive/ qt5-beta2/ +sourcepub/ 3883608/ +listing- archive- extra
https:/