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
1=== modified file 'src/private/qtmultimediaquickdefs_p.h'
2--- src/private/qtmultimediaquickdefs_p.h 2014-01-31 08:54:55 +0000
3+++ src/private/qtmultimediaquickdefs_p.h 2015-10-08 07:11:57 +0000
4@@ -1,40 +1,32 @@
5 /****************************************************************************
6 **
7-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
8-** Contact: http://www.qt-project.org/legal
9+** Copyright (C) 2015 The Qt Company Ltd.
10+** Contact: http://www.qt.io/licensing/
11 **
12 ** This file is part of the Qt Toolkit.
13 **
14-** $QT_BEGIN_LICENSE:LGPL$
15+** $QT_BEGIN_LICENSE:LGPL21$
16 ** Commercial License Usage
17 ** Licensees holding valid commercial Qt licenses may use this file in
18 ** accordance with the commercial license agreement provided with the
19 ** Software or, alternatively, in accordance with the terms contained in
20-** a written agreement between you and Digia. For licensing terms and
21-** conditions see http://qt.digia.com/licensing. For further information
22-** use the contact form at http://qt.digia.com/contact-us.
23+** a written agreement between you and The Qt Company. For licensing terms
24+** and conditions see http://www.qt.io/terms-conditions. For further
25+** information use the contact form at http://www.qt.io/contact-us.
26 **
27 ** GNU Lesser General Public License Usage
28 ** Alternatively, this file may be used under the terms of the GNU Lesser
29-** General Public License version 2.1 as published by the Free Software
30-** Foundation and appearing in the file LICENSE.LGPL included in the
31-** packaging of this file. Please review the following information to
32-** ensure the GNU Lesser General Public License version 2.1 requirements
33-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
34+** General Public License version 2.1 or version 3 as published by the Free
35+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
36+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
37+** following information to ensure the GNU Lesser General Public License
38+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
39+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
40 **
41-** In addition, as a special exception, Digia gives you certain additional
42-** rights. These rights are described in the Digia Qt LGPL Exception
43+** As a special exception, The Qt Company gives you certain additional
44+** rights. These rights are described in The Qt Company LGPL Exception
45 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
46 **
47-** GNU General Public License Usage
48-** Alternatively, this file may be used under the terms of the GNU
49-** General Public License version 3.0 as published by the Free Software
50-** Foundation and appearing in the file LICENSE.GPL included in the
51-** packaging of this file. Please review the following information to
52-** ensure the GNU General Public License version 3.0 requirements will be
53-** met: http://www.gnu.org/copyleft/gpl.html.
54-**
55-**
56 ** $QT_END_LICENSE$
57 **
58 ****************************************************************************/
59
60=== modified file 'src/qsgvideonode_p.cpp'
61--- src/qsgvideonode_p.cpp 2014-06-06 14:54:20 +0000
62+++ src/qsgvideonode_p.cpp 2015-10-08 07:11:57 +0000
63@@ -1,45 +1,37 @@
64 /****************************************************************************
65 **
66-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
67-** Contact: http://www.qt-project.org/legal
68+** Copyright (C) 2015 The Qt Company Ltd.
69+** Contact: http://www.qt.io/licensing/
70 **
71 ** This file is part of the Qt Toolkit.
72 **
73-** $QT_BEGIN_LICENSE:LGPL$
74+** $QT_BEGIN_LICENSE:LGPL21$
75 ** Commercial License Usage
76 ** Licensees holding valid commercial Qt licenses may use this file in
77 ** accordance with the commercial license agreement provided with the
78 ** Software or, alternatively, in accordance with the terms contained in
79-** a written agreement between you and Digia. For licensing terms and
80-** conditions see http://qt.digia.com/licensing. For further information
81-** use the contact form at http://qt.digia.com/contact-us.
82+** a written agreement between you and The Qt Company. For licensing terms
83+** and conditions see http://www.qt.io/terms-conditions. For further
84+** information use the contact form at http://www.qt.io/contact-us.
85 **
86 ** GNU Lesser General Public License Usage
87 ** Alternatively, this file may be used under the terms of the GNU Lesser
88-** General Public License version 2.1 as published by the Free Software
89-** Foundation and appearing in the file LICENSE.LGPL included in the
90-** packaging of this file. Please review the following information to
91-** ensure the GNU Lesser General Public License version 2.1 requirements
92-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
93+** General Public License version 2.1 or version 3 as published by the Free
94+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
95+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
96+** following information to ensure the GNU Lesser General Public License
97+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
98+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
99 **
100-** In addition, as a special exception, Digia gives you certain additional
101-** rights. These rights are described in the Digia Qt LGPL Exception
102+** As a special exception, The Qt Company gives you certain additional
103+** rights. These rights are described in The Qt Company LGPL Exception
104 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
105 **
106-** GNU General Public License Usage
107-** Alternatively, this file may be used under the terms of the GNU
108-** General Public License version 3.0 as published by the Free Software
109-** Foundation and appearing in the file LICENSE.GPL included in the
110-** packaging of this file. Please review the following information to
111-** ensure the GNU General Public License version 3.0 requirements will be
112-** met: http://www.gnu.org/copyleft/gpl.html.
113-**
114-**
115 ** $QT_END_LICENSE$
116 **
117 ****************************************************************************/
118
119-#include "private/qsgvideonode_p.h"
120+#include "qsgvideonode_p.h"
121
122 QT_BEGIN_NAMESPACE
123
124
125=== renamed file 'src/private/qsgvideonode_p.h' => 'src/qsgvideonode_p.h'
126--- src/private/qsgvideonode_p.h 2014-06-06 14:54:20 +0000
127+++ src/qsgvideonode_p.h 2015-10-08 07:11:57 +0000
128@@ -1,40 +1,32 @@
129 /****************************************************************************
130 **
131-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
132-** Contact: http://www.qt-project.org/legal
133+** Copyright (C) 2015 The Qt Company Ltd.
134+** Contact: http://www.qt.io/licensing/
135 **
136 ** This file is part of the Qt Toolkit.
137 **
138-** $QT_BEGIN_LICENSE:LGPL$
139+** $QT_BEGIN_LICENSE:LGPL21$
140 ** Commercial License Usage
141 ** Licensees holding valid commercial Qt licenses may use this file in
142 ** accordance with the commercial license agreement provided with the
143 ** Software or, alternatively, in accordance with the terms contained in
144-** a written agreement between you and Digia. For licensing terms and
145-** conditions see http://qt.digia.com/licensing. For further information
146-** use the contact form at http://qt.digia.com/contact-us.
147+** a written agreement between you and The Qt Company. For licensing terms
148+** and conditions see http://www.qt.io/terms-conditions. For further
149+** information use the contact form at http://www.qt.io/contact-us.
150 **
151 ** GNU Lesser General Public License Usage
152 ** Alternatively, this file may be used under the terms of the GNU Lesser
153-** General Public License version 2.1 as published by the Free Software
154-** Foundation and appearing in the file LICENSE.LGPL included in the
155-** packaging of this file. Please review the following information to
156-** ensure the GNU Lesser General Public License version 2.1 requirements
157-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
158+** General Public License version 2.1 or version 3 as published by the Free
159+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
160+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
161+** following information to ensure the GNU Lesser General Public License
162+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
163+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
164 **
165-** In addition, as a special exception, Digia gives you certain additional
166-** rights. These rights are described in the Digia Qt LGPL Exception
167+** As a special exception, The Qt Company gives you certain additional
168+** rights. These rights are described in The Qt Company LGPL Exception
169 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
170 **
171-** GNU General Public License Usage
172-** Alternatively, this file may be used under the terms of the GNU
173-** General Public License version 3.0 as published by the Free Software
174-** Foundation and appearing in the file LICENSE.GPL included in the
175-** packaging of this file. Please review the following information to
176-** ensure the GNU General Public License version 3.0 requirements will be
177-** met: http://www.gnu.org/copyleft/gpl.html.
178-**
179-**
180 ** $QT_END_LICENSE$
181 **
182 ****************************************************************************/
183@@ -51,15 +43,19 @@
184
185 QT_BEGIN_NAMESPACE
186
187-const QLatin1String QSGVideoNodeFactoryPluginKey("sgvideonodes");
188-
189 class Q_MULTIMEDIAQUICK_EXPORT QSGVideoNode : public QSGGeometryNode
190 {
191 public:
192+ enum FrameFlag {
193+ FrameFiltered = 0x01
194+ };
195+ Q_DECLARE_FLAGS(FrameFlags, FrameFlag)
196+
197 QSGVideoNode();
198
199- virtual void setCurrentFrame(const QVideoFrame &frame) = 0;
200+ virtual void setCurrentFrame(const QVideoFrame &frame, FrameFlags flags) = 0;
201 virtual QVideoFrame::PixelFormat pixelFormat() const = 0;
202+ virtual QAbstractVideoBuffer::HandleType handleType() const = 0;
203
204 void setTexturedRectGeometry(const QRectF &boundingRect, const QRectF &textureRect, int orientation);
205
206@@ -69,6 +65,8 @@
207 int m_orientation;
208 };
209
210+Q_DECLARE_OPERATORS_FOR_FLAGS(QSGVideoNode::FrameFlags)
211+
212 class Q_MULTIMEDIAQUICK_EXPORT QSGVideoNodeFactoryInterface
213 {
214 public:
215
216=== modified file 'src/shadervideonode.cpp'
217--- src/shadervideonode.cpp 2015-06-18 16:20:53 +0000
218+++ src/shadervideonode.cpp 2015-10-08 07:11:57 +0000
219@@ -69,7 +69,7 @@
220 * back.
221 * \param frame
222 */
223-void ShaderVideoNode::setCurrentFrame(const QVideoFrame &frame)
224+void ShaderVideoNode::setCurrentFrame(const QVideoFrame &frame, FrameFlags flags)
225 {
226 void *ci = 0;
227 if (frame.availableMetaData().contains("CamControl")) {
228@@ -106,6 +106,15 @@
229 }
230
231 /*!
232+ * \brief ShaderVideoNode::HandleType \reimp
233+ * \return
234+ */
235+QAbstractVideoBuffer::HandleType ShaderVideoNode::handleType() const
236+{
237+ return QAbstractVideoBuffer::GLTextureHandle;
238+}
239+
240+/*!
241 * \brief ShaderVideoNode::onSetSnapshotSize sets the target size for the snapshot
242 * \param size
243 */
244
245=== modified file 'src/shadervideonode.h'
246--- src/shadervideonode.h 2015-04-30 19:42:40 +0000
247+++ src/shadervideonode.h 2015-10-08 07:11:57 +0000
248@@ -19,7 +19,7 @@
249
250 #include <qgl.h>
251 #include <QObject>
252-#include <private/qsgvideonode_p.h>
253+#include <qsgvideonode_p.h>
254
255 #include <memory>
256
257@@ -43,7 +43,8 @@
258 void preprocess();
259
260 QVideoFrame::PixelFormat pixelFormat() const;
261- void setCurrentFrame(const QVideoFrame &frame);
262+ void setCurrentFrame(const QVideoFrame &frame, FrameFlags flags);
263+ QAbstractVideoBuffer::HandleType handleType() const;
264
265 private Q_SLOTS:
266 void onSetSnapshotSize(const QSize &size);
267
268=== modified file 'src/shadervideonodeplugin.h'
269--- src/shadervideonodeplugin.h 2014-06-06 14:54:20 +0000
270+++ src/shadervideonodeplugin.h 2015-10-08 07:11:57 +0000
271@@ -17,7 +17,7 @@
272 #ifndef SHADERVIDEONODEPLUGIN_H
273 #define SHADERVIDEONODEPLUGIN_H
274
275-#include <private/qsgvideonode_p.h>
276+#include <qsgvideonode_p.h>
277 #include <QVideoSurfaceFormat>
278
279 class ShaderVideoNodePlugin : public QObject, public QSGVideoNodeFactoryInterface
280
281=== modified file 'unittests/shadervideonode/tst_shadervideonode.cpp'
282--- unittests/shadervideonode/tst_shadervideonode.cpp 2015-01-12 16:52:18 +0000
283+++ unittests/shadervideonode/tst_shadervideonode.cpp 2015-10-08 07:11:57 +0000
284@@ -117,12 +117,12 @@
285 CameraControl *cc = new CameraControl;
286 QVideoFrame frame(new GLTextureBuffer(1), QSize(320, 240), QVideoFrame::Format_RGB32);
287
288- node.setCurrentFrame(frame);
289+ node.setCurrentFrame(frame, 0);
290 QCOMPARE(QVariant(QMetaType::VoidStar, node.m_material->cameraControl()),
291 QVariant(QMetaType::VoidStar, 0));
292
293 frame.setMetaData("CamControl", QVariant::fromValue(static_cast<void*>(cc)));
294- node.setCurrentFrame(frame);
295+ node.setCurrentFrame(frame, 0);
296 QCOMPARE(QVariant(QMetaType::VoidStar, node.m_material->cameraControl()),
297 QVariant(QMetaType::VoidStar, cc));
298 }
299@@ -136,12 +136,12 @@
300
301 QVideoFrame frame(new GLTextureBuffer(1), QSize(1920, 80), QVideoFrame::Format_RGB32);
302
303- node.setCurrentFrame(frame);
304+ node.setCurrentFrame(frame, 0);
305
306 std::shared_ptr<core::ubuntu::media::video::Sink> sink{new NullSink()};
307
308 frame.setMetaData("GLVideoSink", QVariant::fromValue(sink));
309- node.setCurrentFrame(frame);
310+ node.setCurrentFrame(frame, 0);
311 QCOMPARE(node.m_material->glVideoSink(), sink);
312
313 QVERIFY(m_glConsumerSet == true);

Subscribers

People subscribed via source and target branches