Merge lp:~timo-jyrinki/qtvideo-node/port_to_qt55 into lp:qtvideo-node

Proposed by Timo Jyrinki
Status: Merged
Approved by: Jim Hodapp
Approved revision: 66
Merged at revision: 66
Proposed branch: lp:~timo-jyrinki/qtvideo-node/port_to_qt55
Merge into: lp:qtvideo-node
Diff against target: 313 lines (+70/-78)
7 files modified
src/private/qtmultimediaquickdefs_p.h (+14/-22)
src/qsgvideonode_p.cpp (+15/-23)
src/qsgvideonode_p.h (+23/-25)
src/shadervideonode.cpp (+10/-1)
src/shadervideonode.h (+3/-2)
src/shadervideonodeplugin.h (+1/-1)
unittests/shadervideonode/tst_shadervideonode.cpp (+4/-4)
To merge this branch: bzr merge lp:~timo-jyrinki/qtvideo-node/port_to_qt55
Reviewer Review Type Date Requested Status
Jim Hodapp (community) code Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+273789@code.launchpad.net

Commit message

Port to Qt 5.5 to fix video playback (LP: #1474695)

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Jim Hodapp (jhodapp) wrote :

LGTM

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/private/qtmultimediaquickdefs_p.h'
--- src/private/qtmultimediaquickdefs_p.h 2014-01-31 08:54:55 +0000
+++ src/private/qtmultimediaquickdefs_p.h 2015-10-08 07:11:57 +0000
@@ -1,40 +1,32 @@
1/****************************************************************************1/****************************************************************************
2**2**
3** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).3** Copyright (C) 2015 The Qt Company Ltd.
4** Contact: http://www.qt-project.org/legal4** Contact: http://www.qt.io/licensing/
5**5**
6** This file is part of the Qt Toolkit.6** This file is part of the Qt Toolkit.
7**7**
8** $QT_BEGIN_LICENSE:LGPL$8** $QT_BEGIN_LICENSE:LGPL21$
9** Commercial License Usage9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and Digia. For licensing terms and13** a written agreement between you and The Qt Company. For licensing terms
14** conditions see http://qt.digia.com/licensing. For further information14** and conditions see http://www.qt.io/terms-conditions. For further
15** use the contact form at http://qt.digia.com/contact-us.15** information use the contact form at http://www.qt.io/contact-us.
16**16**
17** GNU Lesser General Public License Usage17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser18** 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 Software19** General Public License version 2.1 or version 3 as published by the Free
20** Foundation and appearing in the file LICENSE.LGPL included in the20** Software Foundation and appearing in the file LICENSE.LGPLv21 and
21** packaging of this file. Please review the following information to21** LICENSE.LGPLv3 included in the packaging of this file. Please review the
22** ensure the GNU Lesser General Public License version 2.1 requirements22** following information to ensure the GNU Lesser General Public License
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.23** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
24** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24**25**
25** In addition, as a special exception, Digia gives you certain additional26** As a special exception, The Qt Company gives you certain additional
26** rights. These rights are described in the Digia Qt LGPL Exception27** rights. These rights are described in The Qt Company LGPL Exception
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.28** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28**29**
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$30** $QT_END_LICENSE$
39**31**
40****************************************************************************/32****************************************************************************/
4133
=== modified file 'src/qsgvideonode_p.cpp'
--- src/qsgvideonode_p.cpp 2014-06-06 14:54:20 +0000
+++ src/qsgvideonode_p.cpp 2015-10-08 07:11:57 +0000
@@ -1,45 +1,37 @@
1/****************************************************************************1/****************************************************************************
2**2**
3** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).3** Copyright (C) 2015 The Qt Company Ltd.
4** Contact: http://www.qt-project.org/legal4** Contact: http://www.qt.io/licensing/
5**5**
6** This file is part of the Qt Toolkit.6** This file is part of the Qt Toolkit.
7**7**
8** $QT_BEGIN_LICENSE:LGPL$8** $QT_BEGIN_LICENSE:LGPL21$
9** Commercial License Usage9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and Digia. For licensing terms and13** a written agreement between you and The Qt Company. For licensing terms
14** conditions see http://qt.digia.com/licensing. For further information14** and conditions see http://www.qt.io/terms-conditions. For further
15** use the contact form at http://qt.digia.com/contact-us.15** information use the contact form at http://www.qt.io/contact-us.
16**16**
17** GNU Lesser General Public License Usage17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser18** 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 Software19** General Public License version 2.1 or version 3 as published by the Free
20** Foundation and appearing in the file LICENSE.LGPL included in the20** Software Foundation and appearing in the file LICENSE.LGPLv21 and
21** packaging of this file. Please review the following information to21** LICENSE.LGPLv3 included in the packaging of this file. Please review the
22** ensure the GNU Lesser General Public License version 2.1 requirements22** following information to ensure the GNU Lesser General Public License
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.23** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
24** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24**25**
25** In addition, as a special exception, Digia gives you certain additional26** As a special exception, The Qt Company gives you certain additional
26** rights. These rights are described in the Digia Qt LGPL Exception27** rights. These rights are described in The Qt Company LGPL Exception
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.28** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28**29**
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$30** $QT_END_LICENSE$
39**31**
40****************************************************************************/32****************************************************************************/
4133
42#include "private/qsgvideonode_p.h"34#include "qsgvideonode_p.h"
4335
44QT_BEGIN_NAMESPACE36QT_BEGIN_NAMESPACE
4537
4638
=== renamed file 'src/private/qsgvideonode_p.h' => 'src/qsgvideonode_p.h'
--- src/private/qsgvideonode_p.h 2014-06-06 14:54:20 +0000
+++ src/qsgvideonode_p.h 2015-10-08 07:11:57 +0000
@@ -1,40 +1,32 @@
1/****************************************************************************1/****************************************************************************
2**2**
3** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).3** Copyright (C) 2015 The Qt Company Ltd.
4** Contact: http://www.qt-project.org/legal4** Contact: http://www.qt.io/licensing/
5**5**
6** This file is part of the Qt Toolkit.6** This file is part of the Qt Toolkit.
7**7**
8** $QT_BEGIN_LICENSE:LGPL$8** $QT_BEGIN_LICENSE:LGPL21$
9** Commercial License Usage9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and Digia. For licensing terms and13** a written agreement between you and The Qt Company. For licensing terms
14** conditions see http://qt.digia.com/licensing. For further information14** and conditions see http://www.qt.io/terms-conditions. For further
15** use the contact form at http://qt.digia.com/contact-us.15** information use the contact form at http://www.qt.io/contact-us.
16**16**
17** GNU Lesser General Public License Usage17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser18** 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 Software19** General Public License version 2.1 or version 3 as published by the Free
20** Foundation and appearing in the file LICENSE.LGPL included in the20** Software Foundation and appearing in the file LICENSE.LGPLv21 and
21** packaging of this file. Please review the following information to21** LICENSE.LGPLv3 included in the packaging of this file. Please review the
22** ensure the GNU Lesser General Public License version 2.1 requirements22** following information to ensure the GNU Lesser General Public License
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.23** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
24** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24**25**
25** In addition, as a special exception, Digia gives you certain additional26** As a special exception, The Qt Company gives you certain additional
26** rights. These rights are described in the Digia Qt LGPL Exception27** rights. These rights are described in The Qt Company LGPL Exception
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.28** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28**29**
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$30** $QT_END_LICENSE$
39**31**
40****************************************************************************/32****************************************************************************/
@@ -51,15 +43,19 @@
5143
52QT_BEGIN_NAMESPACE44QT_BEGIN_NAMESPACE
5345
54const QLatin1String QSGVideoNodeFactoryPluginKey("sgvideonodes");
55
56class Q_MULTIMEDIAQUICK_EXPORT QSGVideoNode : public QSGGeometryNode46class Q_MULTIMEDIAQUICK_EXPORT QSGVideoNode : public QSGGeometryNode
57{47{
58public:48public:
49 enum FrameFlag {
50 FrameFiltered = 0x01
51 };
52 Q_DECLARE_FLAGS(FrameFlags, FrameFlag)
53
59 QSGVideoNode();54 QSGVideoNode();
6055
61 virtual void setCurrentFrame(const QVideoFrame &frame) = 0;56 virtual void setCurrentFrame(const QVideoFrame &frame, FrameFlags flags) = 0;
62 virtual QVideoFrame::PixelFormat pixelFormat() const = 0;57 virtual QVideoFrame::PixelFormat pixelFormat() const = 0;
58 virtual QAbstractVideoBuffer::HandleType handleType() const = 0;
6359
64 void setTexturedRectGeometry(const QRectF &boundingRect, const QRectF &textureRect, int orientation);60 void setTexturedRectGeometry(const QRectF &boundingRect, const QRectF &textureRect, int orientation);
6561
@@ -69,6 +65,8 @@
69 int m_orientation;65 int m_orientation;
70};66};
7167
68Q_DECLARE_OPERATORS_FOR_FLAGS(QSGVideoNode::FrameFlags)
69
72class Q_MULTIMEDIAQUICK_EXPORT QSGVideoNodeFactoryInterface70class Q_MULTIMEDIAQUICK_EXPORT QSGVideoNodeFactoryInterface
73{71{
74public:72public:
7573
=== modified file 'src/shadervideonode.cpp'
--- src/shadervideonode.cpp 2015-06-18 16:20:53 +0000
+++ src/shadervideonode.cpp 2015-10-08 07:11:57 +0000
@@ -69,7 +69,7 @@
69 * back.69 * back.
70 * \param frame70 * \param frame
71 */71 */
72void ShaderVideoNode::setCurrentFrame(const QVideoFrame &frame)72void ShaderVideoNode::setCurrentFrame(const QVideoFrame &frame, FrameFlags flags)
73{73{
74 void *ci = 0;74 void *ci = 0;
75 if (frame.availableMetaData().contains("CamControl")) {75 if (frame.availableMetaData().contains("CamControl")) {
@@ -106,6 +106,15 @@
106}106}
107107
108/*!108/*!
109 * \brief ShaderVideoNode::HandleType \reimp
110 * \return
111 */
112QAbstractVideoBuffer::HandleType ShaderVideoNode::handleType() const
113{
114 return QAbstractVideoBuffer::GLTextureHandle;
115}
116
117/*!
109 * \brief ShaderVideoNode::onSetSnapshotSize sets the target size for the snapshot118 * \brief ShaderVideoNode::onSetSnapshotSize sets the target size for the snapshot
110 * \param size119 * \param size
111 */120 */
112121
=== modified file 'src/shadervideonode.h'
--- src/shadervideonode.h 2015-04-30 19:42:40 +0000
+++ src/shadervideonode.h 2015-10-08 07:11:57 +0000
@@ -19,7 +19,7 @@
1919
20#include <qgl.h>20#include <qgl.h>
21#include <QObject>21#include <QObject>
22#include <private/qsgvideonode_p.h>22#include <qsgvideonode_p.h>
2323
24#include <memory>24#include <memory>
2525
@@ -43,7 +43,8 @@
43 void preprocess();43 void preprocess();
4444
45 QVideoFrame::PixelFormat pixelFormat() const;45 QVideoFrame::PixelFormat pixelFormat() const;
46 void setCurrentFrame(const QVideoFrame &frame);46 void setCurrentFrame(const QVideoFrame &frame, FrameFlags flags);
47 QAbstractVideoBuffer::HandleType handleType() const;
4748
48private Q_SLOTS:49private Q_SLOTS:
49 void onSetSnapshotSize(const QSize &size);50 void onSetSnapshotSize(const QSize &size);
5051
=== modified file 'src/shadervideonodeplugin.h'
--- src/shadervideonodeplugin.h 2014-06-06 14:54:20 +0000
+++ src/shadervideonodeplugin.h 2015-10-08 07:11:57 +0000
@@ -17,7 +17,7 @@
17#ifndef SHADERVIDEONODEPLUGIN_H17#ifndef SHADERVIDEONODEPLUGIN_H
18#define SHADERVIDEONODEPLUGIN_H18#define SHADERVIDEONODEPLUGIN_H
1919
20#include <private/qsgvideonode_p.h>20#include <qsgvideonode_p.h>
21#include <QVideoSurfaceFormat>21#include <QVideoSurfaceFormat>
2222
23class ShaderVideoNodePlugin : public QObject, public QSGVideoNodeFactoryInterface23class ShaderVideoNodePlugin : public QObject, public QSGVideoNodeFactoryInterface
2424
=== modified file 'unittests/shadervideonode/tst_shadervideonode.cpp'
--- unittests/shadervideonode/tst_shadervideonode.cpp 2015-01-12 16:52:18 +0000
+++ unittests/shadervideonode/tst_shadervideonode.cpp 2015-10-08 07:11:57 +0000
@@ -117,12 +117,12 @@
117 CameraControl *cc = new CameraControl;117 CameraControl *cc = new CameraControl;
118 QVideoFrame frame(new GLTextureBuffer(1), QSize(320, 240), QVideoFrame::Format_RGB32);118 QVideoFrame frame(new GLTextureBuffer(1), QSize(320, 240), QVideoFrame::Format_RGB32);
119119
120 node.setCurrentFrame(frame);120 node.setCurrentFrame(frame, 0);
121 QCOMPARE(QVariant(QMetaType::VoidStar, node.m_material->cameraControl()),121 QCOMPARE(QVariant(QMetaType::VoidStar, node.m_material->cameraControl()),
122 QVariant(QMetaType::VoidStar, 0));122 QVariant(QMetaType::VoidStar, 0));
123123
124 frame.setMetaData("CamControl", QVariant::fromValue(static_cast<void*>(cc)));124 frame.setMetaData("CamControl", QVariant::fromValue(static_cast<void*>(cc)));
125 node.setCurrentFrame(frame);125 node.setCurrentFrame(frame, 0);
126 QCOMPARE(QVariant(QMetaType::VoidStar, node.m_material->cameraControl()),126 QCOMPARE(QVariant(QMetaType::VoidStar, node.m_material->cameraControl()),
127 QVariant(QMetaType::VoidStar, cc));127 QVariant(QMetaType::VoidStar, cc));
128}128}
@@ -136,12 +136,12 @@
136136
137 QVideoFrame frame(new GLTextureBuffer(1), QSize(1920, 80), QVideoFrame::Format_RGB32);137 QVideoFrame frame(new GLTextureBuffer(1), QSize(1920, 80), QVideoFrame::Format_RGB32);
138138
139 node.setCurrentFrame(frame);139 node.setCurrentFrame(frame, 0);
140140
141 std::shared_ptr<core::ubuntu::media::video::Sink> sink{new NullSink()};141 std::shared_ptr<core::ubuntu::media::video::Sink> sink{new NullSink()};
142142
143 frame.setMetaData("GLVideoSink", QVariant::fromValue(sink));143 frame.setMetaData("GLVideoSink", QVariant::fromValue(sink));
144 node.setCurrentFrame(frame);144 node.setCurrentFrame(frame, 0);
145 QCOMPARE(node.m_material->glVideoSink(), sink);145 QCOMPARE(node.m_material->glVideoSink(), sink);
146146
147 QVERIFY(m_glConsumerSet == true);147 QVERIFY(m_glConsumerSet == true);

Subscribers

People subscribed via source and target branches