2
* Copyright (C) 2012 Canonical, Ltd.
5
* Guenter Schwann <guenter.schwann@canonical.com>
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; version 3.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20
#include <QtTest/QtTest>
23
#include <QVideoFrame>
24
#include <QVideoSurfaceFormat>
26
#include <shadervideomaterial.h>
28
#include "camera_compatibility_layer.h"
30
#define private public
31
#include "shadervideonode.h"
33
class tst_ShaderVideoNode : public QObject
37
void testSetCurrentFrame();
40
void tst_ShaderVideoNode::testSetCurrentFrame()
42
QVideoSurfaceFormat format;
43
ShaderVideoNode node(format);
45
CameraControl *cc = new CameraControl;
46
QImage img(320, 240, QImage::Format_ARGB32);
47
QVideoFrame frame(img);
49
node.setCurrentFrame(frame);
50
QCOMPARE((int)node.m_material->cameraControl(), 0);
52
frame.setMetaData("CamControl", (int)cc);
53
node.setCurrentFrame(frame);
54
QCOMPARE((int)node.m_material->cameraControl(), (int)cc);
57
QTEST_MAIN(tst_ShaderVideoNode)
59
#include "tst_shadervideonode.moc"