From bba28afe559837321a2083b3ce046ab774a7ef6b Mon Sep 17 00:00:00 2001 From: Michael Goddard Date: Wed, 20 Jun 2012 16:04:57 +1000 Subject: Rename a few controls. The encoder controls could be confused with actual encoding, so make clear they are just settings. Also, the end point selector controls were not named very well. Change-Id: I27f8bf9c865c5f295abad97c01ef98752af42613 Reviewed-by: Thomas McGuire Reviewed-by: Ling Hu --- tests/auto/unit/multimedia.pro | 2 +- .../unit/qaudiorecorder/tst_qaudiorecorder.cpp | 4 +- .../tst_qmediabindableinterface.cpp | 6 +- tests/auto/unit/qmediaobject/tst_qmediaobject.cpp | 2 +- .../unit/qmediarecorder/tst_qmediarecorder.cpp | 18 ++-- .../auto/unit/qmediaservice/tst_qmediaservice.cpp | 2 +- .../qmultimedia_common/mockaudioencodercontrol.h | 6 +- .../qmultimedia_common/mockaudioendpointselector.h | 6 +- .../qmultimedia_common/mockmediarecorderservice.h | 12 +-- .../qmultimedia_common/mockvideoencodercontrol.h | 6 +- .../qvideoencodercontrol/qvideoencodercontrol.pro | 9 -- .../tst_qvideoencodercontrol.cpp | 118 --------------------- .../qvideoencodersettingscontrol.pro | 9 ++ .../tst_qvideoencodersettingscontrol.cpp | 118 +++++++++++++++++++++ 14 files changed, 159 insertions(+), 159 deletions(-) delete mode 100644 tests/auto/unit/qvideoencodercontrol/qvideoencodercontrol.pro delete mode 100644 tests/auto/unit/qvideoencodercontrol/tst_qvideoencodercontrol.cpp create mode 100644 tests/auto/unit/qvideoencodersettingscontrol/qvideoencodersettingscontrol.pro create mode 100644 tests/auto/unit/qvideoencodersettingscontrol/tst_qvideoencodersettingscontrol.cpp (limited to 'tests/auto/unit') diff --git a/tests/auto/unit/multimedia.pro b/tests/auto/unit/multimedia.pro index f909a3b5f..309d41255 100644 --- a/tests/auto/unit/multimedia.pro +++ b/tests/auto/unit/multimedia.pro @@ -25,7 +25,7 @@ SUBDIRS += \ qmetadatawritercontrol \ qradiodata \ qradiotuner \ - qvideoencodercontrol \ + qvideoencodersettingscontrol \ qvideoframe \ qvideosurfaceformat \ qwavedecoder \ diff --git a/tests/auto/unit/qaudiorecorder/tst_qaudiorecorder.cpp b/tests/auto/unit/qaudiorecorder/tst_qaudiorecorder.cpp index 878b03a53..676fb6611 100644 --- a/tests/auto/unit/qaudiorecorder/tst_qaudiorecorder.cpp +++ b/tests/auto/unit/qaudiorecorder/tst_qaudiorecorder.cpp @@ -45,9 +45,9 @@ #include #include -#include +#include #include -#include +#include #include #include #include diff --git a/tests/auto/unit/qmediabindableinterface/tst_qmediabindableinterface.cpp b/tests/auto/unit/qmediabindableinterface/tst_qmediabindableinterface.cpp index ba4d579f2..58e70e23d 100644 --- a/tests/auto/unit/qmediabindableinterface/tst_qmediabindableinterface.cpp +++ b/tests/auto/unit/qmediabindableinterface/tst_qmediabindableinterface.cpp @@ -48,10 +48,10 @@ #include #include #include -#include -#include +#include +#include #include -#include +#include #include #include "mockmediacontainercontrol.h" diff --git a/tests/auto/unit/qmediaobject/tst_qmediaobject.cpp b/tests/auto/unit/qmediaobject/tst_qmediaobject.cpp index 977037dd8..f249ab2e7 100644 --- a/tests/auto/unit/qmediaobject/tst_qmediaobject.cpp +++ b/tests/auto/unit/qmediaobject/tst_qmediaobject.cpp @@ -48,7 +48,7 @@ #include #include #include -#include +#include #include "mockmediarecorderservice.h" #include "mockmediaserviceprovider.h" diff --git a/tests/auto/unit/qmediarecorder/tst_qmediarecorder.cpp b/tests/auto/unit/qmediarecorder/tst_qmediarecorder.cpp index 99ea5d7b5..10409038d 100644 --- a/tests/auto/unit/qmediarecorder/tst_qmediarecorder.cpp +++ b/tests/auto/unit/qmediarecorder/tst_qmediarecorder.cpp @@ -49,10 +49,10 @@ #include #include #include -#include -#include +#include +#include #include -#include +#include #include #include "mockmediarecorderservice.h" @@ -114,13 +114,13 @@ private slots: void testVideoSettingsDestructor(); private: - QAudioEncoderControl* encode; - QAudioEndpointSelector* audio; + QAudioEncoderSettingsControl* encode; + QAudioEndpointSelectorControl* audio; MockMediaObject *object; MockMediaRecorderService*service; MockMediaRecorderControl *mock; QMediaRecorder *capture; - QVideoEncoderControl* videoEncode; + QVideoEncoderSettingsControl* videoEncode; }; void tst_QMediaRecorder::initTestCase() @@ -133,9 +133,9 @@ void tst_QMediaRecorder::initTestCase() object = new MockMediaObject(this, service); capture = new QMediaRecorder(object); - audio = qobject_cast(service->requestControl(QAudioEndpointSelector_iid)); - encode = qobject_cast(service->requestControl(QAudioEncoderControl_iid)); - videoEncode = qobject_cast(service->requestControl(QVideoEncoderControl_iid)); + audio = qobject_cast(service->requestControl(QAudioEndpointSelectorControl_iid)); + encode = qobject_cast(service->requestControl(QAudioEncoderSettingsControl_iid)); + videoEncode = qobject_cast(service->requestControl(QVideoEncoderSettingsControl_iid)); } void tst_QMediaRecorder::cleanupTestCase() diff --git a/tests/auto/unit/qmediaservice/tst_qmediaservice.cpp b/tests/auto/unit/qmediaservice/tst_qmediaservice.cpp index 2b497791c..09c4ba1d5 100644 --- a/tests/auto/unit/qmediaservice/tst_qmediaservice.cpp +++ b/tests/auto/unit/qmediaservice/tst_qmediaservice.cpp @@ -43,7 +43,7 @@ #include -#include +#include #include #include diff --git a/tests/auto/unit/qmultimedia_common/mockaudioencodercontrol.h b/tests/auto/unit/qmultimedia_common/mockaudioencodercontrol.h index 7fb83e396..ffe1800b9 100644 --- a/tests/auto/unit/qmultimedia_common/mockaudioencodercontrol.h +++ b/tests/auto/unit/qmultimedia_common/mockaudioencodercontrol.h @@ -42,14 +42,14 @@ #ifndef MOCKAUDIOENCODERCONTROL_H #define MOCKAUDIOENCODERCONTROL_H -#include "qaudioencodercontrol.h" +#include "qaudioencodersettingscontrol.h" -class MockAudioEncoderControl : public QAudioEncoderControl +class MockAudioEncoderControl : public QAudioEncoderSettingsControl { Q_OBJECT public: MockAudioEncoderControl(QObject *parent): - QAudioEncoderControl(parent) + QAudioEncoderSettingsControl(parent) { m_codecs << "audio/pcm" << "audio/mpeg"; m_descriptions << "Pulse Code Modulation" << "mp3 format"; diff --git a/tests/auto/unit/qmultimedia_common/mockaudioendpointselector.h b/tests/auto/unit/qmultimedia_common/mockaudioendpointselector.h index ef20b3a46..34b584b3f 100644 --- a/tests/auto/unit/qmultimedia_common/mockaudioendpointselector.h +++ b/tests/auto/unit/qmultimedia_common/mockaudioendpointselector.h @@ -42,14 +42,14 @@ #ifndef MOCKAUDIOENDPOINTSELECTOR_H #define MOCKAUDIOENDPOINTSELECTOR_H -#include "qaudioendpointselector.h" +#include "qaudioendpointselectorcontrol.h" -class MockAudioEndpointSelector : public QAudioEndpointSelector +class MockAudioEndpointSelector : public QAudioEndpointSelectorControl { Q_OBJECT public: MockAudioEndpointSelector(QObject *parent): - QAudioEndpointSelector(parent) + QAudioEndpointSelectorControl(parent) { m_names << "device1" << "device2" << "device3"; m_descriptions << "dev1 comment" << "dev2 comment" << "dev3 comment"; diff --git a/tests/auto/unit/qmultimedia_common/mockmediarecorderservice.h b/tests/auto/unit/qmultimedia_common/mockmediarecorderservice.h index f642c43a6..09218893e 100644 --- a/tests/auto/unit/qmultimedia_common/mockmediarecorderservice.h +++ b/tests/auto/unit/qmultimedia_common/mockmediarecorderservice.h @@ -73,15 +73,15 @@ public: QMediaControl* requestControl(const char *name) { - if (hasControls && qstrcmp(name,QAudioEncoderControl_iid) == 0) + if (hasControls && qstrcmp(name,QAudioEncoderSettingsControl_iid) == 0) return mockAudioEncoderControl; - if (hasControls && qstrcmp(name,QAudioEndpointSelector_iid) == 0) + if (hasControls && qstrcmp(name,QAudioEndpointSelectorControl_iid) == 0) return mockAudioEndpointSelector; if (hasControls && qstrcmp(name,QMediaRecorderControl_iid) == 0) return mockControl; if (hasControls && qstrcmp(name,QMediaContainerControl_iid) == 0) return mockFormatControl; - if (hasControls && qstrcmp(name,QVideoEncoderControl_iid) == 0) + if (hasControls && qstrcmp(name,QVideoEncoderSettingsControl_iid) == 0) return mockVideoEncoderControl; if (hasControls && qstrcmp(name, QMetaDataWriterControl_iid) == 0) return mockMetaDataControl; @@ -98,10 +98,10 @@ public: } QMediaControl *mockControl; - QAudioEndpointSelector *mockAudioEndpointSelector; - QAudioEncoderControl *mockAudioEncoderControl; + QAudioEndpointSelectorControl *mockAudioEndpointSelector; + QAudioEncoderSettingsControl *mockAudioEncoderControl; QMediaContainerControl *mockFormatControl; - QVideoEncoderControl *mockVideoEncoderControl; + QVideoEncoderSettingsControl *mockVideoEncoderControl; MockMetaDataWriterControl *mockMetaDataControl; MockAvailabilityControl *mockAvailabilityControl; MockAudioProbeControl *mockAudioProbeControl; diff --git a/tests/auto/unit/qmultimedia_common/mockvideoencodercontrol.h b/tests/auto/unit/qmultimedia_common/mockvideoencodercontrol.h index 1e756d389..e9f9744f1 100644 --- a/tests/auto/unit/qmultimedia_common/mockvideoencodercontrol.h +++ b/tests/auto/unit/qmultimedia_common/mockvideoencodercontrol.h @@ -42,14 +42,14 @@ #ifndef MOCKVIDEOENCODERCONTROL_H #define MOCKVIDEOENCODERCONTROL_H -#include "qvideoencodercontrol.h" +#include "qvideoencodersettingscontrol.h" -class MockVideoEncoderControl : public QVideoEncoderControl +class MockVideoEncoderControl : public QVideoEncoderSettingsControl { Q_OBJECT public: MockVideoEncoderControl(QObject *parent): - QVideoEncoderControl(parent) + QVideoEncoderSettingsControl(parent) { m_videoCodecs << "video/3gpp" << "video/H264"; m_sizes << QSize(320,240) << QSize(640,480); diff --git a/tests/auto/unit/qvideoencodercontrol/qvideoencodercontrol.pro b/tests/auto/unit/qvideoencodercontrol/qvideoencodercontrol.pro deleted file mode 100644 index ad14a25af..000000000 --- a/tests/auto/unit/qvideoencodercontrol/qvideoencodercontrol.pro +++ /dev/null @@ -1,9 +0,0 @@ -CONFIG += testcase -TARGET = tst_qvideoencodercontrol - -QT += multimedia-private testlib -CONFIG += no_private_qt_headers_warning - -SOURCES += \ - tst_qvideoencodercontrol.cpp - diff --git a/tests/auto/unit/qvideoencodercontrol/tst_qvideoencodercontrol.cpp b/tests/auto/unit/qvideoencodercontrol/tst_qvideoencodercontrol.cpp deleted file mode 100644 index 3df6d05fd..000000000 --- a/tests/auto/unit/qvideoencodercontrol/tst_qvideoencodercontrol.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//TESTED_COMPONENT=src/multimedia - -#include -#include "qvideoencodercontrol.h" -class MyVideEncoderControl: public QVideoEncoderControl -{ - Q_OBJECT - -public: - MyVideEncoderControl(QObject *parent = 0 ):QVideoEncoderControl(parent) - { - - } - - ~MyVideEncoderControl() - { - - } - - QList supportedResolutions(const QVideoEncoderSettings &settings,bool *continuous = 0) const - { - Q_UNUSED(settings); - Q_UNUSED(continuous); - - return (QList()); - } - - QList supportedFrameRates(const QVideoEncoderSettings &settings, bool *continuous = 0) const - { - Q_UNUSED(settings); - Q_UNUSED(continuous); - - return (QList()); - - } - - QStringList supportedVideoCodecs() const - { - return QStringList(); - - } - - QString videoCodecDescription(const QString &codecName) const - { - Q_UNUSED(codecName) - return QString(); - - } - - QVideoEncoderSettings videoSettings() const - { - return QVideoEncoderSettings(); - } - - void setVideoSettings(const QVideoEncoderSettings &settings) - { - Q_UNUSED(settings); - } -}; - -class tst_QVideoEncoderControl: public QObject -{ - Q_OBJECT -private slots: - void constructor(); -}; - -void tst_QVideoEncoderControl::constructor() -{ - QObject parent; - MyVideEncoderControl control(&parent); -} - -QTEST_MAIN(tst_QVideoEncoderControl) -#include "tst_qvideoencodercontrol.moc" - - diff --git a/tests/auto/unit/qvideoencodersettingscontrol/qvideoencodersettingscontrol.pro b/tests/auto/unit/qvideoencodersettingscontrol/qvideoencodersettingscontrol.pro new file mode 100644 index 000000000..891985221 --- /dev/null +++ b/tests/auto/unit/qvideoencodersettingscontrol/qvideoencodersettingscontrol.pro @@ -0,0 +1,9 @@ +CONFIG += testcase +TARGET = tst_qvideoencodersettingscontrol + +QT += multimedia-private testlib +CONFIG += no_private_qt_headers_warning + +SOURCES += \ + tst_qvideoencodersettingscontrol.cpp + diff --git a/tests/auto/unit/qvideoencodersettingscontrol/tst_qvideoencodersettingscontrol.cpp b/tests/auto/unit/qvideoencodersettingscontrol/tst_qvideoencodersettingscontrol.cpp new file mode 100644 index 000000000..059f2c725 --- /dev/null +++ b/tests/auto/unit/qvideoencodersettingscontrol/tst_qvideoencodersettingscontrol.cpp @@ -0,0 +1,118 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//TESTED_COMPONENT=src/multimedia + +#include +#include "qvideoencodersettingscontrol.h" +class MyVideEncoderControl: public QVideoEncoderSettingsControl +{ + Q_OBJECT + +public: + MyVideEncoderControl(QObject *parent = 0 ):QVideoEncoderSettingsControl(parent) + { + + } + + ~MyVideEncoderControl() + { + + } + + QList supportedResolutions(const QVideoEncoderSettings &settings,bool *continuous = 0) const + { + Q_UNUSED(settings); + Q_UNUSED(continuous); + + return (QList()); + } + + QList supportedFrameRates(const QVideoEncoderSettings &settings, bool *continuous = 0) const + { + Q_UNUSED(settings); + Q_UNUSED(continuous); + + return (QList()); + + } + + QStringList supportedVideoCodecs() const + { + return QStringList(); + + } + + QString videoCodecDescription(const QString &codecName) const + { + Q_UNUSED(codecName) + return QString(); + + } + + QVideoEncoderSettings videoSettings() const + { + return QVideoEncoderSettings(); + } + + void setVideoSettings(const QVideoEncoderSettings &settings) + { + Q_UNUSED(settings); + } +}; + +class tst_QVideoEncoderSettingsControl: public QObject +{ + Q_OBJECT +private slots: + void constructor(); +}; + +void tst_QVideoEncoderSettingsControl::constructor() +{ + QObject parent; + MyVideEncoderControl control(&parent); +} + +QTEST_MAIN(tst_QVideoEncoderSettingsControl) +#include "tst_qvideoencodersettingscontrol.moc" + + -- cgit v1.2.3