diff options
100 files changed, 50 insertions, 8051 deletions
diff --git a/config.tests/FmTxClient/FmTxClient.pro b/config.tests/FmTxClient/FmTxClient.pro deleted file mode 100644 index a6a71858d..000000000 --- a/config.tests/FmTxClient/FmTxClient.pro +++ /dev/null @@ -1,10 +0,0 @@ -CONFIG -= qt -TEMPLATE = app - -# Input -SOURCES += main.cpp - -INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE -LIBS += -lhwrmfmtxclient - - diff --git a/config.tests/FmTxClient/main.cpp b/config.tests/FmTxClient/main.cpp deleted file mode 100644 index e7b0ac7ab..000000000 --- a/config.tests/FmTxClient/main.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $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$ -** -****************************************************************************/ -#include <e32base.h> -#include <hwrmfmtx.h> - -int main(int, char**) -{ - CHWRMFmTx *fmTX = CHWRMFmTx::NewL(); - delete fmTX; -} - diff --git a/config.tests/audiorouting_s60/audiorouting_s60.pro b/config.tests/audiorouting_s60/audiorouting_s60.pro deleted file mode 100644 index dc811944b..000000000 --- a/config.tests/audiorouting_s60/audiorouting_s60.pro +++ /dev/null @@ -1,9 +0,0 @@ -CONFIG -= qt -TEMPLATE = app - -# Input -SOURCES += main.cpp - -#INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE -LIBS += -laudiooutputrouting - diff --git a/config.tests/audiorouting_s60/main.cpp b/config.tests/audiorouting_s60/main.cpp deleted file mode 100644 index 362657820..000000000 --- a/config.tests/audiorouting_s60/main.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $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$ -** -****************************************************************************/ - -int main(int, char**) -{ - return 0; -} - diff --git a/config.tests/make/make.pro b/config.tests/make/make.pro deleted file mode 100644 index 24ff56af2..000000000 --- a/config.tests/make/make.pro +++ /dev/null @@ -1,11 +0,0 @@ -message($$MAKEFILE_GENERATOR) -contains(MAKEFILE_GENERATOR, SYMBIAN_ABLD) { - message(symbian-abld) -} else:contains(MAKEFILE_GENERATOR, SYMBIAN_SBSV2) { - message(symbian-sbsv2) -} else:contains(MAKEFILE_GENERATOR, MSVC)|contains(MAKEFILE_GENERATOR, MSVC.NET)|contains(MAKEFILE_GENERATOR, MSBUILD) { - message(win32-nmake) -} else:contains(MAKEFILE_GENERATOR, MINGW) { - message(win32-mingw) -} - diff --git a/config.tests/mmf_http_cookies/main.cpp b/config.tests/mmf_http_cookies/main.cpp deleted file mode 100644 index 8a6d9a8df..000000000 --- a/config.tests/mmf_http_cookies/main.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $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$ -** -****************************************************************************/ - -#include "\epoc32\include\platform\mw\MMFSessionInfoCustomCommandConstants.h" - -int main(int argc, char *argv[]) -{ - TMMFSessionInfoControllerMessage m; - - return 0; -} diff --git a/config.tests/mmf_http_cookies/mmf_http_cookies.pro b/config.tests/mmf_http_cookies/mmf_http_cookies.pro deleted file mode 100644 index 1f916a4c2..000000000 --- a/config.tests/mmf_http_cookies/mmf_http_cookies.pro +++ /dev/null @@ -1,7 +0,0 @@ -TEMPLATE = app -TARGET = -DEPENDPATH += . -INCLUDEPATH += . - -# Input -SOURCES += main.cpp diff --git a/config.tests/openmaxal_symbian/main.cpp b/config.tests/openmaxal_symbian/main.cpp deleted file mode 100644 index a07d23253..000000000 --- a/config.tests/openmaxal_symbian/main.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $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$ -** -****************************************************************************/ - -int main(int, char**) -{ - return 0; -} diff --git a/config.tests/openmaxal_symbian/openmaxal_symbian.pro b/config.tests/openmaxal_symbian/openmaxal_symbian.pro deleted file mode 100644 index dd8bd065d..000000000 --- a/config.tests/openmaxal_symbian/openmaxal_symbian.pro +++ /dev/null @@ -1,7 +0,0 @@ -CONFIG -= qt -TEMPLATE = app - -# Input -SOURCES += main.cpp - -LIBS += -lopenmaxal diff --git a/config.tests/radioutility_s60/main.cpp b/config.tests/radioutility_s60/main.cpp deleted file mode 100644 index 362657820..000000000 --- a/config.tests/radioutility_s60/main.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $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$ -** -****************************************************************************/ - -int main(int, char**) -{ - return 0; -} - diff --git a/config.tests/radioutility_s60/radioutility_s60.pro b/config.tests/radioutility_s60/radioutility_s60.pro deleted file mode 100644 index af46cacdb..000000000 --- a/config.tests/radioutility_s60/radioutility_s60.pro +++ /dev/null @@ -1,9 +0,0 @@ -CONFIG -= qt -TEMPLATE = app - -# Input -SOURCES += main.cpp - -#INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE -LIBS += -lRadio_Utility - diff --git a/config.tests/surfaces_s60/main.cpp b/config.tests/surfaces_s60/main.cpp deleted file mode 100644 index 8f23e207b..000000000 --- a/config.tests/surfaces_s60/main.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $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$ -** -****************************************************************************/ -#include <videoplayer2.h> - - -int main(int, char**) -{ - CVideoPlayerUtility2 *utility; - return 0; -} diff --git a/config.tests/surfaces_s60/surfaces_s60.pro b/config.tests/surfaces_s60/surfaces_s60.pro deleted file mode 100644 index 4695e6783..000000000 --- a/config.tests/surfaces_s60/surfaces_s60.pro +++ /dev/null @@ -1,8 +0,0 @@ -CONFIG -= qt -TEMPLATE = app - -# Input -SOURCES += main.cpp - -INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE -LIBS += -mediaclientvideo.lib
\ No newline at end of file diff --git a/config.tests/symbian_camera_camautofocus/main.cpp b/config.tests/symbian_camera_camautofocus/main.cpp deleted file mode 100644 index a07d23253..000000000 --- a/config.tests/symbian_camera_camautofocus/main.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $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$ -** -****************************************************************************/ - -int main(int, char**) -{ - return 0; -} diff --git a/config.tests/symbian_camera_camautofocus/symbian_camera_camautofocus.pro b/config.tests/symbian_camera_camautofocus/symbian_camera_camautofocus.pro deleted file mode 100644 index 276ebd5a1..000000000 --- a/config.tests/symbian_camera_camautofocus/symbian_camera_camautofocus.pro +++ /dev/null @@ -1,7 +0,0 @@ -CONFIG -= qt -TEMPLATE = app - -# Input -SOURCES += main.cpp - -LIBS += -lCamAutoFocus_s diff --git a/config.tests/symbian_camera_devvideorecord/main.cpp b/config.tests/symbian_camera_devvideorecord/main.cpp deleted file mode 100644 index a07d23253..000000000 --- a/config.tests/symbian_camera_devvideorecord/main.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $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$ -** -****************************************************************************/ - -int main(int, char**) -{ - return 0; -} diff --git a/config.tests/symbian_camera_devvideorecord/symbian_camera_devvideorecord.pro b/config.tests/symbian_camera_devvideorecord/symbian_camera_devvideorecord.pro deleted file mode 100644 index d2fcab731..000000000 --- a/config.tests/symbian_camera_devvideorecord/symbian_camera_devvideorecord.pro +++ /dev/null @@ -1,7 +0,0 @@ -CONFIG -= qt -TEMPLATE = app - -# Input -SOURCES += main.cpp - -LIBS += -ldevvideo diff --git a/config.tests/symbian_camera_ecamadvsettings/main.cpp b/config.tests/symbian_camera_ecamadvsettings/main.cpp deleted file mode 100644 index a07d23253..000000000 --- a/config.tests/symbian_camera_ecamadvsettings/main.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $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$ -** -****************************************************************************/ - -int main(int, char**) -{ - return 0; -} diff --git a/config.tests/symbian_camera_ecamadvsettings/symbian_camera_ecamadvsettings.pro b/config.tests/symbian_camera_ecamadvsettings/symbian_camera_ecamadvsettings.pro deleted file mode 100644 index 9006fc6a9..000000000 --- a/config.tests/symbian_camera_ecamadvsettings/symbian_camera_ecamadvsettings.pro +++ /dev/null @@ -1,7 +0,0 @@ -CONFIG -= qt -TEMPLATE = app - -# Input -SOURCES += main.cpp - -LIBS += -lecamadvsettings diff --git a/config.tests/symbian_camera_snapshot/main.cpp b/config.tests/symbian_camera_snapshot/main.cpp deleted file mode 100644 index a07d23253..000000000 --- a/config.tests/symbian_camera_snapshot/main.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $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$ -** -****************************************************************************/ - -int main(int, char**) -{ - return 0; -} diff --git a/config.tests/symbian_camera_snapshot/symbian_camera_snapshot.pro b/config.tests/symbian_camera_snapshot/symbian_camera_snapshot.pro deleted file mode 100644 index 26a7bc2aa..000000000 --- a/config.tests/symbian_camera_snapshot/symbian_camera_snapshot.pro +++ /dev/null @@ -1,7 +0,0 @@ -CONFIG -= qt -TEMPLATE = app - -# Input -SOURCES += main.cpp - -LIBS += -lecamsnapshot diff --git a/config.tests/tunerlib_s60/main.cpp b/config.tests/tunerlib_s60/main.cpp deleted file mode 100644 index 9000fd20b..000000000 --- a/config.tests/tunerlib_s60/main.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $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$ -** -****************************************************************************/ - -int main(int, char**) -{ - return 0; -} - diff --git a/config.tests/tunerlib_s60/tunerlib_s60.pro b/config.tests/tunerlib_s60/tunerlib_s60.pro deleted file mode 100644 index 24c15a616..000000000 --- a/config.tests/tunerlib_s60/tunerlib_s60.pro +++ /dev/null @@ -1,9 +0,0 @@ -CONFIG -= qt -TEMPLATE = app - -# Input -SOURCES += main.cpp - -#INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE -LIBS += -ltunerutility - diff --git a/configure b/configure deleted file mode 100755 index da1033a65..000000000 --- a/configure +++ /dev/null @@ -1,443 +0,0 @@ -#!/bin/sh -############################################################################# -## -## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -## All rights reserved. -## Contact: Nokia Corporation (qt-info@nokia.com) -## -## This file is part of the Qt Mobility Components. -## -## $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$ -## -############################################################################# - -# return status of 1 if absolute path as first argument -# also prints the return status -isAbsPath() { - slash=$(echo $1 | cut -c 1) - if [ "$slash" != "/" ]; then - echo 0 - return 0 - fi - echo 1 - return 1 -} - -# Returns the absolute path for $1 for target $2 -# as an example $2 might have value "maemo5". -# This is required because when building in scratchbox for -# maemo we do not want to follow symbolic links that are -# introduced by scratchbox -absPath() { - if [ "$2" = "maemo5" -o "$2" = "maemo6" -o "$2" = "meego" ]; then - if [ `isAbsPath $1` = '1' ]; then - echo $1; - else - echo >&2 "Relative prefix/bin/lib/header/plugin paths are not supported for Maemo" - exit 1; - fi - else - PATH=`$relpath/bin/pathhelper $1` - echo $PATH - fi -} - - -# the current directory (shadow build dir) -shadowpath=`/bin/pwd` -# the name of this script -relconf=`basename $0` -# the directory of this script is the "source tree" -relpath=`dirname $0` -relpath=`(cd "$relpath"; /bin/pwd)` - -CONFIG_IN="$shadowpath/config.in" -BUILD_UNITTESTS= -BUILD_PUBLIC_UNITTESTS= -BUILD_EXAMPLES= -BUILD_DEMOS= -BUILD_DOCS=yes -BUILD_TOOLS=yes -RELEASEMODE= -BUILD_SILENT= -LINUX_TARGET= -LANGUAGES= -QMAKE_CACHE="$shadowpath/.qmake.cache" -QMAKE_EXEC=qmake -LIB_PATH="lib" -BIN_PATH="bin" -PLUGIN_PATH="plugins" -PLATFORM_CONFIG= -MAC_SDK= -QMKSPEC= -OS="other" -# By default, all modules are requested. Reset this later if -modules is supplied -ORGANIZER_REQUESTED=yes -TEST_USE_SIMULATOR= -NFC_SYMBIAN=auto -MAC_DEPLOY= - -usage() -{ - echo "Usage: configure [-prefix <dir>] [headerdir <dir>] [libdir <dir>]" - echo " [-bindir <dir>] [-tests] [-examples] [-no-docs]" - echo " [-no-tools] [-debug] [-release] [-silent]" - echo " [-modules <list>]" - echo - echo "Options:" - echo - echo "-prefix <dir> ..... This will install everything relative to <dir>" - echo " (default prefix: $shadowpath/install)" - echo "-headerdir <dir> .. Header files will be installed to <dir>" - echo " (default prefix: PREFIX/include)" - echo "-libdir <dir> ..... Libraries will be installed to <dir>" - echo " (default: PREFIX/lib)" - echo "-bindir <dir> ..... Executables will be installed to <dir>" - echo " (default: PREFIX/bin)" - echo "-plugindir <dir> .. Plug-ins will be installed to <dir>" - echo " (default: PREFIX/plugins)" - echo "-demosdir <dir> ... Demos will be installed to <dir>" - echo " (default: PREFIX/bin)" - echo "-examplesdir <dir> Examples will be installed to <dir>" - echo " (default PREFIX/bin)" - echo "-debug ............ Build with debugging symbols" - echo "-release .......... Build without debugging symbols" - echo "-silent ........... Reduces build output" - echo "-tests ............ Build unit tests (not build by default)" - echo " Note, this adds test symbols to all libraries" - echo " and should not be used for release builds." - echo "-examples ......... Build example applications" - echo "-demos ............ Build demo applications" - echo "-no-docs .......... Do not build documentation (build by default)" - echo "-no-tools ......... Do not build tools (build by default)" - echo "-modules <list> ... Restrict list of modules to build (default all supported)" - echo " Choose from: bearer contacts gallery location publishsubscribe" - echo " messaging multimedia systeminfo serviceframework" - echo " sensors versit organizer feedback connectivity" - echo " Modules should be separated by a space and surrounded" - echo " by double quotation. If a selected module depends on other modules" - echo " those modules (and their dependencies) will automatically be enabled." - echo "-maemo6 ........... Build Qt Mobility for Maemo6 (Harmattan)." - echo "-maemo5 ........... Build Qt Mobility for Maemo5 (Fremantle)." - echo "-meego ........... Build Qt Mobility for MeeGo." - echo "-sdk <sdk> ........ Build using Apple provided SDK <path/to/sdk>." - echo " example: -sdk /Developer/SDKs/MacOSX10.6.sdk" - echo "-languages ........ Languages/translations to be installed (e.g.: \"ar de ko\")." - echo " (default is empty)" - echo "-qmake-exec <name> Sets custom binary name for qmake binary" - echo " (default: qmake)" - echo "-no-nfc-symbian Disables the NFC Sybmian backend." -# echo "-test-sim Use simulator backend for testing systeminfo" -# echo "-staticconfig <name>" -# echo " Avoids running of configuration tests. The default" -# echo " values are sourced from features/platformconfig/<name>.pri" - echo "-mac-deploy .... Use this option for deploying QtMobility into Qt for use with macdeployqt tool" - echo " This overrides any -prefix that may be set." - echo - - rm -f "$CONFIG_IN" - exit 1 -} - -rm -rf "$QMAKE_CACHE" -CONFIG_LOG="$shadowpath/config.log" -rm -rf "$CONFIG_LOG" - -while [ "$#" -gt 0 ]; do - case "$1" in - -h|-help|--help) - usage - ;; - -tests) - BUILD_UNITTESTS="yes" - ;; - -public-tests-only) - BUILD_PUBLIC_UNITTESTS="yes" - ;; - -demos) - BUILD_DEMOS="yes" - ;; - -examples) - BUILD_EXAMPLES="yes" - ;; - -no-docs) - BUILD_DOCS= - ;; - -no-tools) - BUILD_TOOLS= - ;; - -debug) - RELEASEMODE=debug - ;; - -release) - RELEASEMODE=release - ;; - -silent) - BUILD_SILENT=yes - ;; - -maemo5) - LINUX_TARGET=maemo5 - ;; - -maemo6) - LINUX_TARGET=maemo6 - ;; - -meego) - LINUX_TARGET=meego - ;; - -sdk) - MAC_SDK="$2" - shift - ;; - -qmake-exec) - QMAKE_EXEC="$2" - shift - ;; - -staticconfig) - PLATFORM_CONFIG=$2 - shift - ;; - -languages) - LANGUAGES=$2 - shift - ;; - -test-sim) - TEST_USE_SIMULATOR="yes" - ;; - -no-nfc-symbian) - NFC_SYMBIAN=no - ;; - -mac-deploy) - MAC_DEPLOY='yes' - shift - ;; - *) - echo "Unknown option: $1" - usage - ;; - esac - shift -done - -if [ -z "$RELEASEMODE" ]; then - RELEASEMODE="debug" -fi -echo "CONFIG += $RELEASEMODE" > "$CONFIG_IN" - - -if [ -n "$BUILD_SILENT" ]; then - echo "CONFIG += silent" >> "$CONFIG_IN" -fi - -checkostype() -{ - match="Darwin" - if [ `uname -s` = "${match}" ]; then - OS="darwin" - QMKSPEC="-spec macx-g++" - if [[ `gcc --version` =~ .*llvm.* ]]; then - QMKSPEC="-spec macx-llvm" - else - QMKSPEC="-spec macx-g++" - fi - echo "QMAKESPEC = "$QMKSPEC >> "$CONFIG_IN" - fi -} - -checkostype - -findUniversal() -{ - if [ -e "mac.inc" ]; then - rm mac.inc - fi - echo "contains(QT_CONFIG,x86): system(echo CONFIG+=x86 >> mac.inc)" > 2.pro - echo "contains(QT_CONFIG,ppc): system(echo CONFIG+=ppc >> mac.inc)" >> 2.pro - echo "contains(QT_CONFIG,ppc64): system(echo CONFIG+=ppc64 >> mac.inc)" >> 2.pro - echo "contains(QT_CONFIG,x86_64): system(echo CONFIG+=x86_64 >> mac.inc)" >> 2.pro - SOMETIME=`$QMAKE_EXEC $QMKSPEC 2.pro 2>&1` - rm 2.pro - if [ -e "mac.inc" ]; then - echo "exists(mac.inc): include(mac.inc)" >> "$CONFIG_IN" - fi -} - -if [ "$OS" = "darwin" ] ; then - findUniversal -fi - -if [ -n "$MAC_SDK" ]; then - QMAKE_MAC_SDK="$MAC_SDK" - echo "QMAKE_MAC_SDK = $QMAKE_MAC_SDK" >> "$CONFIG_IN" -fi - -if [ -z "$BUILD_UNITTESTS" ]; then - echo "build_unit_tests = no" >> "$CONFIG_IN" -else - echo "build_unit_tests = yes" >> "$CONFIG_IN" -fi - -if [ -z "$BUILD_PUBLIC_UNITTESTS" ]; then - echo "build_public_unit_tests = no" >> "$CONFIG_IN" -else - echo "build_public_unit_tests = yes" >> "$CONFIG_IN" -fi - -if [ -z "$BUILD_EXAMPLES" ]; then - echo "build_examples = no" >> "$CONFIG_IN" -else - echo "build_examples = yes" >> "$CONFIG_IN" -fi - -if [ -z "$BUILD_DEMOS" ]; then - echo "build_demos = no" >> "$CONFIG_IN" -else - echo "build_demos = yes" >> "$CONFIG_IN" -fi - -if [ -z "$BUILD_DOCS" ]; then - echo "build_docs = no" >> "$CONFIG_IN" -else - echo "build_docs = yes" >> "$CONFIG_IN" -fi - -if [ -z "$BUILD_TOOLS" ]; then - echo "build_tools = no" >> "$CONFIG_IN" -else - echo "build_tools = yes" >> "$CONFIG_IN" -fi - -if [ -z "$TEST_USE_SIMULATOR" ]; then - echo "test_use_sim = no" >> "$CONFIG_IN" -else - echo "test_use_sim = yes" >> "$CONFIG_IN" -fi - -#process languages -if [ -z "LANGUAGES" ]; then - echo "selected_languages =" >> "$CONFIG_IN" -else - echo "selected_languages = $LANGUAGES" >> "$CONFIG_IN" -fi - - -echo "Configuring Qt MultimediaKit" -echo - -WHICH="$relpath/config.tests/tools/which.test" - -printf "Checking available Qt" -if ! "$WHICH" $QMAKE_EXEC 2>/dev/null 1>&2; then - QMAKE_EXEC_ALTERNATIVE= - if "$WHICH" qmake4 2>/dev/null 1>&2; then - QMAKE_EXEC_ALTERNATIVE=qmake4 - elif "$WHICH" qmake-qt4 2>/dev/null 1>&2; then - QMAKE_EXEC_ALTERNATIVE=qmake-qt4 - fi - - if [ -z "$QMAKE_EXEC_ALTERNATIVE" ]; then - printf " ... Not found\n\n" >&2 - echo >&2 "Cannot find "$QMAKE_EXEC" in your PATH."; - echo >&2 "Aborting." - exit 1 - else - QMAKE_EXEC="$QMAKE_EXEC_ALTERNATIVE" - fi -fi - -#we found a qmake binary -printf " ... " -$QMAKE_EXEC -query QT_VERSION - -# find out which make we want to use -MAKE= -for m in make gmake; do - if "$WHICH" $m >/dev/null 2>&1; then - MAKE=`$WHICH $m` - break - fi -done -if [ -z "$MAKE" ]; then - echo >&2 "Cannot find 'make' or 'gmake' in your PATH"; - echo >&2 "Aborting." - exit 1 -fi - -compileTest() -{ - printf "Checking $1" - CURRENT_PWD=`pwd` - - if [ "$shadowpath" = "$relpath" ]; then - #doing source tree build - cd "$relpath/config.tests/$2" - rm -rf ./$2 - else - #using shadow build - rm -rf config.tests/$2 - mkdir -p config.tests/$2 - cd config.tests/$2 - fi - - $QMAKE_EXEC $QMKSPEC "$relpath/config.tests/$2/$2.pro" 2>> "$CONFIG_LOG" >> "$CONFIG_LOG" - printf " ." - "$MAKE" clean >> "$CONFIG_LOG" - printf "." - "$MAKE" >> "$CONFIG_LOG" 2>&1 - printf ". " - if [ -e ./$2 ]; then - echo "OK" - echo "$2_enabled = yes" >> "$CONFIG_IN" - else - echo "Not Found" - echo "$2_enabled = no" >> "$CONFIG_IN" - fi - cd "$CURRENT_PWD" -} - -if [ -z "$PLATFORM_CONFIG" ]; then -#compile tests - compileTest "Gstreamer Photography" gstreamer-photography - compileTest "Gstreamer AppSrc" gstreamer-appsrc - compileTest "Pulse Audio" pulseaudio -else - echo "Skipping configure tests" - echo "Loading ... features/platformconfig/$PLATFORM_CONFIG.pri" - if [ ! -f "$relpath/features/platformconfig/$PLATFORM_CONFIG.pri" ]; then - echo "Invalid platform configuration $PLATFORM_CONFIG.pri" - exit 1; - else - echo "include(\$\${QT_MOBILITY_SOURCE_TREE}/features/platformconfig/$PLATFORM_CONFIG.pri)" >> "$CONFIG_IN" - fi -fi - -mv "$CONFIG_IN" config.pri - diff --git a/configure.bat b/configure.bat deleted file mode 100644 index cb5363ea6..000000000 --- a/configure.bat +++ /dev/null @@ -1,806 +0,0 @@ -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-::
-:: Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-:: All rights reserved.
-:: Contact: Nokia Corporation (qt-info@nokia.com)
-::
-:: This file is part of the Qt Mobility Components.
-::
-:: $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$
-::
-:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-
-@echo off
-
-set QT_MOBILITY_PREFIX= C:\QtMobility
-set BUILD_PATH=%CD%
-set SOURCE_PATH= %~dp0
-cd /D %SOURCE_PATH%
-set SOURCE_PATH=%CD%
-cd /D %BUILD_PATH%
-
-set PROJECT_CONFIG=%BUILD_PATH%\config.in
-set PROJECT_LOG=%BUILD_PATH%\config.log
-set RELEASEMODE=release
-set WIN32_RELEASEMODE=debug_and_release build_all
-set QT_MOBILITY_LIB=
-set BUILD_UNITTESTS=no
-set BUILD_PUBLIC_UNITTESTS=no
-set BUILD_EXAMPLES=no
-set BUILD_DEMOS=no
-set BUILD_DOCS=yes
-set BUILD_TOOLS=yes
-set LANGUAGES_CONFIG=
-set MOBILITY_MODULES=bearer location contacts systeminfo publishsubscribe versit messaging sensors serviceframework multimedia gallery organizer feedback connectivity
-set MOBILITY_MODULES_UNPARSED=
-set VC_TEMPLATE_OPTION=
-set QT_PATH=
-set QMAKE_CACHE=%BUILD_PATH%\.qmake.cache
-set PLATFORM_CONFIG=
-set NFC_SYMBIAN=auto
-
-REM By default, all modules are requested. Reset this later if -modules is supplied
-set ORGANIZER_REQUESTED=yes
-
-if exist "%QMAKE_CACHE%" del /Q %QMAKE_CACHE%
-if exist "%PROJECT_LOG%" del /Q %PROJECT_LOG%
-if exist "%PROJECT_CONFIG%" del /Q %PROJECT_CONFIG%
-
-echo QT_MOBILITY_SOURCE_TREE = %SOURCE_PATH:\=/% > %QMAKE_CACHE%
-echo QT_MOBILITY_BUILD_TREE = %BUILD_PATH:\=/% >> %QMAKE_CACHE%
-set QMAKE_CACHE=
-
-:cmdline_parsing
-if "%1" == "" goto startProcessing
-if "%1" == "-debug" goto debugTag
-if "%1" == "-release" goto releaseTag
-if "%1" == "-silent" goto silentTag
-if "%1" == "-prefix" goto prefixTag
-if "%1" == "-libdir" goto libTag
-if "%1" == "-bindir" goto binTag
-if "%1" == "-headerdir" goto headerTag
-if "%1" == "-plugindir" goto pluginTag
-if "%1" == "-examplesdir" goto examplesDirTag
-if "%1" == "-demosdir" goto demosDirTag
-if "%1" == "-tests" goto testTag
-if "%1" == "-public-tests-only" goto publicTestTag
-if "%1" == "-examples" goto exampleTag
-if "%1" == "-demos" goto demosTag
-if "%1" == "-qt" goto qtTag
-if "%1" == "-vc" goto vcTag
-if "%1" == "-no-docs" goto nodocsTag
-if "%1" == "-no-tools" goto noToolsTag
-if "%1" == "-modules" goto modulesTag
-if "%1" == "/?" goto usage
-if "%1" == "-h" goto usage
-if "%1" == "-help" goto usage
-if "%1" == "--help" goto usage
-if "%1" == "-symbian-unfrozen" goto unfrozenTag
-if "%1" == "-staticconfig" goto staticConfigTag
-if "%1" == "-languages" goto languagesTag
-if "%1" == "-no-nfc-symbian" goto noNfcSymbianTag
-
-echo Unknown option: "%1"
-goto usage
-
-:usage
-echo Usage: configure.bat [-prefix (dir)] [headerdir (dir)] [libdir (dir)]
- echo [-bindir (dir)] [-tests] [-examples]
- echo [-debug] [-release] [-silent]
- echo.
- echo Options:
- echo.
- echo -prefix (dir) ..... This will install everything relative to dir
- echo (default prefix: C:\QtMobility)
- echo -headerdir (dir) .. Header files will be installed to dir
- echo (default prefix: PREFIX/include)
- echo -libdir (dir) ..... Libraries will be installed to dir
- echo (default PREFIX/lib)
- echo -bindir (dir) ..... Executables will be installed to dir
- echo (default PREFIX/bin)
- echo -plugindir (dir) .. Plug-ins will be installed to dir
- echo (default PREFIX/plugins)
- echo -examplesdir (dir) Examples will be installed to dir
- echo (default PREFIX/bin)
- echo -demosdir (dir) ... Demos will be installed to dir
- echo (default PREFIX/bin)
- echo -debug ............ Build with debugging symbols
- echo -release .......... Build without debugging symbols
- echo -silent ........... Reduces build output
- echo -tests ............ Build unit tests (not build by default)
- echo Note, this adds test symbols to all libraries
- echo and should not be used for release builds.
- echo -examples ......... Build example applications
- echo -demos ............ Build demo applications
- echo -no-docs .......... Do not build documentation (build by default)
- echo -modules ^<list^> ... Build only the specified modules (default all)
- echo Choose from: bearer contacts gallery location publishsubscribe
- echo messaging multimedia systeminfo serviceframework
- echo sensors versit organizer feedback connectivity
- echo Modules should be separated by a space and surrounded
- echo by double quotation. If a selected module depends on other modules
- echo those modules (and their dependencies) will automatically be enabled.
- echo -vc ............... Generate Visual Studio make files
- echo -languages ........ Languages/translations to be installed (e.g.: ar de ko)
- echo (default is empty)
- echo -no-nfc-symbian ... Disables the NFC Symbian backend.
-
-
-if exist "%PROJECT_CONFIG%" del %PROJECT_CONFIG%
-goto exitTag
-
-:qtTag
-shift
-set QT_PATH=%1\
-shift
-goto cmdline_parsing
-
-:noNfcSymbianTag
-shift
-set NFC_SYMBIAN=no
-goto cmdline_parsing
-
-:languagesTag
-shift
-:: %1 can have leading/trailing quotes, so we can't use if "%1" == ""
-if xx%1xx == xxxx (
- echo. >&2
- echo >&2The -languages option requires a list of languages.
- echo. >&2
- goto usage
-)
-
-:: Remove leading/trailing quotes, if we have them
-set MOBILITY_LANGUAGES_UNPARSED=xxx%1xxx
-set MOBILITY_LANGUAGES_UNPARSED=%MOBILITY_LANGUAGES_UNPARSED:"xxx=%
-set MOBILITY_LANGUAGES_UNPARSED=%MOBILITY_LANGUAGES_UNPARSED:xxx"=%
-set MOBILITY_LANGUAGES_UNPARSED=%MOBILITY_LANGUAGES_UNPARSED:xxx=%
-
-REM for now we don't check the languages for their validity
-set LANGUAGES_CONFIG=
-set LANGUAGES_CONFIG= %MOBILITY_LANGUAGES_UNPARSED%
-echo Selected Languages: %LANGUAGES_CONFIG%
-shift
-goto cmdline_parsing
-
-:staticConfigTag
-shift
-set PLATFORM_CONFIG=%1
-shift
-goto cmdline_parsing
-
-:debugTag
-if "%RELEASEMODE%" == "release" set RELEASEMODE=debug
-set WIN32_RELEASEMODE=
-shift
-goto cmdline_parsing
-
-:releaseTag
-if "%RELEASEMODE%" == "debug" set RELEASEMODE=release
-set WIN32_RELEASEMODE=
-shift
-goto cmdline_parsing
-
-:silentTag
-echo CONFIG += silent > %PROJECT_CONFIG%
-shift
-goto cmdline_parsing
-
-:prefixTag
-shift
-set QT_MOBILITY_PREFIX=%1
-shift
-goto cmdline_parsing
-
-:libTag
-shift
-echo QT_MOBILITY_LIB = %1 >> %PROJECT_CONFIG%
-shift
-goto cmdline_parsing
-
-:binTag
-shift
-echo QT_MOBILITY_BIN = %1 >> %PROJECT_CONFIG%
-shift
-goto cmdline_parsing
-
-:headerTag
-shift
-echo QT_MOBILITY_INCLUDE = %1 >> %PROJECT_CONFIG%
-shift
-goto cmdline_parsing
-
-:pluginTag
-shift
-echo QT_MOBILITY_PLUGINS = %1 >> %PROJECT_CONFIG%
-shift
-echo
-goto cmdline_parsing
-
-:examplesDirTag
-shift
-echo QT_MOBILITY_EXAMPLES = %1 >> %PROJECT_CONFIG%
-shift
-echo
-goto cmdline_parsing
-
-:demosDirTag
-shift
-echo QT_MOBILITY_DEMOS =%1 >> %PROJECT_CONFIG%
-shift
-echo
-goto cmdline_parsing
-
-:unfrozenTag
-REM Should never be used in release builds
-REM Some SDK's seem to exclude Q_AUTOTEST_EXPORT symbols if the
-REM libraries are frozen. This breaks unit tests relying on the auto test exports
-REM This flag unfreezes the SYMBIAN libraries for the purpose of unit test building.
-REM Ideally this should be connected to '-tests' option but that would prevent
-REM integration testing for frozen symbols as the CI system should test unit tests
-REM and frozen symbol compliance.
-echo symbian_symbols_unfrozen = 1 >> %PROJECT_CONFIG%
-shift
-goto cmdline_parsing
-
-:testTag
-set BUILD_UNITTESTS=yes
-shift
-goto cmdline_parsing
-
-:publicTestTag
-set BUILD_PUBLIC_UNITTESTS=yes
-shift
-goto cmdline_parsing
-
-:exampleTag
-set BUILD_EXAMPLES=yes
-shift
-goto cmdline_parsing
-
-:demosTag
-set BUILD_DEMOS=yes
-shift
-goto cmdline_parsing
-
-:vcTag
-shift
-set VC_TEMPLATE_OPTION=-tp vc
-goto cmdline_parsing
-
-:nodocsTag
-set BUILD_DOCS=no
-shift
-goto cmdline_parsing
-
-:noToolsTag
-set BUILD_TOOLS=no
-shift
-goto cmdline_parsing
-
-:modulesTag
-shift
-:: %1 can have leading/trailing quotes, so we can't use if "%1" == ""
-if xx%1xx == xxxx (
- echo. >&2
- echo >&2The -modules option requires a list of modules.
- echo. >&2
- goto usage
-)
-
-:: Remove leading/trailing quotes, if we have them
-set MOBILITY_MODULES_UNPARSED=xxx%1xxx
-set MOBILITY_MODULES_UNPARSED=%MOBILITY_MODULES_UNPARSED:"xxx=%
-set MOBILITY_MODULES_UNPARSED=%MOBILITY_MODULES_UNPARSED:xxx"=%
-set MOBILITY_MODULES_UNPARSED=%MOBILITY_MODULES_UNPARSED:xxx=%
-
-REM reset default modules as we expect a modules list
-set MOBILITY_MODULES=
-set ORGANIZER_REQUESTED=no
-
-echo Checking selected modules:
-:modulesTag2
-
-for /f "tokens=1,*" %%a in ("%MOBILITY_MODULES_UNPARSED%") do (
- set FIRST=%%a
- set REMAINING=%%b
-)
-
-: What we want is a switch as we need to check module name and only want to
-: distinguish between false and correct module names being passed
-if %FIRST% == bearer (
- echo Bearer Management selected
-) else if %FIRST% == contacts (
- echo Contacts selected
-) else if %FIRST% == location (
- echo Location selected
-) else if %FIRST% == messaging (
- echo Messaging selected
-) else if %FIRST% == multimedia (
- echo Multimedia selected
-) else if %FIRST% == publishsubscribe (
- echo PublishSubscribe selected
-) else if %FIRST% == systeminfo (
- echo Systeminfo selected
-) else if %FIRST% == serviceframework (
- echo ServiceFramework selected
-) else if %FIRST% == versit (
- echo Versit selected ^(implies Contacts^)
-) else if %FIRST% == organizer (
- echo Organizer selected
- set ORGANIZER_REQUESTED=yes
-) else if %FIRST% == feedback (
- echo Feedback selected
-) else if %FIRST% == sensors (
- echo Sensors selected
-) else if %FIRST% == gallery (
- echo Gallery selected
-) else if %FIRST% == connectivity (
- echo Connectivity selected
-) else (
- echo Unknown module %FIRST%
- goto errorTag
-)
-
-set MOBILITY_MODULES=%MOBILITY_MODULES% %FIRST%
-
-if "%REMAINING%" == "" (
- shift
-) else (
- set MOBILITY_MODULES_UNPARSED=%REMAINING%
- goto modulesTag2
-)
-
-SET REMAINING=
-SET FIRST=
-goto cmdline_parsing
-
-:startProcessing
-
-echo CONFIG += %RELEASEMODE% >> %PROJECT_CONFIG%
-echo CONFIG_WIN32 += %WIN32_RELEASEMODE% %RELEASEMODE% >> %PROJECT_CONFIG%
-set RELEASEMODE=
-set WIN32_RELEASEMODE=
-
-set CURRENTDIR=%CD%
-echo %CURRENTDIR%
-if exist %QT_MOBILITY_PREFIX% goto prefixExists
-mkdir %QT_MOBILITY_PREFIX%
-if errorlevel 1 goto invalidPrefix
-cd /D %QT_MOBILITY_PREFIX%
-set QT_MOBILITY_PREFIX=%CD%
-cd /D %CURRENTDIR%
-rd /S /Q %QT_MOBILITY_PREFIX%
-goto endprefixProcessing
-
-:invalidPrefix
-echo "%QT_MOBILITY_PREFIX%" is not a valid directory path.
-goto :exitTag
-
-:prefixExists
-cd /D %QT_MOBILITY_PREFIX%
-set QT_MOBILITY_PREFIX=%CD%
-cd /D %CURRENTDIR%
-
-:endprefixProcessing
-echo QT_MOBILITY_PREFIX = %QT_MOBILITY_PREFIX:\=/% >> %PROJECT_CONFIG%
-
-echo build_unit_tests = %BUILD_UNITTESTS% >> %PROJECT_CONFIG%
-set BUILD_UNITTESTS=
-
-echo build_public_unit_tests = %BUILD_PUBLIC_UNITTESTS% >> %PROJECT_CONFIG%
-set BUILD_PUBLIC_UNITTESTS=
-
-echo build_examples = %BUILD_EXAMPLES% >> %PROJECT_CONFIG%
-set BUILD_EXAMPLES=
-
-echo build_demos = %BUILD_DEMOS% >> %PROJECT_CONFIG%
-set BUILD_DEMOS=
-
-echo build_docs = %BUILD_DOCS% >> %PROJECT_CONFIG%
-set BUILD_DOCS=
-
-echo build_tools = %BUILD_TOOLS% >> %PROJECT_CONFIG%
-set BUILD_TOOLS=
-
-echo qmf_enabled = no >> %PROJECT_CONFIG%
-
-echo !symbian:isEmpty($$QT_MOBILITY_INCLUDE):QT_MOBILITY_INCLUDE=$$QT_MOBILITY_PREFIX/include >> %PROJECT_CONFIG%
-echo isEmpty($$QT_MOBILITY_LIB):QT_MOBILITY_LIB=$$QT_MOBILITY_PREFIX/lib >> %PROJECT_CONFIG%
-echo isEmpty($$QT_MOBILITY_BIN):QT_MOBILITY_BIN=$$QT_MOBILITY_PREFIX/bin >> %PROJECT_CONFIG%
-echo isEmpty($$QT_MOBILITY_PLUGINS):QT_MOBILITY_PLUGINS=$$QT_MOBILITY_PREFIX/plugins >> %PROJECT_CONFIG%
-echo isEmpty($$QT_MOBILITY_EXAMPLES):QT_MOBILITY_EXAMPLES=$$QT_MOBILITY_PREFIX/bin >> %PROJECT_CONFIG%
-echo isEmpty($$QT_MOBILITY_DEMOS):QT_MOBILITY_DEMOS=$$QT_MOBILITY_PREFIX/bin >> %PROJECT_CONFIG%
-
-echo selected_languages = %LANGUAGES_CONFIG% >> %PROJECT_CONFIG%
-
-echo mobility_modules = %MOBILITY_MODULES% >> %PROJECT_CONFIG%
-echo contains(mobility_modules,versit): mobility_modules *= contacts >> %PROJECT_CONFIG%
-echo contains(mobility_modules,connectivity): mobility_modules *= serviceframework >> %PROJECT_CONFIG%
-
-echo Checking available Qt
-call %QT_PATH%qmake -v >> %PROJECT_LOG% 2>&1
-if errorlevel 1 goto qmakeNotFound
-goto qmakeFound
-:qmakeNotFound
-echo ... Not found >> %PROJECT_LOG% 2>&1
-if "%QT_PATH%" == "" (
- echo >&2Cannot find 'qmake' in your PATH.
- echo >&2Your PATH is: "%PATH%"
-) else (
- echo >&2Cannot find 'qmake' in "%QT_PATH%".
-)
-echo >&2Aborting.
-goto errorTag
-
-:qmakeFound
-call %QT_PATH%qmake -query QT_VERSION
-
-goto checkMake
-
-REM Detect make tool
-:makeTest
-setlocal
- set CURRENT_PWD=%CD%
-
- if %BUILD_PATH% == %SOURCE_PATH% (
- cd %SOURCE_PATH%\config.tests\make
- if exist make del make
- ) else (
- rmdir /S /Q config.tests\make
- mkdir config.tests\make
- cd config.tests\make
- )
-
- for /f "tokens=2,3" %%a in ('call %QT_PATH%qmake %SOURCE_PATH%\config.tests\make\make.pro 2^>^&1 1^>NUL') do (
- if "%%a" == "MESSAGE:" (
- set BUILDSYSTEM=%%b)
- )
-
- if "%BUILDSYSTEM%" == "symbian-abld" (
- call make -h >> %PROJECT_LOG% 2>&1
- if not errorlevel 1 (
- echo ... Symbian abld make found.
- set MAKE=make
- )
- ) else if "%BUILDSYSTEM%" == "symbian-sbsv2" (
- call make -h >> %PROJECT_LOG% 2>&1
- if not errorlevel 1 (
- echo ... Symbian sbsv2 make found.
- set MAKE=make
- )
- ) else if "%BUILDSYSTEM%" == "win32-nmake" (
- call nmake /? >> %PROJECT_LOG% 2>&1
- if not errorlevel 1 (
- echo ... nmake found.
- set MAKE=nmake
- )
- ) else if "%BUILDSYSTEM%" == "win32-mingw" (
- call mingw32-make -v >> %PROJECT_LOG% 2>&1
- if not errorlevel 1 (
- echo ... mingw32-make found.
- set MAKE=mingw32-make
- )
- ) else (
- echo ... Unknown target environment %BUILDSYSTEM%.
- )
- call cd %CURRENT_PWD%
-call endlocal&set %1=%MAKE%&set %2=%BUILDSYSTEM%&goto :EOF
-
-:checkMake
-echo Checking make
-call :makeTest MOBILITY_MAKE MOBILITY_BUILDSYSTEM
-if not "%MOBILITY_MAKE%" == "" goto compileTests
-
-echo >&2Cannot find 'nmake', 'mingw32-make' or 'make' in your PATH
-echo >&2Aborting.
-goto errorTag
-
-:compileTest
-setlocal
- @echo off
- echo Checking %1
- set CURRENT_PWD=%CD%
-
- if %BUILD_PATH% == %SOURCE_PATH% (
- cd %SOURCE_PATH%\config.tests\%2
- if exist %2 del %2
- ) else (
- rmdir /S /Q config.tests\%2
- mkdir config.tests\%2
- cd config.tests\%2
- )
-
- call %QT_PATH%qmake %SOURCE_PATH%\config.tests\%2\%2.pro >> %PROJECT_LOG% 2>&1
-
- set FAILED=0
- if "%MOBILITY_BUILDSYSTEM%" == "symbian-sbsv2" (
- call %MOBILITY_MAKE% release-armv5 >> %PROJECT_LOG% 2>&1
- for /f "tokens=2" %%i in ('%MOBILITY_MAKE% release-armv5 SBS^="@sbs --check"') do set FAILED=1
- ) else if "%MOBILITY_BUILDSYSTEM%" == "symbian-abld" (
- call %MOBILITY_MAKE% release-gcce >> %PROJECT_LOG% 2>&1
- for /f "tokens=2" %%i in ('%MOBILITY_MAKE% release-gcce ABLD^="@ABLD.BAT -c" 2^>^&1') do if not %%i == bldfiles set FAILED=1
- ) else (
- REM Make for other builds
- call %MOBILITY_MAKE% >> %PROJECT_LOG% 2>&1
- REM have to check error level for windows / other builds to be sure.
- if errorlevel 1 (
- set FAILED=1
- )
- )
-
- if %FAILED% == 0 (
- echo ... OK
- echo %2_enabled = yes >> %PROJECT_CONFIG%
- ) else (
- echo ... Not Found
- echo %2_enabled = no >> %PROJECT_CONFIG%
- )
-
- cd %CURRENT_PWD%
-endlocal&goto :EOF
-
-:compileTests
-
-REM No reason to do config tests if we got a platform configuration
-if not "%PLATFORM_CONFIG%" == "" goto platformconfig
-
-REM We shouldn't enable some of these if the corresponding modules are not enabled
-echo.
-echo Start of compile tests
-REM compile tests go here.
-for /f "tokens=3" %%i in ('call %QT_PATH%qmake %SOURCE_PATH%\config.tests\make\make.pro 2^>^&1 1^>NUL') do set BUILDSYSTEM=%%i
-if "%BUILDSYSTEM%" == "symbian-abld" goto symbianTests
-if "%BUILDSYSTEM%" == "symbian-sbsv2" (
- perl -S %SOURCE_PATH%\bin\compilercheck.pl
- goto symbianTests
-)
-goto windowsTests
-
-:symbianTests
-
-call :compileTest LBT lbt
-call :compileTest SNAP snap
-call :compileTest OCC occ
-call :compileTest SymbianENote symbianenote
-call :compileTest SymbianContactSIM symbiancntsim
-call :compileTest SymbianContactModel symbiancntmodel
-call :compileTest SymbianContactModelv2 symbiancntmodelv2
-call :compileTest S60_Sensor_API sensors_s60_31
-call :compileTest Symbian_Sensor_Framework sensors_symbian
-call :compileTest Sensor_Framework_Light sensors_symbian_light
-call :compileTest Symbian_Hb hb_symbian
-call :compileTest Audiorouting_s60 audiorouting_s60
-call :compileTest Tunerlibrary_for_3.1 tunerlib_s60
-call :compileTest RadioUtility_for_post_3.1 radioutility_s60
-REM Currently not being supported
-REM call :compileTest OpenMaxAl_support openmaxal_symbian
-call :compileTest Surfaces_s60 surfaces_s60
-call :compileTest Symbian_Messaging_Freestyle messaging_freestyle
-call :compileTest Symbian_Messaging_Freestyle_MAPI12 messaging_freestyle_mapi12
-call :compileTest callinformation_symbian callinformation_symbian
-call :compileTest IMMERSION immersion
-call :compileTest Symbian_CamAutoFocus_31 symbian_camera_camautofocus
-call :compileTest Symbian_ECamAdvancedSettings_Post31 symbian_camera_ecamadvsettings
-call :compileTest Symbian_DevVideoRecord symbian_camera_devvideorecord
-call :compileTest Symbian_SnapShotAPI symbian_camera_snapshot
-call :compileTest AdvancedTouchFeedback advancedtouchfeedback
-call :compileTest CHWRMHaptics chwrmhaptics
-call :compileTest MDS mds
-call :compileTest MDS_25 mds_25
-call :compileTest MDS_25_92MCL mds_25_92mcl
-if "%NFC_SYMBIAN%" == "auto" (
- call :compileTest Symbian_NFC nfc_symbian
-) else (
- echo nfc_symbian_enabled = no >> %PROJECT_CONFIG%
-)
-call :compileTest BTEngineConnectionManager_Symbian btengconnman_symbian
-call :compileTest BTEngineDeviceManager_Symbian btengdevman_symbian
-call :compileTest LockandFlipKeys LockandFlipPSkeys
-call :compileTest FmTxClientCheck FmTxClient
-call :compileTest DiskNotifyClientCheck DiskNotifyClient
-call :compileTest ThermalStatus_Symbian thermalstatus_symbian
-call :compileTest Flextimer_Symbian symbianflextimer
-call :compileTest ETelPacketservice_symbian etelpacketservice_symbian
-call :compileTest mmf_http_cookies mmf_http_cookies
-goto noTests
-
-:windowsTests
-
-call :compileTest DirectShow directshow
-call :compileTest WindowsMediaSDK wmsdk
-call :compileTest WindowMediaPlayer wmp
-call :compileTest EnhancedVideoRenderer evr
-
-:noTests
-
-echo End of compile tests
-echo.
-echo.
-goto processHeaders
-
-:platformconfig
-
-echo.
-echo Skipping configure tests
-echo Loading ... features\platformconfig\%PLATFORM_CONFIG%.pri
-
-if not exist "%SOURCE_PATH%\features\platformconfig\%PLATFORM_CONFIG%.pri" (
- echo >&2Invalid platform configuration %PLATFORM_CONFIG%.pri
- goto errorTag
-)
-echo include($${QT_MOBILITY_SOURCE_TREE}/features/platformconfig/%PLATFORM_CONFIG%.pri) >> %PROJECT_CONFIG%
-
-:processHeaders
-REM we could skip generating headers if a module is not enabled
-if not exist "%BUILD_PATH%\features" mkdir %BUILD_PATH%\features
-if not exist "%BUILD_PATH%\features\strict_flags.prf" copy %SOURCE_PATH%\features\strict_flags.prf %BUILD_PATH%\features
-
-echo Generating Mobility Headers...
-rd /s /q %BUILD_PATH%\include
-mkdir %BUILD_PATH%\include
-perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\global
-
-set MODULES_TEMP=%MOBILITY_MODULES%
-
-:generateHeaders
-
-for /f "tokens=1,*" %%a in ("%MODULES_TEMP%") do (
- set FIRST=%%a
- set REMAINING=%%b
-)
-
-if %FIRST% == bearer (
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtBearer %SOURCE_PATH%\src\bearer
-) else if %FIRST% == contacts (
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtContacts %SOURCE_PATH%\src\contacts
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtContacts %SOURCE_PATH%\src\contacts\requests
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtContacts %SOURCE_PATH%\src\contacts\filters
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtContacts %SOURCE_PATH%\src\contacts\details
-) else if %FIRST% == location (
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtLocation %SOURCE_PATH%\src\location
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtLocation %SOURCE_PATH%\src\location\landmarks
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtLocation %SOURCE_PATH%\src\location\maps
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtLocation %SOURCE_PATH%\src\location\maps\tiled
-) else if %FIRST% == messaging (
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtMessaging %SOURCE_PATH%\src\messaging
-) else if %FIRST% == multimedia (
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtMultimediaKit %SOURCE_PATH%\src\multimedia
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtMultimediaKit %SOURCE_PATH%\src\multimedia\audio
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtMultimediaKit %SOURCE_PATH%\src\multimedia\video
-) else if %FIRST% == publishsubscribe (
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtPublishSubscribe %SOURCE_PATH%\src\publishsubscribe
-) else if %FIRST% == systeminfo (
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtSystemInfo %SOURCE_PATH%\src\systeminfo
-) else if %FIRST% == serviceframework (
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtServiceFramework %SOURCE_PATH%\src\serviceframework
-) else if %FIRST% == versit (
- REM versit implies contacts. organizer includes might also be necessary
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtVersit %SOURCE_PATH%\src\versit
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtContacts %SOURCE_PATH%\src\contacts
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtContacts %SOURCE_PATH%\src\contacts\requests
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtContacts %SOURCE_PATH%\src\contacts\filters
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtContacts %SOURCE_PATH%\src\contacts\details
- if %ORGANIZER_REQUESTED% == yes (
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtVersitOrganizer %SOURCE_PATH%\src\versitorganizer
- )
-) else if %FIRST% == sensors (
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtSensors %SOURCE_PATH%\src\sensors
-) else if %FIRST% == gallery (
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtGallery %SOURCE_PATH%\src\gallery
-) else if %FIRST% == organizer (
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtOrganizer %SOURCE_PATH%\src\organizer
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtOrganizer %SOURCE_PATH%\src\organizer\items
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtOrganizer %SOURCE_PATH%\src\organizer\requests
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtOrganizer %SOURCE_PATH%\src\organizer\filters
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtOrganizer %SOURCE_PATH%\src\organizer\details
-) else if %FIRST% == feedback (
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtFeedback %SOURCE_PATH%\src\feedback
-) else if %FIRST% == connectivity (
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtConnectivity %SOURCE_PATH%\src\connectivity
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtConnectivity %SOURCE_PATH%\src\connectivity\nfc
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtConnectivity %SOURCE_PATH%\src\connectivity\bluetooth
- REM connectivity/nfc implies sfw
- perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtServiceFramework %SOURCE_PATH%\src\serviceframework
-)
-
-if "%REMAINING%" == "" (
- shift
-) else (
- set MODULES_TEMP=%REMAINING%
- goto generateHeaders
-)
-
-SET REMAINING=
-SET FIRST=
-SET MODULES_TEMP=
-
-if exist config.pri del config.pri
-ren %PROJECT_CONFIG% config.pri
-
-echo.
-echo Running qmake...
-call %QT_PATH%qmake -recursive %VC_TEMPLATE_OPTION% %SOURCE_PATH%\qtmultimediakit.pro
-if errorlevel 1 goto qmakeRecError
-echo.
-echo configure has finished. You may run %MOBILITY_MAKE% to build the project now.
-goto exitTag
-
-:qmakeRecError
-echo.
-echo configure failed.
-goto errorTag
-
-REM Unset the internal variables
-:errorTag
-set BUILD_PATH=
-set CURRENTDIR=
-set MOBILITY_MAKE=
-set MOBILITY_BUILDSYSTEM=
-set PROJECT_CONFIG=
-set PROJECT_LOG=
-set QT_MOBILITY_PREFIX=
-set QT_PATH=
-set SOURCE_PATH=
-set MOBILITY_MODULES=
-set MOBILITY_MODULES_UNPARSED=
-set REMAINING=
-set FIRST=
-set MODULES_TEMP=
-set QT_MOBILITY_EXAMPLES=
-set QT_MOBILITY_DEMOS=
-set ORGANIZER_REQUESTED=
-set PLATFORM_CONFIG=
-set LANGUAGES_CONFIG=
-exit /b 1
-
-:exitTag
-set BUILD_PATH=
-set CURRENTDIR=
-set MOBILITY_MAKE=
-set MOBILITY_BUILDSYSTEM=
-set PROJECT_CONFIG=
-set PROJECT_LOG=
-set QT_MOBILITY_PREFIX=
-set QT_PATH=
-set SOURCE_PATH=
-set MOBILITY_MODULES=
-set MOBILITY_MODULES_UNPARSED=
-set REMAINING=
-set FIRST=
-set MODULES_TEMP=
-set QT_MOBILITY_EXAMPLES=
-set QT_MOBILITY_DEMOS=
-set ORGANIZER_REQUESTED=
-set PLATFORM_CONFIG=
-set LANGUAGES_CONFIG=
-exit /b 0
diff --git a/doc/src/snippets/snippets.pro b/doc/src/snippets/snippets.pro index 72459c249..31a3a0992 100644 --- a/doc/src/snippets/snippets.pro +++ b/doc/src/snippets/snippets.pro @@ -1,3 +1,3 @@ TEMPLATE = subdirs -!symbian: SUBDIRS += multimedia-snippets +SUBDIRS += multimedia-snippets diff --git a/examples/audiodevices/audiodevices.pro b/examples/audiodevices/audiodevices.pro index e7904f5a9..3b77ec21b 100644 --- a/examples/audiodevices/audiodevices.pro +++ b/examples/audiodevices/audiodevices.pro @@ -10,10 +10,6 @@ SOURCES = audiodevices.cpp \ FORMS += audiodevicesbase.ui -symbian { - TARGET.CAPABILITY = UserEnvironment WriteDeviceData ReadDeviceData -} - target.path = $$[QT_INSTALL_EXAMPLES]/qtmultimediakit/audiodevices sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtmultimediakit/audiodevices diff --git a/examples/audiodevices/main.cpp b/examples/audiodevices/main.cpp index 451be57b9..7ba26ea16 100644 --- a/examples/audiodevices/main.cpp +++ b/examples/audiodevices/main.cpp @@ -48,11 +48,7 @@ int main(int argv, char **args) app.setApplicationName("Audio Device Test"); AudioTest audio; -#ifdef Q_OS_SYMBIAN - audio.showMaximized(); -#else audio.show(); -#endif return app.exec(); } diff --git a/examples/audiorecorder/audiorecorder.cpp b/examples/audiorecorder/audiorecorder.cpp index e4d28df14..99956c4ae 100644 --- a/examples/audiorecorder/audiorecorder.cpp +++ b/examples/audiorecorder/audiorecorder.cpp @@ -46,7 +46,7 @@ #include "audiorecorder.h" -#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) || defined(SYMBIAN_S60_3X) +#if defined(Q_WS_MAEMO_6) #include "ui_audiorecorder_small.h" #else #include "ui_audiorecorder.h" diff --git a/examples/audiorecorder/audiorecorder.pro b/examples/audiorecorder/audiorecorder.pro index 9b56a8cd2..5ab3ec951 100644 --- a/examples/audiorecorder/audiorecorder.pro +++ b/examples/audiorecorder/audiorecorder.pro @@ -12,15 +12,9 @@ SOURCES = \ maemo*: { FORMS += audiorecorder_small.ui -}else:symbian:contains(S60_VERSION, 3.2)|contains(S60_VERSION, 3.1){ - DEFINES += SYMBIAN_S60_3X - FORMS += audiorecorder_small.ui }else { FORMS += audiorecorder.ui } -symbian: { - TARGET.CAPABILITY = UserEnvironment ReadDeviceData WriteDeviceData -} target.path = $$[QT_INSTALL_EXAMPLES]/qtmultimediakit/audiorecorder sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro diff --git a/examples/audiorecorder/main.cpp b/examples/audiorecorder/main.cpp index 7dee4f807..aff3604a9 100644 --- a/examples/audiorecorder/main.cpp +++ b/examples/audiorecorder/main.cpp @@ -47,11 +47,7 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); AudioRecorder recorder; -#ifdef Q_OS_SYMBIAN - recorder.showMaximized(); -#else recorder.show(); -#endif return app.exec(); }; diff --git a/examples/camera/camera.cpp b/examples/camera/camera.cpp index ab8ebf33d..2fe658ae8 100644 --- a/examples/camera/camera.cpp +++ b/examples/camera/camera.cpp @@ -53,7 +53,7 @@ #include <QtGui> -#if (defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)) && QT_VERSION >= 0x040700 +#if (defined(Q_WS_MAEMO_6)) && QT_VERSION >= 0x040700 #define HAVE_CAMERA_BUTTONS #endif diff --git a/examples/camera/camera.pro b/examples/camera/camera.pro index 6ec82caf5..caa58cb77 100644 --- a/examples/camera/camera.pro +++ b/examples/camera/camera.pro @@ -19,13 +19,6 @@ FORMS += \ videosettings.ui \ imagesettings.ui -symbian { - include(camerakeyevent_symbian/camerakeyevent_symbian.pri) - TARGET.CAPABILITY += UserEnvironment WriteUserData ReadUserData - TARGET.EPOCHEAPSIZE = 0x20000 0x3000000 - LIBS += -lavkon -leiksrv -lcone -leikcore -} - target.path = $$[QT_INSTALL_EXAMPLES]/qtmultimediakit/camera sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtmultimediakit/camera diff --git a/examples/camera/camerakeyevent_symbian/camerakeyevent_symbian.cpp b/examples/camera/camerakeyevent_symbian/camerakeyevent_symbian.cpp deleted file mode 100644 index 30723af40..000000000 --- a/examples/camera/camerakeyevent_symbian/camerakeyevent_symbian.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "camerakeyevent_symbian.h" - -#include <QtGui/QWidget> // WId -#include <eikon.hrh> // EKeyCamera -#include <coecntrl.h> // CCoeControl (WId) -#include <w32std.h> // RWindowbase, RWindowGroup, RWsSession - -QSymbianCameraKeyListener::QSymbianCameraKeyListener(QWidget *widget): - QObject(widget), - m_widget(widget) -{ - if (!m_widget) - return; - - // Get view's native Symbian window - WId windowId = 0; - if (m_widget->internalWinId()) - windowId = m_widget->internalWinId(); - else if (m_widget->parentWidget() && m_widget->effectiveWinId()) - windowId = m_widget->effectiveWinId(); - RWindowBase *window = windowId ? static_cast<RWindowBase*>(windowId->DrawableWindow()) : 0; - - // Get hold of the window group - TInt wGroupId = window ? window->WindowGroupId() : 0; - if (!wGroupId) - return; - RWsSession &wsSession = CCoeEnv::Static()->WsSession(); - TUint wGroupHandle = wsSession.GetWindowGroupHandle(wGroupId); - if (wGroupHandle) { - RWindowGroup wGroup(wsSession); - wGroup.Construct(wGroupHandle); - if (wGroup.CaptureKey(EKeyCamera, 0, 0, 100) < 0) - qWarning("Unable to register for camera capture key events, SwEvent capability may be missing"); - } -} - -QSymbianCameraKeyListener::~QSymbianCameraKeyListener() -{ - if (!m_widget) - return; - - // Get view's native Symbian window - WId windowId = 0; - if (m_widget->internalWinId()) - windowId = m_widget->internalWinId(); - else if (m_widget->parentWidget() && m_widget->effectiveWinId()) - windowId = m_widget->effectiveWinId(); - RWindowBase *window = windowId ? static_cast<RWindowBase*>(windowId->DrawableWindow()) : 0; - - // Get hold of the window group - TInt wGroupId = window ? window->WindowGroupId() : 0; - if (!wGroupId) - return; - RWsSession &wsSession = CCoeEnv::Static()->WsSession(); - TUint wGroupHandle = wsSession.GetWindowGroupHandle(wGroupId); - if (wGroupHandle) { - RWindowGroup wGroup(wsSession); - wGroup.Construct(wGroupHandle); - wGroup.CancelCaptureKey(EKeyCamera); - } -} diff --git a/examples/camera/camerakeyevent_symbian/camerakeyevent_symbian.h b/examples/camera/camerakeyevent_symbian/camerakeyevent_symbian.h deleted file mode 100644 index 4cd5701b9..000000000 --- a/examples/camera/camerakeyevent_symbian/camerakeyevent_symbian.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef CAMERAKEYEVENT_SYMBIAN_H -#define CAMERAKEYEVENT_SYMBIAN_H - -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - * Description: - * This header can be used to register application on Symbian platforms - * for the Camera capture button key events. Application can avoid native - * camera application from starting by not forwarding the key event. - * - * Usage: - * Application needs to include this header and include the needed Symbian - * libraries. Optionally application can include camerakeyevent_symbian.pri - * file. Application can register and unregister for the Camera capture - * key events by creating/destructing the QSymbianCameraKeyListener helper - * object. The widget needs to be shown before it registers for the - * Camera key event. - * - * Libraries needed: - * User needs to define following in the .pro file (or optionally include - * the camerakeyevent_symbian.pri): - * LIBS += -lcone -lws32 - * - * Symbian Capabilities needed: - * To use this header user needs to have SwEvent capability (included in - * the camerakeyevent_symbian.pri): - * TARGET.CAPABILITY += SwEvent - */ - -#include <QtCore/QObject> - -QT_BEGIN_NAMESPACE -QT_FORWARD_DECLARE_CLASS(QWidget) -QT_END_NAMESPACE - -QT_USE_NAMESPACE - -class QSymbianCameraKeyListener : public QObject -{ - Q_OBJECT -public: - QSymbianCameraKeyListener(QWidget *parent = 0); - ~QSymbianCameraKeyListener(); -private: - QWidget *m_widget; -}; - -#endif // CAMERAKEYEVENT_SYMBIAN_H diff --git a/examples/camera/camerakeyevent_symbian/camerakeyevent_symbian.pri b/examples/camera/camerakeyevent_symbian/camerakeyevent_symbian.pri deleted file mode 100644 index 097c3b245..000000000 --- a/examples/camera/camerakeyevent_symbian/camerakeyevent_symbian.pri +++ /dev/null @@ -1,7 +0,0 @@ -message("camerakeyevent_symbian: Including Symbian camera capture key event register methods") - -HEADERS += $$PWD/camerakeyevent_symbian.h -SOURCES += $$PWD/camerakeyevent_symbian.cpp -INCLUDEPATH += $$PWD -LIBS *= -lcone -lws32 -TARGET.CAPABILITY *= SwEvent diff --git a/examples/camera/main.cpp b/examples/camera/main.cpp index 7fd9a61f7..de55437c3 100644 --- a/examples/camera/main.cpp +++ b/examples/camera/main.cpp @@ -39,34 +39,15 @@ ****************************************************************************/ #include "camera.h" -#ifdef Q_OS_SYMBIAN -#include "camerakeyevent_symbian.h" -#endif // Q_OS_SYMBIAN #include <QtGui> int main(int argc, char *argv[]) { -#if defined (Q_OS_SYMBIAN) - QApplication::setGraphicsSystem("raster"); QApplication app(argc, argv); - // lock orientation before constructing camera - CAknAppUi* appUi = dynamic_cast<CAknAppUi*>(CEikonEnv::Static()->AppUi()); - if(appUi){ - QT_TRAP_THROWING(appUi ->SetOrientationL(CAknAppUi::EAppUiOrientationLandscape)); - } -#else - QApplication app(argc, argv); -#endif Camera camera; - -#ifdef Q_OS_SYMBIAN - camera.showMaximized(); - new QSymbianCameraKeyListener(&camera); -#else camera.show(); -#endif - + return app.exec(); }; diff --git a/examples/declarative-camera/camerakeyevent_symbian/camerakeyevent_symbian.cpp b/examples/declarative-camera/camerakeyevent_symbian/camerakeyevent_symbian.cpp deleted file mode 100644 index 30723af40..000000000 --- a/examples/declarative-camera/camerakeyevent_symbian/camerakeyevent_symbian.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "camerakeyevent_symbian.h" - -#include <QtGui/QWidget> // WId -#include <eikon.hrh> // EKeyCamera -#include <coecntrl.h> // CCoeControl (WId) -#include <w32std.h> // RWindowbase, RWindowGroup, RWsSession - -QSymbianCameraKeyListener::QSymbianCameraKeyListener(QWidget *widget): - QObject(widget), - m_widget(widget) -{ - if (!m_widget) - return; - - // Get view's native Symbian window - WId windowId = 0; - if (m_widget->internalWinId()) - windowId = m_widget->internalWinId(); - else if (m_widget->parentWidget() && m_widget->effectiveWinId()) - windowId = m_widget->effectiveWinId(); - RWindowBase *window = windowId ? static_cast<RWindowBase*>(windowId->DrawableWindow()) : 0; - - // Get hold of the window group - TInt wGroupId = window ? window->WindowGroupId() : 0; - if (!wGroupId) - return; - RWsSession &wsSession = CCoeEnv::Static()->WsSession(); - TUint wGroupHandle = wsSession.GetWindowGroupHandle(wGroupId); - if (wGroupHandle) { - RWindowGroup wGroup(wsSession); - wGroup.Construct(wGroupHandle); - if (wGroup.CaptureKey(EKeyCamera, 0, 0, 100) < 0) - qWarning("Unable to register for camera capture key events, SwEvent capability may be missing"); - } -} - -QSymbianCameraKeyListener::~QSymbianCameraKeyListener() -{ - if (!m_widget) - return; - - // Get view's native Symbian window - WId windowId = 0; - if (m_widget->internalWinId()) - windowId = m_widget->internalWinId(); - else if (m_widget->parentWidget() && m_widget->effectiveWinId()) - windowId = m_widget->effectiveWinId(); - RWindowBase *window = windowId ? static_cast<RWindowBase*>(windowId->DrawableWindow()) : 0; - - // Get hold of the window group - TInt wGroupId = window ? window->WindowGroupId() : 0; - if (!wGroupId) - return; - RWsSession &wsSession = CCoeEnv::Static()->WsSession(); - TUint wGroupHandle = wsSession.GetWindowGroupHandle(wGroupId); - if (wGroupHandle) { - RWindowGroup wGroup(wsSession); - wGroup.Construct(wGroupHandle); - wGroup.CancelCaptureKey(EKeyCamera); - } -} diff --git a/examples/declarative-camera/camerakeyevent_symbian/camerakeyevent_symbian.h b/examples/declarative-camera/camerakeyevent_symbian/camerakeyevent_symbian.h deleted file mode 100644 index 4cd5701b9..000000000 --- a/examples/declarative-camera/camerakeyevent_symbian/camerakeyevent_symbian.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef CAMERAKEYEVENT_SYMBIAN_H -#define CAMERAKEYEVENT_SYMBIAN_H - -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Mobility Components. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - * Description: - * This header can be used to register application on Symbian platforms - * for the Camera capture button key events. Application can avoid native - * camera application from starting by not forwarding the key event. - * - * Usage: - * Application needs to include this header and include the needed Symbian - * libraries. Optionally application can include camerakeyevent_symbian.pri - * file. Application can register and unregister for the Camera capture - * key events by creating/destructing the QSymbianCameraKeyListener helper - * object. The widget needs to be shown before it registers for the - * Camera key event. - * - * Libraries needed: - * User needs to define following in the .pro file (or optionally include - * the camerakeyevent_symbian.pri): - * LIBS += -lcone -lws32 - * - * Symbian Capabilities needed: - * To use this header user needs to have SwEvent capability (included in - * the camerakeyevent_symbian.pri): - * TARGET.CAPABILITY += SwEvent - */ - -#include <QtCore/QObject> - -QT_BEGIN_NAMESPACE -QT_FORWARD_DECLARE_CLASS(QWidget) -QT_END_NAMESPACE - -QT_USE_NAMESPACE - -class QSymbianCameraKeyListener : public QObject -{ - Q_OBJECT -public: - QSymbianCameraKeyListener(QWidget *parent = 0); - ~QSymbianCameraKeyListener(); -private: - QWidget *m_widget; -}; - -#endif // CAMERAKEYEVENT_SYMBIAN_H diff --git a/examples/declarative-camera/camerakeyevent_symbian/camerakeyevent_symbian.pri b/examples/declarative-camera/camerakeyevent_symbian/camerakeyevent_symbian.pri deleted file mode 100644 index 097c3b245..000000000 --- a/examples/declarative-camera/camerakeyevent_symbian/camerakeyevent_symbian.pri +++ /dev/null @@ -1,7 +0,0 @@ -message("camerakeyevent_symbian: Including Symbian camera capture key event register methods") - -HEADERS += $$PWD/camerakeyevent_symbian.h -SOURCES += $$PWD/camerakeyevent_symbian.cpp -INCLUDEPATH += $$PWD -LIBS *= -lcone -lws32 -TARGET.CAPABILITY *= SwEvent diff --git a/examples/declarative-camera/declarative-camera.pro b/examples/declarative-camera/declarative-camera.pro index 22112bf30..455ea6298 100644 --- a/examples/declarative-camera/declarative-camera.pro +++ b/examples/declarative-camera/declarative-camera.pro @@ -3,10 +3,8 @@ TEMPLATE=app QT += declarative qtquick1 network multimediakit -!maemo5 { - contains(QT_CONFIG, opengl) { - QT += opengl - } +contains(QT_CONFIG, opengl) { + QT += opengl } SOURCES += $$PWD/qmlcamera.cpp @@ -15,13 +13,6 @@ else:TARGET = QmlCamera RESOURCES += declarative-camera.qrc -symbian { - include(camerakeyevent_symbian/camerakeyevent_symbian.pri) - load(data_caging_paths) - TARGET.CAPABILITY += UserEnvironment NetworkServices Location ReadUserData WriteUserData - TARGET.EPOCHEAPSIZE = 0x20000 0x3000000 -} - target.path = $$[QT_INSTALL_EXAMPLES]/qtmultimediakit/qml_camera sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtmultimediakit/qml_camera diff --git a/examples/declarative-camera/qmlcamera.cpp b/examples/declarative-camera/qmlcamera.cpp index 8494e3feb..409b46440 100644 --- a/examples/declarative-camera/qmlcamera.cpp +++ b/examples/declarative-camera/qmlcamera.cpp @@ -47,14 +47,10 @@ #include <QtOpenGL/QGLWidget> #endif -#ifdef Q_OS_SYMBIAN -#include "camerakeyevent_symbian.h" -#endif // Q_OS_SYMBIAN - int main(int argc, char *argv[]) { -#if defined (Q_WS_X11) || defined (Q_WS_MAC) || defined (Q_OS_SYMBIAN) +#if defined (Q_WS_X11) || defined (Q_WS_MAC) //### default to using raster graphics backend for now bool gsSpecified = false; for (int i = 0; i < argc; ++i) { @@ -72,7 +68,7 @@ int main(int argc, char *argv[]) QApplication application(argc, argv); const QString mainQmlApp = QLatin1String("qrc:/declarative-camera.qml"); QDeclarativeView view; -#if !defined(QT_NO_OPENGL) && !defined(Q_WS_MAEMO_5) && !defined(Q_WS_S60) +#if !defined(QT_NO_OPENGL) view.setViewport(new QGLWidget); #endif view.setSource(QUrl(mainQmlApp)); @@ -80,12 +76,9 @@ int main(int argc, char *argv[]) // Qt.quit() called in embedded .qml by default only emits // quit() signal, so do this (optionally use Qt.exit()). QObject::connect(view.engine(), SIGNAL(quit()), qApp, SLOT(quit())); -#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) +#if defined(Q_WS_MAEMO_6) view.setGeometry(application.desktop()->screenGeometry()); view.showFullScreen(); -#ifdef Q_OS_SYMBIAN - new QSymbianCameraKeyListener(&view); -#endif // Q_OS_SYMBIAN #else view.setGeometry(QRect(100, 100, 800, 480)); view.show(); diff --git a/examples/player/main.cpp b/examples/player/main.cpp index 403a085f0..d2de33b0c 100644 --- a/examples/player/main.cpp +++ b/examples/player/main.cpp @@ -52,7 +52,7 @@ int main(int argc, char *argv[]) Player player; -#if defined(Q_OS_SYMBIAN) || defined(Q_WS_SIMULATOR) +#if defined(Q_WS_SIMULATOR) # if (QT_VERSION >= QT_VERSION_CHECK(4, 7, 2)) player.setAttribute(Qt::WA_LockLandscapeOrientation); # else diff --git a/examples/player/player.cpp b/examples/player/player.cpp index 8fa387916..49c160ee0 100644 --- a/examples/player/player.cpp +++ b/examples/player/player.cpp @@ -182,14 +182,7 @@ Player::~Player() void Player::open() { -#ifdef Q_WS_MAEMO_5 - QStringList fileNames; - QString fileName = QFileDialog::getOpenFileName(this, tr("Open Files"), "/"); - if (!fileName.isEmpty()) - fileNames << fileName; -#else QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Open Files")); -#endif addToPlaylist(fileNames); } @@ -405,25 +398,16 @@ void Player::showColorDialog() connect(saturationSlider, SIGNAL(sliderMoved(int)), videoWidget, SLOT(setSaturation(int))); connect(videoWidget, SIGNAL(saturationChanged(int)), saturationSlider, SLOT(setValue(int))); -#if defined(Q_OS_SYMBIAN) - QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok); -#endif QFormLayout *layout = new QFormLayout; layout->addRow(tr("Brightness"), brightnessSlider); layout->addRow(tr("Contrast"), contrastSlider); layout->addRow(tr("Hue"), hueSlider); layout->addRow(tr("Saturation"), saturationSlider); -#if defined(Q_OS_SYMBIAN) - layout->addWidget(buttonBox); -#endif QPushButton *button = new QPushButton(tr("Close")); layout->addRow(button); colorDialog = new QDialog(this); -#if defined(Q_OS_SYMBIAN) - connect(buttonBox, SIGNAL(clicked(QAbstractButton*)), colorDialog, SLOT(hide())); -#endif colorDialog->setWindowTitle(tr("Color Options")); colorDialog->setLayout(layout); diff --git a/examples/player/player.pro b/examples/player/player.pro index c22066dc2..687779f0f 100644 --- a/examples/player/player.pro +++ b/examples/player/player.pro @@ -22,11 +22,6 @@ maemo* { DEFINES += PLAYER_NO_COLOROPTIONS } -symbian { - LIBS += -lavkon -lcone -leikcore - TARGET.CAPABILITY = ReadUserData -} - #install target.path = $$[QT_INSTALL_EXAMPLES]/qtmultimediakit/player sources.files = $$SOURCES $HEADERS $$RESOURCES $$FORMS *.pro diff --git a/examples/player/playercontrols.cpp b/examples/player/playercontrols.cpp index bf4d96b2f..b4f623beb 100644 --- a/examples/player/playercontrols.cpp +++ b/examples/player/playercontrols.cpp @@ -84,7 +84,6 @@ PlayerControls::PlayerControls(QWidget *parent) connect(muteButton, SIGNAL(clicked()), this, SLOT(muteClicked())); -#ifndef Q_WS_MAEMO_5 volumeSlider = new QSlider(Qt::Horizontal, this); volumeSlider->setRange(0, 100); @@ -98,7 +97,6 @@ PlayerControls::PlayerControls(QWidget *parent) rateBox->setCurrentIndex(1); connect(rateBox, SIGNAL(activated(int)), SLOT(updateRate())); -#endif QBoxLayout *layout = new QHBoxLayout; layout->setMargin(0); diff --git a/examples/player/videowidget.cpp b/examples/player/videowidget.cpp index 46f1b33ff..87c9455d6 100644 --- a/examples/player/videowidget.cpp +++ b/examples/player/videowidget.cpp @@ -56,11 +56,6 @@ VideoWidget::VideoWidget(QWidget *parent) void VideoWidget::keyPressEvent(QKeyEvent *event) { -#ifdef Q_OS_SYMBIAN - if (isFullScreen()) - setFullScreen(false); -#endif - if (event->key() == Qt::Key_Escape && isFullScreen()) { showNormal(); @@ -83,13 +78,6 @@ void VideoWidget::mouseDoubleClickEvent(QMouseEvent *event) void VideoWidget::mousePressEvent(QMouseEvent *event) { -#ifdef Q_WS_MAEMO_5 - if (isFullScreen()) - setFullScreen(false); - - event->accept(); -#else QVideoWidget::mousePressEvent(event); -#endif } diff --git a/examples/radio/main.cpp b/examples/radio/main.cpp index 89e2c70b6..959a740f4 100644 --- a/examples/radio/main.cpp +++ b/examples/radio/main.cpp @@ -47,11 +47,7 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); Radio radio; -#ifdef Q_OS_SYMBIAN - radio.showMaximized(); -#else radio.show(); -#endif return app.exec(); }; diff --git a/examples/radio/radio.cpp b/examples/radio/radio.cpp index b37b0b551..93f44c05e 100644 --- a/examples/radio/radio.cpp +++ b/examples/radio/radio.cpp @@ -55,9 +55,6 @@ Radio::Radio() QWidget *window = new QWidget; QVBoxLayout* layout = new QVBoxLayout; QHBoxLayout* buttonBar = new QHBoxLayout; -#if defined Q_OS_SYMBIAN // this is so that we can see all buttons also in 3.1 devices, where the screens are smaller.. - QHBoxLayout* buttonBar2 = new QHBoxLayout; -#endif QHBoxLayout* topBar = new QHBoxLayout; layout->addLayout(topBar); @@ -72,22 +69,13 @@ Radio::Radio() else signal->setText(tr("No radio found")); topBar->addWidget(signal); -#if defined Q_WS_MAEMO_5 - QSpacerItem *spacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum); - topBar->addItem(spacer); - volumeSlider = new QSlider(Qt::Horizontal,this); -#else volumeSlider = new QSlider(Qt::Vertical,this); -#endif volumeSlider->setRange(0,100); volumeSlider->setValue(50); connect(volumeSlider,SIGNAL(valueChanged(int)),this,SLOT(updateVolume(int))); topBar->addWidget(volumeSlider); layout->addLayout(buttonBar); -#if defined Q_OS_SYMBIAN - layout->addLayout(buttonBar2); -#endif searchLeft = new QPushButton; searchLeft->setText(tr("scan Down")); @@ -97,20 +85,12 @@ Radio::Radio() left = new QPushButton; left->setText(tr("Freq Down")); connect(left,SIGNAL(clicked()),SLOT(freqDown())); -#if defined Q_OS_SYMBIAN - buttonBar2->addWidget(left); -#else buttonBar->addWidget(left); -#endif right = new QPushButton; connect(right,SIGNAL(clicked()),SLOT(freqUp())); right->setText(tr("Freq Up")); -#if defined Q_OS_SYMBIAN - buttonBar2->addWidget(right); -#else buttonBar->addWidget(right); -#endif searchRight = new QPushButton; searchRight->setText(tr("scan Up")); diff --git a/examples/radio/radio.pro b/examples/radio/radio.pro index b0b9ff3dc..db4bb0d4d 100644 --- a/examples/radio/radio.pro +++ b/examples/radio/radio.pro @@ -10,10 +10,6 @@ SOURCES = \ main.cpp \ radio.cpp -symbian: { - TARGET.CAPABILITY = UserEnvironment WriteDeviceData ReadDeviceData SwEvent -} - target.path = $$[QT_INSTALL_EXAMPLES]/qtmultimediakit/radio sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtmultimediakit/radio diff --git a/examples/slideshow/main.cpp b/examples/slideshow/main.cpp index 665c0490d..cd31372af 100644 --- a/examples/slideshow/main.cpp +++ b/examples/slideshow/main.cpp @@ -47,11 +47,7 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); SlideShow slideShow; -#ifdef Q_OS_SYMBIAN - slideShow.showMaximized(); -#else slideShow.show(); -#endif return app.exec(); } diff --git a/examples/slideshow/slideshow.pro b/examples/slideshow/slideshow.pro index e969ade66..017addd7a 100644 --- a/examples/slideshow/slideshow.pro +++ b/examples/slideshow/slideshow.pro @@ -10,11 +10,6 @@ SOURCES = \ main.cpp \ slideshow.cpp -symbian { - TARGET.CAPABILITY = NetworkServices - TARGET.EPOCHEAPSIZE = 0x20000 0x3000000 -} - target.path = $$[QT_INSTALL_EXAMPLES]/qtmultimediakit/slideshow sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qtmultimediakit/slideshow diff --git a/examples/spectrum/3rdparty/fftreal/fftreal.pro b/examples/spectrum/3rdparty/fftreal/fftreal.pro index 6c0ecbf4c..2c667ef76 100644 --- a/examples/spectrum/3rdparty/fftreal/fftreal.pro +++ b/examples/spectrum/3rdparty/fftreal/fftreal.pro @@ -31,16 +31,10 @@ SOURCES += fftreal_wrapper.cpp DEFINES += FFTREAL_LIBRARY -symbian { - # Provide unique ID for the generated binary, required by Symbian OS - TARGET.UID3 = 0xA000E403 - TARGET.CAPABILITY = UserEnvironment -} - macx { CONFIG += lib_bundle } else { - !symbian: DESTDIR = ../..$${spectrum_build_dir} + DESTDIR = ../..$${spectrum_build_dir} } # Install diff --git a/examples/spectrum/app/app.pro b/examples/spectrum/app/app.pro index edb7e4fdd..120ea43c1 100644 --- a/examples/spectrum/app/app.pro +++ b/examples/spectrum/app/app.pro @@ -44,30 +44,15 @@ INCLUDEPATH += $${fftreal_dir} RESOURCES = spectrum.qrc -symbian { - # Platform security capability required to record audio on Symbian - TARGET.CAPABILITY = UserEnvironment - - # Provide unique ID for the generated binary, required by Symbian OS - TARGET.UID3 = 0xA000E402 -} - - # Dynamic linkage against FFTReal DLL !contains(DEFINES, DISABLE_FFT) { - symbian { - # Must explicitly add the .dll suffix to ensure dynamic linkage - LIBS += -lfftreal.dll - QMAKE_LIBDIR += $${fftreal_dir} + macx { + # Link to fftreal framework + LIBS += -F$${fftreal_dir} + LIBS += -framework fftreal } else { - macx { - # Link to fftreal framework - LIBS += -F$${fftreal_dir} - LIBS += -framework fftreal - } else { - LIBS += -L..$${spectrum_build_dir} - LIBS += -lfftreal - } + LIBS += -L..$${spectrum_build_dir} + LIBS += -lfftreal } } @@ -81,37 +66,26 @@ INSTALLS += sources images # Deployment -symbian { - CONFIG += qt_demo - +DESTDIR = ..$${spectrum_build_dir} +macx { !contains(DEFINES, DISABLE_FFT) { - # Include FFTReal DLL in the SIS file - fftreal.files = ../fftreal.dll - fftreal.path = !:/sys/bin - DEPLOYMENT += fftreal + # Relocate fftreal.framework into spectrum.app bundle + framework_dir = ../spectrum.app/Contents/Frameworks + framework_name = fftreal.framework/Versions/1/fftreal + QMAKE_POST_LINK = \ + mkdir -p $${framework_dir} &&\ + rm -rf $${framework_dir}/fftreal.framework &&\ + cp -R $${fftreal_dir}/fftreal.framework $${framework_dir} &&\ + install_name_tool -id @executable_path/../Frameworks/$${framework_name} \ + $${framework_dir}/$${framework_name} &&\ + install_name_tool -change $${framework_name} \ + @executable_path/../Frameworks/$${framework_name} \ + ../spectrum.app/Contents/MacOS/spectrum } } else { - DESTDIR = ..$${spectrum_build_dir} - macx { - !contains(DEFINES, DISABLE_FFT) { - # Relocate fftreal.framework into spectrum.app bundle - framework_dir = ../spectrum.app/Contents/Frameworks - framework_name = fftreal.framework/Versions/1/fftreal - QMAKE_POST_LINK = \ - mkdir -p $${framework_dir} &&\ - rm -rf $${framework_dir}/fftreal.framework &&\ - cp -R $${fftreal_dir}/fftreal.framework $${framework_dir} &&\ - install_name_tool -id @executable_path/../Frameworks/$${framework_name} \ - $${framework_dir}/$${framework_name} &&\ - install_name_tool -change $${framework_name} \ - @executable_path/../Frameworks/$${framework_name} \ - ../spectrum.app/Contents/MacOS/spectrum - } - } else { - linux-g++*: { - # Provide relative path from application to fftreal library - QMAKE_LFLAGS += -Wl,--rpath=\\\$\$ORIGIN - } + linux-g++*: { + # Provide relative path from application to fftreal library + QMAKE_LFLAGS += -Wl,--rpath=\\\$\$ORIGIN } } diff --git a/examples/spectrum/app/main.cpp b/examples/spectrum/app/main.cpp index 0e7c457b1..ca4f078db 100644 --- a/examples/spectrum/app/main.cpp +++ b/examples/spectrum/app/main.cpp @@ -47,11 +47,7 @@ int main(int argc, char **argv) app.setApplicationName("QtMultimediaKit spectrum analyzer"); MainWidget w; -#ifdef Q_OS_SYMBIAN - w.showMaximized(); -#else w.show(); -#endif return app.exec(); } diff --git a/examples/spectrum/app/mainwidget.cpp b/examples/spectrum/app/mainwidget.cpp index 2bb35c51f..b5cf66e4b 100644 --- a/examples/spectrum/app/mainwidget.cpp +++ b/examples/spectrum/app/mainwidget.cpp @@ -149,12 +149,7 @@ void MainWidget::infoMessage(const QString &message, int timeoutMs) void MainWidget::errorMessage(const QString &heading, const QString &detail) { -#ifdef Q_OS_SYMBIAN - const QString message = heading + "\n" + detail; - QMessageBox::warning(this, "", message, QMessageBox::Close); -#else QMessageBox::warning(this, heading, detail, QMessageBox::Close); -#endif } void MainWidget::timerEvent(QTimerEvent *event) diff --git a/examples/spectrum/spectrum.pro b/examples/spectrum/spectrum.pro index e5113be6d..43e04664b 100644 --- a/examples/spectrum/spectrum.pro +++ b/examples/spectrum/spectrum.pro @@ -13,15 +13,6 @@ SUBDIRS += app TARGET = spectrum -symbian { - # Create a 'make sis' rule which can be run from the top-level - - CONFIG += qt_demo - - # UID for the SIS file - TARGET.UID3 = 0xA000E402 -} - sources.files = README.txt spectrum.pri spectrum.pro TODO.txt sources.path = $$[QT_INSTALL_EXAMPLES]/qtmultimediakit/spectrum INSTALLS += sources diff --git a/examples/videographicsitem/videographicsitem.pro b/examples/videographicsitem/videographicsitem.pro index 4738dfa64..4924ab551 100644 --- a/examples/videographicsitem/videographicsitem.pro +++ b/examples/videographicsitem/videographicsitem.pro @@ -3,7 +3,7 @@ TARGET = videographicsitem QT += multimediakit -!symbian:contains(QT_CONFIG, opengl): QT += opengl +contains(QT_CONFIG, opengl): QT += opengl HEADERS += videoplayer.h \ videoitem.h diff --git a/examples/videographicsitem/videoplayer.cpp b/examples/videographicsitem/videoplayer.cpp index 48df7f36b..14e591fc4 100644 --- a/examples/videographicsitem/videoplayer.cpp +++ b/examples/videographicsitem/videoplayer.cpp @@ -44,7 +44,7 @@ #include <QtGui> #include <qvideosurfaceformat.h> -#if !defined(QT_NO_OPENGL) && !defined(Q_OS_SYMBIAN) +#if !defined(QT_NO_OPENGL) # include <QtOpenGL/QGLWidget> #endif @@ -60,7 +60,7 @@ VideoPlayer::VideoPlayer(QWidget *parent, Qt::WindowFlags flags) QGraphicsScene *scene = new QGraphicsScene(this); QGraphicsView *graphicsView = new QGraphicsView(scene); -#if !defined(QT_NO_OPENGL) && !defined(Q_OS_SYMBIAN) +#if !defined(QT_NO_OPENGL) graphicsView->setViewport(new QGLWidget); #endif diff --git a/src/multimediakit/audio/qaudiodeviceinfo_alsa_p.cpp b/src/multimediakit/audio/qaudiodeviceinfo_alsa_p.cpp index bce7039ab..25e5889bd 100644 --- a/src/multimediakit/audio/qaudiodeviceinfo_alsa_p.cpp +++ b/src/multimediakit/audio/qaudiodeviceinfo_alsa_p.cpp @@ -465,7 +465,7 @@ QList<QByteArray> QAudioDeviceInfoInternal::availableDevices(QAudio::Mode mode) if (idx > 0) devices.append("default"); #endif -#if (!defined(Q_WS_MAEMO_5) && !defined(Q_WS_MAEMO_6)) +#if !defined(Q_WS_MAEMO_6) if (devices.size() == 0 && allDevices.size() > 0) return allDevices; #endif diff --git a/src/multimediakit/audio/qaudiopluginloader.cpp b/src/multimediakit/audio/qaudiopluginloader.cpp index fc83f7a63..72cfb1804 100644 --- a/src/multimediakit/audio/qaudiopluginloader.cpp +++ b/src/multimediakit/audio/qaudiopluginloader.cpp @@ -102,9 +102,6 @@ QStringList QAudioPluginLoader::pluginList() const #endif for (int j=0; j < files.count(); j++) { const QString &file = files.at(j); -#if defined(Q_WS_MAEMO_5) - if (!file.contains(QLatin1String("n900audio"))) -#endif plugins << pluginsDir.absoluteFilePath(file); } } diff --git a/src/multimediakit/effects/qsoundeffect_pulse_p.cpp b/src/multimediakit/effects/qsoundeffect_pulse_p.cpp index f6abf140e..cb86b8bf3 100644 --- a/src/multimediakit/effects/qsoundeffect_pulse_p.cpp +++ b/src/multimediakit/effects/qsoundeffect_pulse_p.cpp @@ -57,7 +57,7 @@ #include "qsoundeffect_pulse_p.h" -#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) +#if defined(Q_WS_MAEMO_6) #include <pulse/ext-stream-restore.h> #endif @@ -204,7 +204,7 @@ private: case PA_CONTEXT_SETTING_NAME: break; case PA_CONTEXT_READY: - #if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + #if defined(Q_WS_MAEMO_6) pa_ext_stream_restore_read(c, &stream_restore_info_callback, self); pa_ext_stream_restore_set_subscribe_cb(c, &stream_restore_monitor_callback, self); pa_ext_stream_restore_subscribe(c, 1, 0, self); @@ -216,7 +216,7 @@ private: } } -#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) +#if defined(Q_WS_MAEMO_6) static void stream_restore_monitor_callback(pa_context *c, void *userdata) { diff --git a/tests/auto/qaudioinput/qaudioinput.pro b/tests/auto/qaudioinput/qaudioinput.pro index ab3527082..98a92606c 100644 --- a/tests/auto/qaudioinput/qaudioinput.pro +++ b/tests/auto/qaudioinput/qaudioinput.pro @@ -8,12 +8,7 @@ QT += core multimediakit-private # TARGET = tst_qaudioinput # CONFIG += testcase -wince*{ - DEFINES += SRCDIR=\\\"\\\" - QT += gui -} else { - !symbian:DEFINES += SRCDIR=\\\"$$PWD/\\\" -} +DEFINES += SRCDIR=\\\"$$PWD/\\\" HEADERS += wavheader.h SOURCES += wavheader.cpp tst_qaudioinput.cpp diff --git a/tests/auto/qaudioinput/tst_qaudioinput.cpp b/tests/auto/qaudioinput/tst_qaudioinput.cpp index fb5f2e229..9ab2512ca 100755 --- a/tests/auto/qaudioinput/tst_qaudioinput.cpp +++ b/tests/auto/qaudioinput/tst_qaudioinput.cpp @@ -53,10 +53,6 @@ #define AUDIO_BUFFER 192000 -#if defined(Q_OS_SYMBIAN) -#define SRCDIR "" -#endif - #ifndef QTRY_VERIFY2 #define QTRY_VERIFY2(__expr,__msg) \ do { \ diff --git a/tests/auto/qaudiooutput/qaudiooutput.pro b/tests/auto/qaudiooutput/qaudiooutput.pro index 2a3749e83..6a6804287 100644 --- a/tests/auto/qaudiooutput/qaudiooutput.pro +++ b/tests/auto/qaudiooutput/qaudiooutput.pro @@ -8,12 +8,7 @@ QT += core multimediakit-private # TARGET = tst_qaudiooutput # CONFIG += testcase -wince*: { - DEFINES += SRCDIR=\\\"\\\" - QT += gui -} else { - !symbian:DEFINES += SRCDIR=\\\"$$PWD/\\\" -} +DEFINES += SRCDIR=\\\"$$PWD/\\\" HEADERS += wavheader.h SOURCES += wavheader.cpp tst_qaudiooutput.cpp diff --git a/tests/auto/qaudiooutput/tst_qaudiooutput.cpp b/tests/auto/qaudiooutput/tst_qaudiooutput.cpp index 2590af39d..a1b44430c 100755 --- a/tests/auto/qaudiooutput/tst_qaudiooutput.cpp +++ b/tests/auto/qaudiooutput/tst_qaudiooutput.cpp @@ -53,10 +53,6 @@ #define AUDIO_BUFFER 192000 -#if defined(Q_OS_SYMBIAN) -#define SRCDIR "" -#endif - #ifndef QTRY_VERIFY2 #define QTRY_VERIFY2(__expr,__msg) \ do { \ diff --git a/tests/auto/qcamera/qcamera.pro b/tests/auto/qcamera/qcamera.pro index 6ebbe3182..1e6205ac4 100644 --- a/tests/auto/qcamera/qcamera.pro +++ b/tests/auto/qcamera/qcamera.pro @@ -7,9 +7,4 @@ QT += multimediakit-private SOURCES += tst_qcamera.cpp -symbian { - TARGET.CAPABILITY = ALL -TCB - TARGET.EPOCHEAPSIZE = 0x20000 0x3000000 -} - maemo*:CONFIG += insignificant_test diff --git a/tests/auto/qcamerabackend/qcamerabackend.pro b/tests/auto/qcamerabackend/qcamerabackend.pro index 80e853d8b..3162b5443 100644 --- a/tests/auto/qcamerabackend/qcamerabackend.pro +++ b/tests/auto/qcamerabackend/qcamerabackend.pro @@ -7,9 +7,4 @@ QT += multimediakit-private SOURCES += tst_qcamerabackend.cpp -symbian { - TARGET.CAPABILITY = ALL -TCB - TARGET.EPOCHEAPSIZE = 0x20000 0x3000000 -} - maemo*:CONFIG += insignificant_test diff --git a/tests/auto/qcamerabackend/tst_qcamerabackend.cpp b/tests/auto/qcamerabackend/tst_qcamerabackend.cpp index 5497edad0..ef900290c 100644 --- a/tests/auto/qcamerabackend/tst_qcamerabackend.cpp +++ b/tests/auto/qcamerabackend/tst_qcamerabackend.cpp @@ -538,7 +538,7 @@ void tst_QCameraBackend::testCameraCaptureMetadata() void tst_QCameraBackend::testExposureCompensation() { -#if !defined(Q_WS_MAEMO_6) && !defined(Q_WS_MAEMO_5) && !defined(Q_OS_SYMBIAN) +#if !defined(Q_WS_MAEMO_6) QSKIP("Capture exposure parameters are supported only on mobile platforms", SkipAll); #endif @@ -547,12 +547,6 @@ void tst_QCameraBackend::testExposureCompensation() QSignalSpy exposureCompensationSignal(exposure, SIGNAL(exposureCompensationChanged(qreal))); -#ifdef Q_OS_SYMBIAN - // Camera needs to be started, see: QTMOBILITY-1566 - camera.load(); - QTRY_COMPARE(camera.status(), QCamera::LoadedStatus); -#endif // Q_OS_SYMBIAN - //it should be possible to set exposure parameters in Unloaded state QCOMPARE(exposure->exposureCompensation()+1.0, 1.0); exposure->setExposureCompensation(1.0); @@ -591,7 +585,7 @@ void tst_QCameraBackend::testExposureCompensation() void tst_QCameraBackend::testExposureMode() { -#if !defined(Q_WS_MAEMO_6) && !defined(Q_WS_MAEMO_5) && !defined(Q_OS_SYMBIAN) +#if !defined(Q_WS_MAEMO_6) QSKIP("Capture exposure parameters are supported only on mobile platforms", SkipAll); #endif @@ -603,12 +597,6 @@ void tst_QCameraBackend::testExposureMode() #endif QCOMPARE(exposure->exposureMode(), QCameraExposure::ExposureAuto); -#ifdef Q_OS_SYMBIAN - // Camera needs to be started, see: QTMOBILITY-1566 - camera.load(); - QTRY_COMPARE(camera.status(), QCamera::LoadedStatus); -#endif // Q_OS_SYMBIAN - // Night exposure->setExposureMode(QCameraExposure::ExposureNight); QCOMPARE(exposure->exposureMode(), QCameraExposure::ExposureNight); @@ -619,12 +607,6 @@ void tst_QCameraBackend::testExposureMode() camera.unload(); QTRY_COMPARE(camera.status(), QCamera::UnloadedStatus); -#ifdef Q_OS_SYMBIAN - // Camera needs to be started, see: QTMOBILITY-1566 - camera.load(); - QTRY_COMPARE(camera.status(), QCamera::LoadedStatus); -#endif // Q_OS_SYMBIAN - #ifdef Q_WS_MAEMO_6 //resource policy doesn't work correctly when resource is released and immediately requested again. QTest::qWait(250); diff --git a/tests/auto/qgraphicsvideoitem/qgraphicsvideoitem.pro b/tests/auto/qgraphicsvideoitem/qgraphicsvideoitem.pro index 1d8735d42..2db21569f 100644 --- a/tests/auto/qgraphicsvideoitem/qgraphicsvideoitem.pro +++ b/tests/auto/qgraphicsvideoitem/qgraphicsvideoitem.pro @@ -7,6 +7,4 @@ QT += multimediakit-private SOURCES += tst_qgraphicsvideoitem.cpp -symbian: TARGET.CAPABILITY = ReadDeviceData WriteDeviceData - maemo*:CONFIG += insignificant_test diff --git a/tests/auto/qmediaobject/main.cpp b/tests/auto/qmediaobject/main.cpp index 4dc763f11..80cf970ec 100644 --- a/tests/auto/qmediaobject/main.cpp +++ b/tests/auto/qmediaobject/main.cpp @@ -42,10 +42,6 @@ #include <QtTest/QtTest> #include "tst_qmediaobject.h" -#ifdef Q_OS_SYMBIAN -#include "tst_qmediaobject_xa.h" -#include "tst_qmediaobject_mmf.h" -#endif int main(int argc, char**argv) { @@ -53,25 +49,5 @@ int main(int argc, char**argv) int ret; tst_QMediaObject test_api; ret = QTest::qExec(&test_api, argc, argv); -#ifdef Q_OS_SYMBIAN - char *new_argv[3]; - QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + "_xa.log"; - QByteArray bytes = str.toAscii(); - char arg1[] = "-o"; - new_argv[0] = argv[0]; - new_argv[1] = arg1; - new_argv[2] = bytes.data(); - tst_QMetadata_xa test_xa; - ret = QTest::qExec(&test_xa, 3, new_argv); - char *new_argv1[3]; - QString str1 = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + "_s60.log"; - QByteArray bytes1 = str1.toAscii(); - char arg2[] = "-o"; - new_argv1[0] = argv[0]; - new_argv1[1] = arg2; - new_argv1[2] = bytes1.data(); - tst_QMediaObject_mmf test_mmf; - ret = QTest::qExec(&test_mmf, 3, new_argv1); -#endif return ret; } diff --git a/tests/auto/qmediaobject/qmediaobject.pro b/tests/auto/qmediaobject/qmediaobject.pro index 756603ad7..c48a679a2 100644 --- a/tests/auto/qmediaobject/qmediaobject.pro +++ b/tests/auto/qmediaobject/qmediaobject.pro @@ -5,23 +5,6 @@ QT += multimediakit-private # TARGET = tst_qmediaobject # CONFIG += testcase -symbian { - HEADERS += tst_qmediaobject_xa.h - SOURCES += tst_qmediaobject_xa.cpp - TARGET.CAPABILITY = ALL -TCB - - testFiles.sources = testfiles/* - testFiles.path = /Data/testfiles - DEPLOYMENT += testFiles - HEADERS += tst_qmediaobject_mmf.h - SOURCES += tst_qmediaobject_mmf.cpp - TARGET.CAPABILITY = ALL -TCB - - testFiles.sources = testfiles/* - testFiles.path = /Data/testfiles - DEPLOYMENT += testFiles -} - HEADERS+= tst_qmediaobject.h SOURCES += main.cpp tst_qmediaobject.cpp diff --git a/tests/auto/qmediaobject/tst_qmediaobject_mmf.cpp b/tests/auto/qmediaobject/tst_qmediaobject_mmf.cpp deleted file mode 100644 index 7cf5622a5..000000000 --- a/tests/auto/qmediaobject/tst_qmediaobject_mmf.cpp +++ /dev/null @@ -1,278 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $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$ -** -****************************************************************************/ -#include <tst_qmediaobject_mmf.h> - -QT_USE_NAMESPACE - -void tst_QMediaObject_mmf::initTestCase_data() -{ - QTest::addColumn<bool>("valid"); - QTest::addColumn<QMediaContent>("mediaContent"); - QTest::addColumn<bool>("metaDataAvailable"); - - QTest::newRow("TestDataNull") - << false // valid - << QMediaContent() // mediaContent - << false; // metaDataAvailable - - QTest::newRow("test_amr.amr") - << true // valid - << QMediaContent(QUrl("file:///C:/data/testfiles/test_amr.amr")) // mediaContent - << false; // metaDataAvailable - - QTest::newRow("test_flash_video.flv") - << true // valid - << QMediaContent(QUrl("file:///C:/data/testfiles/test_flash_video.flv")) // mediaContent - << false; // metaDataAvailable - - QTest::newRow("test_invalid_extension_mp4.xyz") - << true // valid - << QMediaContent(QUrl("file:///C:/data/testfiles/test_invalid_extension_mp4.xyz")) // mediaContent - << false; // metaDataAvailable - - QTest::newRow("test_invalid_extension_wav.xyz") - << true // valid - << QMediaContent(QUrl("file:///C:/data/testfiles/test_invalid_extension_wav.xyz")) // mediaContent - << false; // metaDataAvailable - - QTest::newRow("test_mp3.mp3") - << true // valid - << QMediaContent(QUrl("file:///C:/data/testfiles/test_mp3.mp3")) // mediaContent -#if !defined(__WINS__) || !defined(__WINSCW__) - << true; // metaDataAvailable -#else - << false; // metaDataAvailable -#endif // !defined(__WINS__) || defined(__WINSCW__) - - QTest::newRow("test_mp3_no_metadata.mp3") - << true // valid - << QMediaContent(QUrl("file:///C:/data/testfiles/test_mp3_no_metadata.mp3")) // mediaContent - << false; // metaDataAvailable - - QTest::newRow("test_mp4.mp4") - << true // valid - << QMediaContent(QUrl("file:///C:/data/testfiles/test_mp4.mp4")) // mediaContent -#if defined(__WINS__) || defined(__WINSCW__) - << true; // metaDataAvailable -#else - << false; // metaDataAvailable -#endif // !defined(__WINS__) || defined(__WINSCW__) - - QTest::newRow("test_wav.wav") - << true // valid - << QMediaContent(QUrl("file:///C:/data/testfiles/test_wav.wav")) // mediaContent - << false; // metaDataAvailable - - QTest::newRow("test_wmv9.wmv") - << true // valid - << QMediaContent(QUrl("file:///C:/data/testfiles/test_wmv9.wmv")) // mediaContent - << false; // metaDataAvailable - - QTest::newRow("test youtube stream") - << true // valid - << QMediaContent(QUrl("rtsp://v3.cache4.c.youtube.com/CkgLENy73wIaPwlU2rm7yu8PFhMYESARFEIJbXYtZ29vZ2xlSARSB3JlbGF0ZWRaDkNsaWNrVGh1bWJuYWlsYPi6_IXT2rvpSgw=/0/0/0/video.3gp")) // mediaContent - << false; // metaDataAvailable -} - -void tst_QMediaObject_mmf::initTestCase() -{ -} - -void tst_QMediaObject_mmf::cleanupTestCase() -{ -} - -void tst_QMediaObject_mmf::init() -{ - qRegisterMetaType<QMediaContent>("QMediaContent"); -} - -void tst_QMediaObject_mmf::cleanup() -{ -} - -void tst_QMediaObject_mmf::isMetaDataAvailable() -{ - QFETCH_GLOBAL(QMediaContent, mediaContent); - QFETCH_GLOBAL(bool, metaDataAvailable); - QMediaPlayer player; - - player.setMedia(mediaContent); - QTest::qWait(700); - QVERIFY(player.isMetaDataAvailable() == metaDataAvailable); -} - -void tst_QMediaObject_mmf::metaData() -{ - QFETCH_GLOBAL(QMediaContent, mediaContent); - QFETCH_GLOBAL(bool, metaDataAvailable); - QMediaPlayer player; - - player.setMedia(mediaContent); - QTest::qWait(700); - const QString artist(QLatin1String("Artist")); - const QString title(QLatin1String("Title")); - - if (player.isMetaDataAvailable()) { - QCOMPARE(player.metaData(QtMultimediaKit::AlbumArtist).toString(), artist); - QCOMPARE(player.metaData(QtMultimediaKit::Title).toString(), title); - } -} - -void tst_QMediaObject_mmf::availableMetaData() -{ - QFETCH_GLOBAL(QMediaContent, mediaContent); - QFETCH_GLOBAL(bool, metaDataAvailable); - QMediaPlayer player; - - player.setMedia(mediaContent); - QTest::qWait(700); - - if (player.isMetaDataAvailable()) { - QList<QtMultimediaKit::MetaData> metaDataKeys = player.availableMetaData(); - QVERIFY(metaDataKeys.count() > 0); - QVERIFY(metaDataKeys.contains(QtMultimediaKit::AlbumArtist)); - QVERIFY(metaDataKeys.contains(QtMultimediaKit::Title)); - } -} - -void tst_QMediaObject_mmf::extendedMetaData() -{ - QFETCH_GLOBAL(QMediaContent, mediaContent); - QMediaPlayer player; - - player.setMedia(mediaContent); - QTest::qWait(700); - const QString artist(QLatin1String("Artist")); - const QString title(QLatin1String("Title")); - - if (player.isMetaDataAvailable()) { - QCOMPARE(player.extendedMetaData(metaDataKeyAsString(QtMultimediaKit::AlbumArtist)).toString(), artist); - QCOMPARE(player.extendedMetaData(metaDataKeyAsString(QtMultimediaKit::Title)).toString(), title); - } -} - -void tst_QMediaObject_mmf::availableExtendedMetaData() -{ - QFETCH_GLOBAL(QMediaContent, mediaContent); - QMediaPlayer player; - - player.setMedia(mediaContent); - QTest::qWait(700); - const QString artist(QLatin1String("Artist")); - const QString title(QLatin1String("Title")); - - if (player.isMetaDataAvailable()) { - QStringList metaDataKeys = player.availableExtendedMetaData(); - QVERIFY(metaDataKeys.count() > 0); -/* qWarning() << "metaDataKeys.count: " << metaDataKeys.count(); - int count = metaDataKeys.count(); - count = count-1; - int i = 0; - while(count >= i) - { - qWarning() << "metaDataKeys "<<i<<"." << metaDataKeys.at(i); - i++; - }*/ - QVERIFY(metaDataKeys.contains(metaDataKeyAsString(QtMultimediaKit::AlbumArtist))); - QVERIFY(metaDataKeys.contains(metaDataKeyAsString(QtMultimediaKit::Title))); - } -} - -QString tst_QMediaObject_mmf::metaDataKeyAsString(QtMultimediaKit::MetaData key) const -{ - switch(key) { - case QtMultimediaKit::Title: return "title"; - case QtMultimediaKit::AlbumArtist: return "artist"; - case QtMultimediaKit::Comment: return "comment"; - case QtMultimediaKit::Genre: return "genre"; - case QtMultimediaKit::Year: return "year"; - case QtMultimediaKit::Copyright: return "copyright"; - case QtMultimediaKit::AlbumTitle: return "album"; - case QtMultimediaKit::Composer: return "composer"; - case QtMultimediaKit::TrackNumber: return "albumtrack"; - case QtMultimediaKit::AudioBitRate: return "audiobitrate"; - case QtMultimediaKit::VideoBitRate: return "videobitrate"; - case QtMultimediaKit::Duration: return "duration"; - case QtMultimediaKit::MediaType: return "contenttype"; - case QtMultimediaKit::SubTitle: - case QtMultimediaKit::Description: - case QtMultimediaKit::Category: - case QtMultimediaKit::Date: - case QtMultimediaKit::UserRating: - case QtMultimediaKit::Keywords: - case QtMultimediaKit::Language: - case QtMultimediaKit::Publisher: - case QtMultimediaKit::ParentalRating: - case QtMultimediaKit::RatingOrganisation: - case QtMultimediaKit::Size: - case QtMultimediaKit::AudioCodec: - case QtMultimediaKit::AverageLevel: - case QtMultimediaKit::ChannelCount: - case QtMultimediaKit::PeakValue: - case QtMultimediaKit::SampleRate: - case QtMultimediaKit::Author: - case QtMultimediaKit::ContributingArtist: - case QtMultimediaKit::Conductor: - case QtMultimediaKit::Lyrics: - case QtMultimediaKit::Mood: - case QtMultimediaKit::TrackCount: - case QtMultimediaKit::CoverArtUrlSmall: - case QtMultimediaKit::CoverArtUrlLarge: - case QtMultimediaKit::Resolution: - case QtMultimediaKit::PixelAspectRatio: - case QtMultimediaKit::VideoFrameRate: - case QtMultimediaKit::VideoCodec: - case QtMultimediaKit::PosterUrl: - case QtMultimediaKit::ChapterNumber: - case QtMultimediaKit::Director: - case QtMultimediaKit::LeadPerformer: - case QtMultimediaKit::Writer: - case QtMultimediaKit::CameraManufacturer: - case QtMultimediaKit::CameraModel: - case QtMultimediaKit::Event: - case QtMultimediaKit::Subject: - default: - break; - } - - return QString(); -} diff --git a/tests/auto/qmediaobject/tst_qmediaobject_mmf.h b/tests/auto/qmediaobject/tst_qmediaobject_mmf.h deleted file mode 100644 index 1a381dec8..000000000 --- a/tests/auto/qmediaobject/tst_qmediaobject_mmf.h +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $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$ -** -****************************************************************************/ - -#ifndef TST_QMEDIAOBJECT_MMF_H -#define TST_QMEDIAOBJECT_MMF_H - -#include <QtTest/QtTest> -#include <QtCore> -#include <QtGui> - -#include <qtmedianamespace.h> -#include <QMediaPlayer> -#include <QMediaPlayerControl> -#include <QMediaPlaylist> -#include <QMediaService> -#include <QMediaStreamsControl> -#include <QVideoWidget> - -QT_USE_NAMESPACE - -class tst_QMediaObject_mmf : public QObject -{ - Q_OBJECT - -public slots: - void initTestCase_data(); - void initTestCase(); - void cleanupTestCase(); - void init(); - void cleanup(); - -private slots: - void isMetaDataAvailable(); - void metaData(); - void availableMetaData(); - void extendedMetaData(); - void availableExtendedMetaData(); - -private: - QString metaDataKeyAsString(QtMultimediaKit::MetaData key) const; -}; - -#endif // TST_QMEDIAOBJECT_MMF_H diff --git a/tests/auto/qmediaobject/tst_qmediaobject_xa.cpp b/tests/auto/qmediaobject/tst_qmediaobject_xa.cpp deleted file mode 100644 index 810a414b8..000000000 --- a/tests/auto/qmediaobject/tst_qmediaobject_xa.cpp +++ /dev/null @@ -1,158 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $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$ -** -****************************************************************************/ - -#include "tst_qmediaobject_xa.h" - -QT_USE_NAMESPACE - -#define WAIT_FOR_CONDITION(a,e) \ - for (int _i = 0; _i < 500; _i += 1) { \ - if ((a) == (e)) break; \ - QTest::qWait(10);} - - -#define WAIT_LONG_FOR_CONDITION(a,e) \ - for (int _i = 0; _i < 1800; _i += 1) { \ - if ((a) == (e)) break; \ - QTest::qWait(100);} - -Q_DECLARE_METATYPE(QtMultimediaKit::MetaData) - -void tst_QMetadata_xa::initTestCase_data() -{ - QTest::addColumn<QMediaContent>("mediaContent"); - QTest::addColumn<int>("count"); - QTest::addColumn<QtMultimediaKit::MetaData>("key"); - QTest::addColumn<qint64>("intValue"); - QTest::addColumn<QString>("strValue"); - - QTest::newRow("testmp3.mp3 - No Metadata") - << QMediaContent(QUrl("file:///C:/data/testfiles/test.mp3")) // mediaContent - << 0 //count - << QtMultimediaKit::Title //key - irrelavant when count 0 - << qint64(-1) //intValue - << QString(); //strValue - - QTest::newRow("JapJap.mp3 - Title") - << QMediaContent(QUrl("file:///C:/data/testfiles/JapJap.mp3")) // mediaContent - << -1 //count - ignore - << QtMultimediaKit::Title //key - << qint64(-1) //intValue - << QString("JapJap");//strValue - - QTest::newRow("JapJap.mp3 - Artist") - << QMediaContent(QUrl("file:///C:/data/testfiles/JapJap.mp3")) // mediaContent - << -1 //count - ignore - << QtMultimediaKit::AlbumArtist //key - << qint64(-1) //intValue - << QString("Screaming trees");//strValue - - QTest::newRow("JapJap.mp3 - Album") - << QMediaContent(QUrl("file:///C:/data/testfiles/JapJap.mp3")) // mediaContent - << -1 //count - ignore - << QtMultimediaKit::AlbumTitle //key - << qint64(-1) //intValue - << QString("Sweet oblivion"); //strValue - - QTest::newRow("JapJap.mp3 - CoverArt") - << QMediaContent(QUrl("file:///C:/data/testfiles/JapJap.mp3")) // mediaContent - << -1 //count - ignore - << QtMultimediaKit::CoverArtImage //key - << qint64(28521) //intValue - << QString("C:/data/testfiles/JapJapCoverArt.jpeg"); //strValue -} - -void tst_QMetadata_xa::initTestCase() -{ - m_player = new QMediaPlayer(); - - // Symbian back end needs coecontrol for creation. - m_widget = new QVideoWidget(); - //m_widget->setMediaObject(m_player); - m_widget->show(); - runonce = false; -} - -void tst_QMetadata_xa::cleanupTestCase() -{ - delete m_player; - delete m_widget; -} - -void tst_QMetadata_xa::init() -{ - qRegisterMetaType<QMediaContent>("QMediaContent"); - qRegisterMetaType<QtMultimediaKit::MetaData>("QtMultimediaKit::MetaData"); -} - -void tst_QMetadata_xa::cleanup() -{ -} - -void tst_QMetadata_xa::testMetadata() -{ - QFETCH_GLOBAL(QMediaContent, mediaContent); - QFETCH_GLOBAL(int, count); - QFETCH_GLOBAL(QtMultimediaKit::MetaData, key); - QFETCH_GLOBAL(QString, strValue); - QFETCH_GLOBAL(qint64, intValue); - - QSignalSpy spy(m_player, SIGNAL(metaDataAvailableChanged(bool))); - m_player->setMedia(mediaContent); - - WAIT_FOR_CONDITION(spy.count(), 1); - //get metadata count - QList<QtMultimediaKit::MetaData> mdList = m_player->availableMetaData (); - QStringList amdList = m_player->availableExtendedMetaData(); - - int numMetadataItems = mdList.size() + amdList.size(); - if (count>=0) //-1 indicate ignore count - QVERIFY(count==numMetadataItems); - - if (numMetadataItems>0 && !strValue.isEmpty()) { - QVariant val = m_player->metaData(key); - - if(key == QtMultimediaKit::CoverArtImage) - val.value<QImage>().save(strValue); - else - QVERIFY(strValue == val.toString()); - } -} diff --git a/tests/auto/qmediaobject/tst_qmediaobject_xa.h b/tests/auto/qmediaobject/tst_qmediaobject_xa.h deleted file mode 100644 index 81dc85095..000000000 --- a/tests/auto/qmediaobject/tst_qmediaobject_xa.h +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $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$ -** -****************************************************************************/ - -#ifndef TST_QMEDIAOBJECT_XA_H -#define TST_QMEDIAOBJECT_XA_H - -#include <QtTest/QtTest> -#include <QtCore> -#include <QtGui> - -#include <QMediaPlayer> -#include <QMediaPlayerControl> -#include <QMediaPlaylist> -#include <QMediaService> -#include <QMediaStreamsControl> -#include <QVideoWidget> - -#include <QList> -#include <QStringList> - -QT_USE_NAMESPACE - -class tst_QMetadata_xa: public QObject -{ - Q_OBJECT - -public slots: - void initTestCase_data(); - void initTestCase(); - void cleanupTestCase(); - void init(); - void cleanup(); - -private slots: - void testMetadata(); - - -private: - void displayImage(QImage); - QMediaPlayer *m_player; - QVideoWidget *m_widget; - bool runonce; -}; - -#endif //TST_QMEDIAOBJECT_XA_H diff --git a/tests/auto/qmediaplayer/main.cpp b/tests/auto/qmediaplayer/main.cpp index 896782eb9..9d17b38e2 100755 --- a/tests/auto/qmediaplayer/main.cpp +++ b/tests/auto/qmediaplayer/main.cpp @@ -43,38 +43,11 @@ #include "tst_qmediaplayer.h" -#ifdef Q_OS_SYMBIAN -#include "tst_qmediaplayer_xa.h" -#include "tst_qmediaplayer_s60.h" -#endif - int main(int argc, char**argv) { QApplication app(argc,argv); int ret; tst_QMediaPlayer test_api; ret = QTest::qExec(&test_api, argc, argv); -#ifdef Q_OS_SYMBIAN -#ifdef HAS_OPENMAXAL_MEDIAPLAY_BACKEND - char *new_argv[3]; - QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + "_s60.log"; - QByteArray bytes = str.toAscii(); - char arg1[] = "-o"; - new_argv[0] = argv[0]; - new_argv[1] = arg1; - new_argv[2] = bytes.data(); - tst_QMediaPlayer_xa test_xa; - ret = QTest::qExec(&test_xa, 3, new_argv); -#endif - char *new_argv1[3]; - QString str1 = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + "_s60.log"; - QByteArray bytes1 = str1.toAscii(); - char arg2[] = "-o"; - new_argv1[0] = argv[0]; - new_argv1[1] = arg2; - new_argv1[2] = bytes1.data(); - tst_QMediaPlayer_s60 test_s60; - ret = QTest::qExec(&test_s60, 3, new_argv1); -#endif return ret; } diff --git a/tests/auto/qmediaplayer/qmediaplayer.pro b/tests/auto/qmediaplayer/qmediaplayer.pro index b624afd91..0c2880e0d 100644 --- a/tests/auto/qmediaplayer/qmediaplayer.pro +++ b/tests/auto/qmediaplayer/qmediaplayer.pro @@ -5,21 +5,6 @@ QT += network multimediakit-private # TARGET = tst_qmediaplayer # CONFIG += testcase -symbian { - TARGET.CAPABILITY = NetworkServices - testFiles.sources = testfiles/* - testFiles.path = /Data/testfiles - DEPLOYMENT += testFiles - contains(openmaxal_symbian_enabled, no) { - DEFINES += HAS_OPENMAXAL_MEDIAPLAY_BACKEND - HEADERS += tst_qmediaplayer_xa.h - SOURCES += tst_qmediaplayer_xa.cpp - } else { - HEADERS += tst_qmediaplayer_s60.h - SOURCES += tst_qmediaplayer_s60.cpp - } -} - HEADERS += tst_qmediaplayer.h SOURCES += main.cpp tst_qmediaplayer.cpp diff --git a/tests/auto/qmediaplayer/tst_qmediaplayer_s60.cpp b/tests/auto/qmediaplayer/tst_qmediaplayer_s60.cpp deleted file mode 100755 index f30934a96..000000000 --- a/tests/auto/qmediaplayer/tst_qmediaplayer_s60.cpp +++ /dev/null @@ -1,1708 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $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 "tst_qmediaplayer_s60.h" -#include <qmediastreamscontrol.h> - -static const QString TestFilePath = QLatin1String("c:/data/testfiles/"); - -// Comment out the following line if the test device does not have network -// access. -#define TEST_DEVICE_HAS_NETWORK_ACCESS - -QT_USE_NAMESPACE - -void tst_QMediaPlayer_s60::initTestCase_data() -{ -#ifdef __WINSCW__ - initTestCase_data_default_winscw(); -#else - initTestCase_data_default_armv5(); -#endif -} - -void tst_QMediaPlayer_s60::initTestCase_data_default_armv5() -{ - QTest::addColumn<bool>("valid"); - QTest::addColumn<bool>("streamable"); - QTest::addColumn<QMediaPlayer::State>("state"); - QTest::addColumn<QMediaPlayer::MediaStatus>("status"); - QTest::addColumn<QMediaContent>("mediaContent"); - QTest::addColumn<qint64>("duration"); - QTest::addColumn<qint64>("position"); - QTest::addColumn<bool>("seekable"); - QTest::addColumn<bool>("seekableWhilePlaying"); - QTest::addColumn<int>("volume"); - QTest::addColumn<bool>("videoAvailable"); - QTest::addColumn<bool>("audioAvailable"); - QTest::addColumn<qreal>("playbackRate"); - QTest::addColumn<QMediaPlayer::Error>("error"); - QTest::addColumn<QString>("errorString"); - - QTest::newRow("TestDataNull") - << false //valid - << false //streamable - << QMediaPlayer::StoppedState // state - << QMediaPlayer::NoMedia // status - << QMediaContent() // mediaContent - << qint64(-1) // duration - << qint64(0) // position - << false // seekable - << false // seekableWhilePlaying - << 50 // volume - << false // videoAvailable - << false //audioAvailable - << qreal(0) // playbackRate - << QMediaPlayer::NoError // error - << QString(); // errorString - - QTest::newRow("test_3gp.3gp") - << true //valid - << false //streamable - << QMediaPlayer::StoppedState // state - << QMediaPlayer::LoadedMedia // status LoadedMedia - << QMediaContent(QUrl::fromLocalFile(TestFilePath + "test_3gp.3gp")) // mediaContent - << qint64(46860) // duration - << qint64(23430) // position (duration/2) - << true // seekable - << true // seekableWhilePlaying - << 50 // volume - << true // videoAvailable - << true //audioAvailable - << qreal(0) // playbackRate - << QMediaPlayer::NoError // error - << QString(); // errorString - - QTest::newRow("test_mp4.mp4") - << true //valid - << false //streamable - << QMediaPlayer::StoppedState // state - << QMediaPlayer::LoadedMedia // status - << QMediaContent(QUrl::fromLocalFile(TestFilePath + "test_mp4.mp4")) // mediaContent - << qint64(2701) // duration - << qint64(1351) // position (duration/2) - << true // seekable - << true // seekableWhilePlaying - << 50 // volume - << true // videoAvailable - << true //audioAvailable - << qreal(0) // playbackRate - << QMediaPlayer::NoError // error - << QString(); // errorString - - QTest::newRow("test_wmv9.wmv") - << true //valid - << false //streamable - << QMediaPlayer::StoppedState // state - << QMediaPlayer::LoadedMedia // status - << QMediaContent(QUrl::fromLocalFile(TestFilePath + "test_wmv9.wmv")) // mediaContent - << qint64(169389) // duration - << qint64(84695) // position (duration/2) - << true // seekable - << false // seekableWhilePlaying - << 50 // volume - << true // videoAvailable - << true //audioAvailable - << qreal(0) // playbackRate - << QMediaPlayer::NoError // error - << QString(); // errorString - - QTest::newRow("test_AAC.dat") - << false //valid - << false //streamable - << QMediaPlayer::StoppedState // state - << QMediaPlayer::InvalidMedia // status - << QMediaContent(QUrl::fromLocalFile(TestFilePath + "test_AAC.dat")) // mediaContent - << qint64(-1) // duration - << qint64(0) // position (duration/2) - << true // seekable - << true // seekableWhilePlaying - << 50 // volume - << false // videoAvailable - << false //audioAvailable - << qreal(0) // playbackRate - << QMediaPlayer::ResourceError // error - << QString(); // errorString - - QTest::newRow("test_amr.amr") - << true // valid - << false //streamable - << QMediaPlayer::StoppedState // state - << QMediaPlayer::LoadedMedia // status - << QMediaContent(QUrl::fromLocalFile(TestFilePath + "test_amr.amr")) // mediaContent - << qint64(14400) // duration - << qint64(7200) // position - << true // seekable - << false // seekableWhilePlaying - << 50 // volume - << false // videoAvailable - << true // audioAvailable - << qreal(0) // playbackRate - << QMediaPlayer::NoError // error - << QString(); // errorString - - QTest::newRow("test_mp3.mp3") - << true // valid - << false //streamable - << QMediaPlayer::StoppedState // state - << QMediaPlayer::LoadedMedia // status - << QMediaContent(QUrl::fromLocalFile(TestFilePath + "test_mp3.mp3")) // mediaContent - << qint64(102044) //qint64(102044) duration - << qint64(51022) // position - << true // seekable - << true // seekableWhilePlaying - << 50 // volume - << false // videoAvailable - << true // audioAvailable - << qreal(0) // playbackRate - << QMediaPlayer::NoError // error - << QString(); // errorString - -#ifdef TEST_DEVICE_HAS_NETWORK_ACCESS - QTest::newRow("test_stream 3gp") - << false // valid - << true //streamable - << QMediaPlayer::StoppedState // state - << QMediaPlayer::LoadedMedia // status - << QMediaContent(QUrl("rtsp://v3.cache4.c.youtube.com/CkgLENy73wIaPwlU2rm7yu8PFhMYESARFEIJbXYtZ29vZ2xlSARSB3JlbGF0ZWRaDkNsaWNrVGh1bWJuYWlsYPi6_IXT2rvpSgw=/0/0/0/video.3gp")) // mediaContent - << qint64(103000) // duration - << qint64(0) // position - << false // seekable - << false // seekableWhilePlaying - << 50 // volume - << true // videoAvailable - << true // audioAvailable - << qreal(0) // playbackRate - << QMediaPlayer::NoError // error - << QString(); // errorString - - QTest::newRow("RTSP link to H.263/AMR") - << false // valid - << true //streamable - << QMediaPlayer::StoppedState // state - << QMediaPlayer::LoadedMedia // status - << QMediaContent(QUrl("rtsp://v7.cache8.c.youtube.com/CiILENy73wIaGQnNUH6lxLd0MRMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp")) // mediaContent - << qint64(249000) // duration - << qint64(0) // position - << false // seekable - << false // seekableWhilePlaying - << 50 // volume - << true // videoAvailable - << true // audioAvailable - << qreal(0) // playbackRate - << QMediaPlayer::NoError // error - << QString(); // errorString - - QTest::newRow("RTSP link to MPEG-4/AAC") - << false // valid - << true //streamable - << QMediaPlayer::StoppedState // state - << QMediaPlayer::LoadedMedia // status - << QMediaContent(QUrl("rtsp://v8.cache1.c.youtube.com/CiILENy73wIaGQnNUH6lxLd0MRMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp")) // mediaContent - << qint64(249000) // duration - << qint64(0) // position - << false // seekable - << false // seekableWhilePlaying - << 50 // volume - << true // videoAvailable - << true // audioAvailable - << qreal(0) // playbackRate - << QMediaPlayer::NoError // error - << QString(); // errorString -#endif // TEST_DEVICE_HAS_NETWORK_ACCESS -} - -void tst_QMediaPlayer_s60::initTestCase_data_default_winscw() -{ - QTest::addColumn<bool>("valid"); - QTest::addColumn<bool>("streamable"); - QTest::addColumn<QMediaPlayer::State>("state"); - QTest::addColumn<QMediaPlayer::MediaStatus>("status"); - QTest::addColumn<QMediaContent>("mediaContent"); - QTest::addColumn<qint64>("duration"); - QTest::addColumn<qint64>("position"); - QTest::addColumn<bool>("seekable"); - QTest::addColumn<bool>("seekableWhilePlaying"); - QTest::addColumn<int>("volume"); - QTest::addColumn<bool>("videoAvailable"); - QTest::addColumn<bool>("audioAvailable"); - QTest::addColumn<qreal>("playbackRate"); - QTest::addColumn<QMediaPlayer::Error>("error"); - QTest::addColumn<QString>("errorString"); - - QTest::newRow("TestDataNull") - << false //valid - << false //streamable - << QMediaPlayer::StoppedState // state - << QMediaPlayer::NoMedia // status - << QMediaContent() // mediaContent - << qint64(-1) // duration - << qint64(0) // position - << false // seekable - << false // seekableWhilePlaying - << 50 // volume - << false // videoAvailable - << false //audioAvailable - << qreal(0) // playbackRate - << QMediaPlayer::NoError // error - << QString(); // errorString - - QTest::newRow("test_3GPP.dat") - << true //valid - << false //streamable - << QMediaPlayer::StoppedState // state - << QMediaPlayer::LoadedMedia // status - << QMediaContent(QUrl::fromLocalFile(TestFilePath + "test_3GPP.dat")) // mediaContent - << qint64(7200) // duration - << qint64(3600) // position (duration/2) - << true // seekable - << true // seekableWhilePlaying - << 50 // volume - << true // videoAvailable - << true //audioAvailable - << qreal(0) // playbackRate - << QMediaPlayer::NoError // error - << QString(); // errorString - - QTest::newRow("test_3gp.3gp") - << true //valid - << false //streamable - << QMediaPlayer::StoppedState // state - << QMediaPlayer::LoadedMedia // status - << QMediaContent(QUrl::fromLocalFile(TestFilePath + "test_3gp.3gp")) // mediaContent - << qint64(46860) // duration - << qint64(23430) // position (duration/2) - << true // seekable - << true // seekableWhilePlaying - << 50 // volume - << true // videoAvailable - << true //audioAvailable - << qreal(0) // playbackRate - << QMediaPlayer::NoError // error - << QString(); // errorString - - QTest::newRow("test_mp4.mp4") - << true //valid - << false //streamable - << QMediaPlayer::StoppedState // state - << QMediaPlayer::LoadedMedia // status - << QMediaContent(QUrl::fromLocalFile(TestFilePath + "test_mp4.mp4")) // mediaContent - << qint64(2701) // duration - << qint64(1351) // position (duration/2) - << true // seekable - << true // seekableWhilePlaying - << 50 // volume - << true // videoAvailable - << false //audioAvailable - << qreal(0) // playbackRate - << QMediaPlayer::FormatError // error - << QString(); // errorString - - QTest::newRow("test_MP4.dat") - << false //valid - << false //streamable - << QMediaPlayer::StoppedState // state - << QMediaPlayer::InvalidMedia // status - << QMediaContent(QUrl::fromLocalFile(TestFilePath + "test_MP4.dat")) // mediaContent - << qint64(-1) // duration - << qint64(0) // position (duration/2) - << true // seekable - << true // seekableWhilePlaying - << 50 // volume - << true // videoAvailable - << false //audioAvailable - << qreal(0) // playbackRate - << QMediaPlayer::AccessDeniedError// error - << QString(); // errorString - - QTest::newRow("test_wmv9.wmv") - << true //valid - << false //streamable - << QMediaPlayer::StoppedState // state - << QMediaPlayer::LoadedMedia // status - << QMediaContent(QUrl::fromLocalFile(TestFilePath + "test_wmv9.wmv")) // mediaContent - << qint64(169389) // duration - << qint64(84695) // position (duration/2) - << true // seekable - << true // seekableWhilePlaying - << 50 // volume - << true // videoAvailable - << false //audioAvailable - << qreal(0) // playbackRate - << QMediaPlayer::FormatError // error - << QString(); // errorString - - QTest::newRow("test_h264_qcif.264") - << false //valid - << false //streamable - << QMediaPlayer::StoppedState // state - << QMediaPlayer::InvalidMedia // status - << QMediaContent(QUrl::fromLocalFile(TestFilePath + "test_h264_qcif.264")) // mediaContent - << qint64(-1) // duration - << qint64(0) // position (duration/2) - << true // seekable - << true // seekableWhilePlaying - << 50 // volume - << false // videoAvailable - << false //audioAvailable - << qreal(0) // playbackRate - << QMediaPlayer::ResourceError // error - << QString(); // errorString - - QTest::newRow("test_RM.dat") - << true //valid - << false //streamable - << QMediaPlayer::StoppedState // state - << QMediaPlayer::LoadedMedia // status - << QMediaContent(QUrl::fromLocalFile(TestFilePath + "test_RM.dat")) // mediaContent - << qint64(20245) // duration - << qint64(10123) // position (duration/2) - << true // seekable - << true // seekableWhilePlaying - << 50 // volume - << true // videoAvailable - << true //audioAvailable - << qreal(0) // playbackRate - << QMediaPlayer::NoError // error - << QString(); // errorString - - QTest::newRow("test_SWF.dat") - << false //valid - << false //streamable - << QMediaPlayer::StoppedState // state - << QMediaPlayer::InvalidMedia // status - << QMediaContent(QUrl::fromLocalFile(TestFilePath + "test_SWF.dat")) // mediaContent - << qint64(-1) // duration - << qint64(0) // position (duration/2) - << true // seekable - << true // seekableWhilePlaying - << 50 // volume - << false // videoAvailable - << false //audioAvailable - << qreal(0) // playbackRate - << QMediaPlayer::ResourceError // error - << QString(); // errorString - - QTest::newRow("test_WMV.dat") - << true //valid - << false //streamable - << QMediaPlayer::StoppedState // state - << QMediaPlayer::LoadedMedia // status - << QMediaContent(QUrl::fromLocalFile(TestFilePath + "test_WMV.dat")) // mediaContent - << qint64(3098) // duration - << qint64(1549) // position (duration/2) - << true // seekable - << true // seekableWhilePlaying, on emulator codec leaks memory and causes alloc panic on dtor - << 50 // volume - << true // videoAvailable - << false //audioAvailable - << qreal(0) // playbackRate - << QMediaPlayer::FormatError // error - << QString(); // errorString - - QTest::newRow("test_WMA.dat") - << false //valid - << false //streamable - << QMediaPlayer::StoppedState // state - << QMediaPlayer::InvalidMedia // status - << QMediaContent(QUrl::fromLocalFile(TestFilePath + "test_WMA.dat")) // mediaContent - << qint64(-1) // duration - << qint64(0) // position (duration/2) - << true // seekable - << true // seekableWhilePlaying - << 50 // volume - << true // videoAvailable - << false //audioAvailable - << qreal(0) // playbackRate - << QMediaPlayer::AccessDeniedError // error - << QString(); // errorString - - QTest::newRow("test_flash_video.flv") - << false // valid - << false //streamable - << QMediaPlayer::StoppedState // state - << QMediaPlayer::InvalidMedia // status - << QMediaContent(QUrl::fromLocalFile(TestFilePath + "test_flash_video.flv")) // mediaContent - << qint64(-1) // duration - << qint64(0) // position - << true // seekable - << true // seekableWhilePlaying - << 50 // volume - << false // videoAvailable - << false //audioAvailable - << qreal(0) // playbackRate - << QMediaPlayer::ResourceError // error - << QString(); // errorString - - QTest::newRow("test_MXMF.dat") - << true //valid - << false //streamable - << QMediaPlayer::StoppedState // state - << QMediaPlayer::LoadedMedia // status - << QMediaContent(QUrl::fromLocalFile(TestFilePath + "test_MXMF.dat")) // mediaContent - << qint64(31980) // duration - << qint64(15990) // position (duration/2) - << true // seekable - << true // seekableWhilePlaying - << 50 // volume - << false // videoAvailable - << true //audioAvailable - << qreal(0) // playbackRate - << QMediaPlayer::NoError // error - << QString(); // errorString - - QTest::newRow("test_amr.amr") - << true // valid - << false //streamable - << QMediaPlayer::StoppedState // state - << QMediaPlayer::LoadedMedia // status - << QMediaContent(QUrl::fromLocalFile(TestFilePath + "test_amr.amr")) // mediaContent - << qint64(14402) // duration - << qint64(7200) // position - << true // seekable - << true // seekableWhilePlaying - << 50 // volume - << false // videoAvailable - << true // audioAvailable - << qreal(0) // playbackRate - << QMediaPlayer::NoError // error - << QString(); // errorString - - QTest::newRow("test_AMR.dat") - << true // valid - << false //streamable - << QMediaPlayer::StoppedState // state - << QMediaPlayer::LoadedMedia // status - << QMediaContent(QUrl::fromLocalFile(TestFilePath + "test_AMR.dat")) // mediaContent - << qint64(38509) // duration - << qint64(19255) // position - << true // seekable - << true // seekableWhilePlaying - << 50 // volume - << false // videoAvailable - << true // audioAvailable - << qreal(0) // playbackRate - << QMediaPlayer::NoError // error - << QString(); // errorString - - QTest::newRow("test_mp3.mp3") - << false // valid - << false //streamable - << QMediaPlayer::StoppedState // state - << QMediaPlayer::LoadedMedia // status - << QMediaContent(QUrl::fromLocalFile(TestFilePath + "test_mp3.mp3")) // mediaContent - << qint64(-1) //qint64(102044) duration - << qint64(0) // position - << true // seekable - << true // seekableWhilePlaying - << 50 // volume - << false // videoAvailable - << false // audioAvailable - << qreal(0) // playbackRate - << QMediaPlayer::ResourceError // error - << QString(); // errorString - - QTest::newRow("test_MP3.dat") - << false // valid - << false //streamable - << QMediaPlayer::StoppedState // state - << QMediaPlayer::InvalidMedia // status - << QMediaContent(QUrl::fromLocalFile(TestFilePath + "test_MP3.dat")) // mediaContent - << qint64(-1) //qint64(102044) duration - << qint64(0) // position - << true // seekable - << true // seekableWhilePlaying - << 50 // volume - << false // videoAvailable - << false // audioAvailable - << qreal(0) // playbackRate - << QMediaPlayer::ResourceError // error - << QString(); // errorString - - QTest::newRow("test_MIDI.dat") - << true // valid - << false //streamable - << QMediaPlayer::StoppedState // state - << QMediaPlayer::LoadedMedia // status - << QMediaContent(QUrl::fromLocalFile(TestFilePath + "test_MIDI.dat")) // mediaContent - << qint64(32782) // duration - << qint64(16391) // position - << true // seekable - << true // seekableWhilePlaying - << 50 // volume - << false // videoAvailable - << true // audioAvailable - << qreal(0) // playbackRate - << QMediaPlayer::NoError // error - << QString(); // errorString - - QTest::newRow("test_ACC.dat") - << false // valid - << false //streamable - << QMediaPlayer::StoppedState // state - << QMediaPlayer::InvalidMedia // status - << QMediaContent(QUrl::fromLocalFile(TestFilePath + "test_ACC.dat")) // mediaContent - << qint64(-1) // duration - << qint64(0) // position - << true // seekable - << true // seekableWhilePlaying - << 50 // volume - << false // videoAvailable - << false // audioAvailable - << qreal(0) // playbackRate - << QMediaPlayer::ResourceError // error - << QString(); // errorString - - QTest::newRow("test_WAV.dat") - << true // valid - << false //streamable - << QMediaPlayer::StoppedState // state - << QMediaPlayer::LoadedMedia // status - << QMediaContent(QUrl::fromLocalFile(TestFilePath + "test_WAV.dat")) // mediaContent - << qint64(2864) // duration - << qint64(1432) // position - << true // seekable - << true // seekableWhilePlaying - << 50 // volume - << false // videoAvailable - << true // audioAvailable - << qreal(0) // playbackRate - << QMediaPlayer::NoError // error - << QString(); // errorString - -#ifdef TEST_DEVICE_HAS_NETWORK_ACCESS - QTest::newRow("test_stream") - << false // valid - << true //streamable - << QMediaPlayer::StoppedState // state - << QMediaPlayer::LoadedMedia // status - << QMediaContent(QUrl("rtsp://v3.cache4.c.youtube.com/CkgLENy73wIaPwlU2rm7yu8PFhMYESARFEIJbXYtZ29vZ2xlSARSB3JlbGF0ZWRaDkNsaWNrVGh1bWJuYWlsYPi6_IXT2rvpSgw=/0/0/0/video.3gp")) // mediaContent - << qint64(-1) // duration - << qint64(0) // position - << false // seekable - << false // seekableWhilePlaying - << 50 // volume - << true // videoAvailable - << false // audioAvailable - << qreal(0) // playbackRate - << QMediaPlayer::AccessDeniedError // error - << QString(); // errorString -#endif -} - -void tst_QMediaPlayer_s60::initTestCase() -{ - m_player = new QMediaPlayer(); - - // Symbian back end needs coecontrol for creation. - m_widget = new QVideoWidget(); - m_player->setVideoOutput(m_widget); - m_widget->show(); - runonce = false; -} - -void tst_QMediaPlayer_s60::cleanupTestCase() -{ - delete m_player; - delete m_widget; -} - -void tst_QMediaPlayer_s60::init() -{ - qRegisterMetaType<QMediaPlayer::State>("QMediaPlayer::State"); - qRegisterMetaType<QMediaPlayer::Error>("QMediaPlayer::Error"); - qRegisterMetaType<QMediaPlayer::MediaStatus>("QMediaPlayer::MediaStatus"); - qRegisterMetaType<QMediaContent>("QMediaContent"); -} - -void tst_QMediaPlayer_s60::cleanup() -{ -} - -void tst_QMediaPlayer_s60::testNullService() -{ - if(runonce) - return; - MockProvider_s60 provider(0); - QMediaPlayer player(0, 0, &provider); - - const QIODevice *nullDevice = 0; - - QCOMPARE(player.media(), QMediaContent()); - QCOMPARE(player.mediaStream(), nullDevice); - QCOMPARE(player.state(), QMediaPlayer::StoppedState); - QCOMPARE(player.mediaStatus(), QMediaPlayer::UnknownMediaStatus); - QCOMPARE(player.duration(), qint64(-1)); - QCOMPARE(player.position(), qint64(0)); - QCOMPARE(player.volume(), 0); - QCOMPARE(player.isMuted(), false); - QCOMPARE(player.isVideoAvailable(), false); - QCOMPARE(player.bufferStatus(), 0); - QCOMPARE(player.isSeekable(), false); - QCOMPARE(player.playbackRate(), qreal(0)); - QCOMPARE(player.error(), QMediaPlayer::ServiceMissingError); - - { - QFETCH_GLOBAL(QMediaContent, mediaContent); - - QSignalSpy spy(&player, SIGNAL(mediaChanged(QMediaContent))); - QFile file; - - player.setMedia(mediaContent, &file); - QCOMPARE(player.media(), QMediaContent()); - QCOMPARE(player.mediaStream(), nullDevice); - QCOMPARE(spy.count(), 0); - } { - QSignalSpy stateSpy(&player, SIGNAL(stateChanged(QMediaPlayer::State))); - QSignalSpy statusSpy(&player, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus))); - - player.play(); - QCOMPARE(player.state(), QMediaPlayer::StoppedState); - QCOMPARE(player.mediaStatus(), QMediaPlayer::UnknownMediaStatus); - QCOMPARE(stateSpy.count(), 0); - QCOMPARE(statusSpy.count(), 0); - - player.pause(); - QCOMPARE(player.state(), QMediaPlayer::StoppedState); - QCOMPARE(player.mediaStatus(), QMediaPlayer::UnknownMediaStatus); - QCOMPARE(stateSpy.count(), 0); - QCOMPARE(statusSpy.count(), 0); - - player.stop(); - QCOMPARE(player.state(), QMediaPlayer::StoppedState); - QCOMPARE(player.mediaStatus(), QMediaPlayer::UnknownMediaStatus); - QCOMPARE(stateSpy.count(), 0); - QCOMPARE(statusSpy.count(), 0); - } { - QFETCH_GLOBAL(int, volume); - - QSignalSpy volumeSpy(&player, SIGNAL(volumeChanged(int))); - QSignalSpy mutingSpy(&player, SIGNAL(mutedChanged(bool))); - - player.setVolume(volume); - QCOMPARE(player.volume(), 0); - QCOMPARE(volumeSpy.count(), 0); - - player.setMuted(false); - QCOMPARE(player.isMuted(), false); - QCOMPARE(mutingSpy.count(), 0); - } { - QFETCH_GLOBAL(qint64, position); - - QSignalSpy spy(&player, SIGNAL(positionChanged(qint64))); - - player.setPosition(position); - QCOMPARE(player.position(), qint64(0)); - QCOMPARE(spy.count(), 0); - } { - QFETCH_GLOBAL(qreal, playbackRate); - - QSignalSpy spy(&player, SIGNAL(playbackRateChanged(qreal))); - - player.setPlaybackRate(playbackRate); - QCOMPARE(player.playbackRate(), qreal(0)); - QCOMPARE(spy.count(), 0); - } { - QMediaPlaylist playlist; - player.setPlaylist(&playlist); - - QSignalSpy mediaSpy(&player, SIGNAL(mediaChanged(QMediaContent))); - QSignalSpy statusSpy(&player, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus))); - - playlist.addMedia(QUrl("http://example.com/stream")); - playlist.addMedia(QUrl("file:///some.mp3")); - - playlist.setCurrentIndex(0); - QCOMPARE(playlist.currentIndex(), 0); - QCOMPARE(player.media(), QMediaContent()); - QCOMPARE(mediaSpy.count(), 0); - QCOMPARE(statusSpy.count(), 0); - - playlist.next(); - QCOMPARE(playlist.currentIndex(), 1); - QCOMPARE(player.media(), QMediaContent()); - QCOMPARE(mediaSpy.count(), 0); - QCOMPARE(statusSpy.count(), 0); - } - runonce = true; -} - -void tst_QMediaPlayer_s60::testMedia() -{ - QFETCH_GLOBAL(QMediaContent, mediaContent); - m_player->setMedia(mediaContent); - QTest::qWait(500); - QCOMPARE(m_player->media(), mediaContent); -} - - -void tst_QMediaPlayer_s60::testDuration() -{ - QFETCH_GLOBAL(QMediaContent, mediaContent); - QFETCH_GLOBAL(qint64, duration); - QFETCH_GLOBAL(bool, valid); - - QSignalSpy spy(m_player, SIGNAL(durationChanged(qint64))); - m_player->setMedia(mediaContent); - - if(valid) { - WAIT_FOR_CONDITION(spy.count(), 1); - } else { - WAIT_FOR_CONDITION(m_player->mediaStatus(), (QMediaPlayer::NoMedia || QMediaPlayer::InvalidMedia)); - } - - QVERIFY(m_player->duration() == duration); -} - -void tst_QMediaPlayer_s60::testPosition() -{ - QFETCH_GLOBAL(QMediaContent, mediaContent); - QFETCH_GLOBAL(qint64, duration); - QFETCH_GLOBAL(bool, valid); - QFETCH_GLOBAL(bool, seekable); - QFETCH_GLOBAL(qint64, position); - QFETCH_GLOBAL(QMediaPlayer::MediaStatus, status); - - m_player->setMedia(mediaContent); - - if (valid) { - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - - QCOMPARE(m_player->isSeekable(), seekable); - //QCOMPARE(m_player->mediaStatus(), status); - QVERIFY(m_player->mediaStatus() == status); - - // preset position - { QSignalSpy spy(m_player, SIGNAL(positionChanged(qint64))); - m_player->setPosition(position); - QCOMPARE(m_player->position(), position); - QCOMPARE(spy.count(), 1); - QCOMPARE(spy.at(0).at(0).toLongLong(), position);} - - // same pos second time - { QSignalSpy spy(m_player, SIGNAL(positionChanged(qint64))); - m_player->setPosition(position); - QCOMPARE(m_player->position(), position); - QCOMPARE(spy.count(), 0);} - - //zero pos - { QSignalSpy spy(m_player, SIGNAL(positionChanged(qint64))); - m_player->setPosition(0); - QCOMPARE(m_player->position(), qint64(0)); - QCOMPARE(spy.count(), 1); - QCOMPARE(spy.at(0).at(0).toLongLong(), qint64(0));} - - //end pos - { QSignalSpy spy(m_player, SIGNAL(positionChanged(qint64))); - m_player->setPosition(duration); - QCOMPARE(m_player->position(), duration); - QCOMPARE(spy.count(), 1); - QCOMPARE(spy.at(0).at(0).toLongLong(), duration);} - - //negative pos - { QSignalSpy spy(m_player, SIGNAL(positionChanged(qint64))); - m_player->setPosition(qint64(-1)); - QCOMPARE(m_player->position(), qint64(0)); - QCOMPARE(spy.count(), 1); - QCOMPARE(spy.at(0).at(0).toLongLong(), qint64(0));} - - //over duration - { QSignalSpy spy(m_player, SIGNAL(positionChanged(qint64))); - m_player->setPosition(duration+1); - QCOMPARE(m_player->position(), duration); - QCOMPARE(spy.count(), 1); - QCOMPARE(spy.at(0).at(0).toLongLong(), duration);} - - } else { - if (valid) - WAIT_LONG_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia) - else - WAIT_FOR_CONDITION(m_player->mediaStatus(), (QMediaPlayer::NoMedia || QMediaPlayer::InvalidMedia)) - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE(m_player->isSeekable(), seekable); - QCOMPARE(m_player->mediaStatus(), status); - } -} - -void tst_QMediaPlayer_s60::testPositionWhilePlaying() -{ - QFETCH_GLOBAL(QMediaContent, mediaContent); - QFETCH_GLOBAL(qint64, duration); - QFETCH_GLOBAL(bool, seekableWhilePlaying); - QFETCH_GLOBAL(bool, seekable); - QFETCH_GLOBAL(qint64, position); - QFETCH_GLOBAL(bool, valid); - QFETCH_GLOBAL(bool, streamable); - QFETCH_GLOBAL(QMediaPlayer::MediaStatus, status); - - m_player->setMedia(mediaContent); - - if (streamable) { - WAIT_LONG_FOR_CONDITION(m_player->mediaStatus(), (QMediaPlayer::NoMedia || QMediaPlayer::InvalidMedia || QMediaPlayer::LoadedMedia)); - } else { - WAIT_FOR_CONDITION(m_player->mediaStatus(), (QMediaPlayer::NoMedia || QMediaPlayer::InvalidMedia || QMediaPlayer::LoadedMedia)); - } - - //qDebug()<<""; - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE(m_player->isSeekable(), seekable); - QCOMPARE(m_player->mediaStatus(), status); - - if (seekableWhilePlaying && valid) { - QCOMPARE(m_player->isSeekable(), seekableWhilePlaying); - - // preset position - //qDebug()<<"preset"; - { QSignalSpy spy(m_player, SIGNAL(positionChanged(qint64))); - m_player->play(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - m_player->setPosition(position); - WAIT_FOR_CONDITION(spy.count(), 2); - QVERIFY(m_player->mediaStatus() == QMediaPlayer::BufferingMedia || - m_player->mediaStatus() == QMediaPlayer::BufferedMedia || - m_player->mediaStatus() == QMediaPlayer::EndOfMedia || - m_player->mediaStatus() == QMediaPlayer::LoadedMedia); - - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - QVERIFY(m_player->position()>=position); - QVERIFY(spy.count()!=0);} - - //reset position - m_player->stop(); - m_player->setPosition(position); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - - //zero pos - //qDebug()<<"zero"; - { QSignalSpy spy(m_player, SIGNAL(positionChanged(qint64))); - m_player->play(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - m_player->setPosition(0); - WAIT_FOR_CONDITION(spy.count(), 2); - QVERIFY(m_player->mediaStatus() == QMediaPlayer::BufferingMedia || - m_player->mediaStatus() == QMediaPlayer::BufferedMedia || - m_player->mediaStatus() == QMediaPlayer::EndOfMedia || - m_player->mediaStatus() == QMediaPlayer::LoadedMedia); - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - QVERIFY(m_player->position() >= qint64(0)); - QVERIFY(spy.count()!=0);} - - //reset position - m_player->stop(); - m_player->setPosition(position); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - - //end pos - //qDebug()<<"dur"; - { QSignalSpy spy(m_player, SIGNAL(positionChanged(qint64))); - m_player->play(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - m_player->setPosition(duration); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::EndOfMedia); - QCOMPARE(m_player->mediaStatus(), QMediaPlayer::EndOfMedia); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE(m_player->position(), qint64(0)); - QVERIFY(spy.count()!=0);} - - //reset position - m_player->stop(); - m_player->setPosition(position); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - - //negative pos - //qDebug()<<"negavite"; - { QSignalSpy spy(m_player, SIGNAL(positionChanged(qint64))); - m_player->play(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - m_player->setPosition(qint64(-1)); - WAIT_FOR_CONDITION(spy.count(), 2); - QVERIFY(m_player->mediaStatus() == QMediaPlayer::BufferingMedia || - m_player->mediaStatus() == QMediaPlayer::BufferedMedia || - m_player->mediaStatus() == QMediaPlayer::EndOfMedia || - m_player->mediaStatus() == QMediaPlayer::LoadedMedia); - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - QVERIFY(m_player->position() >= qint64(0)); - QVERIFY(spy.count()!=0);} - - //reset position - m_player->stop(); - m_player->setPosition(position); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - - //over duration - //qDebug()<<"over"; - { QSignalSpy spy(m_player, SIGNAL(positionChanged(qint64))); - m_player->play(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - m_player->setPosition(duration+1); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::EndOfMedia); - QCOMPARE(m_player->mediaStatus(), QMediaPlayer::EndOfMedia); - // s60 MP3 controller has a weard feature to reduce position by ~200 when position - // is set over the duration, therefore we skip it here - if (!mediaContent.canonicalUrl().path().endsWith("mp3")) { - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE(m_player->position(), qint64(0)); - QVERIFY(spy.count()!=0);} - } - } else - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - - m_player->stop(); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - //qDebug()<<"end"; -} - - -void tst_QMediaPlayer_s60::testVolume() -{ - QFETCH_GLOBAL(int, volume); - - // preset volume - { QSignalSpy spy(m_player, SIGNAL(volumeChanged(int))); - m_player->setVolume(volume); - QCOMPARE(m_player->volume(), volume); - QCOMPARE(m_player->isMuted(), false); - QCOMPARE(spy.count(), 1);} - - // same volume - { QSignalSpy spy(m_player, SIGNAL(volumeChanged(int))); - int currentVolume = m_player->volume(); - m_player->setVolume(currentVolume); - QCOMPARE(m_player->volume(), currentVolume); - QCOMPARE(m_player->isMuted(), false); - QCOMPARE(spy.count(), 0);} - - // zero volume - { QSignalSpy spy(m_player, SIGNAL(volumeChanged(int))); - m_player->setVolume(0); - QCOMPARE(m_player->volume(), 0); - QCOMPARE(m_player->isMuted(), false); - QCOMPARE(spy.count(), 1);} - - // max volume - { QSignalSpy spy(m_player, SIGNAL(volumeChanged(int))); - m_player->setVolume(100); - QCOMPARE(m_player->volume(), 100); - QCOMPARE(m_player->isMuted(), false); - QCOMPARE(spy.count(), 1);} - - // negative volume - { QSignalSpy spy(m_player, SIGNAL(volumeChanged(int))); - m_player->setVolume(int(-1)); - QCOMPARE(m_player->volume(), 0); - QCOMPARE(m_player->isMuted(), false); - QCOMPARE(spy.count(), 1);} - - // over max volume - { QSignalSpy spy(m_player, SIGNAL(volumeChanged(int))); - m_player->setVolume(1000); - QCOMPARE(m_player->volume(), 100); - QCOMPARE(m_player->isMuted(), false); - QCOMPARE(spy.count(), 1);} -} - -void tst_QMediaPlayer_s60::testVolumeWhilePlaying() -{ - QFETCH_GLOBAL(QMediaContent, mediaContent); - QFETCH_GLOBAL(int, volume); - QFETCH_GLOBAL(bool, valid); - - if (valid) { - m_player->setMedia(mediaContent); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - - m_player->play(); - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - - // preset volume - { QSignalSpy spy(m_player, SIGNAL(volumeChanged(int))); - m_player->setVolume(volume); - QCOMPARE(m_player->volume(), volume); - QCOMPARE(m_player->isMuted(), false); - QCOMPARE(spy.count(), 1);} - - // same volume - { QSignalSpy spy(m_player, SIGNAL(volumeChanged(int))); - int currentVolume = m_player->volume(); - m_player->setVolume(currentVolume); - QCOMPARE(m_player->volume(), currentVolume); - QCOMPARE(m_player->isMuted(), false); - QCOMPARE(spy.count(), 0);} - - // zero volume - { QSignalSpy spy(m_player, SIGNAL(volumeChanged(int))); - m_player->setVolume(0); - QCOMPARE(m_player->volume(), 0); - QCOMPARE(m_player->isMuted(), false); - QCOMPARE(spy.count(), 1);} - - // max volume - { QSignalSpy spy(m_player, SIGNAL(volumeChanged(int))); - m_player->setVolume(100); - QCOMPARE(m_player->volume(), 100); - QCOMPARE(m_player->isMuted(), false); - QCOMPARE(spy.count(), 1);} - - // negative volume - { QSignalSpy spy(m_player, SIGNAL(volumeChanged(int))); - m_player->setVolume(int(-1)); - QCOMPARE(m_player->volume(), 0); - QCOMPARE(m_player->isMuted(), false); - QCOMPARE(spy.count(), 1);} - - // over max volume - { QSignalSpy spy(m_player, SIGNAL(volumeChanged(int))); - m_player->setVolume(1000); - QCOMPARE(m_player->volume(), 100); - QCOMPARE(m_player->isMuted(), false); - QCOMPARE(spy.count(), 1);} - - m_player->stop(); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - } -} - - -void tst_QMediaPlayer_s60::testMuted() -{ - QFETCH_GLOBAL(int, volume); - - //reset mute & volume - m_player->setMuted(false); - m_player->setVolume(0); - QVERIFY(m_player->isMuted() == false); - QCOMPARE(m_player->volume(), 0); - - // set muted - {QSignalSpy spy(m_player, SIGNAL(mutedChanged(bool))); - m_player->setMuted(true); - QCOMPARE(spy.count(), 1); - QVERIFY(m_player->isMuted() == true);} - - // set muted again - {QSignalSpy spy(m_player, SIGNAL(mutedChanged(bool))); - m_player->setMuted(true); - QCOMPARE(spy.count(), 0); - QVERIFY(m_player->isMuted() == true);} - - // unmute - {QSignalSpy spy(m_player, SIGNAL(mutedChanged(bool))); - m_player->setMuted(false); - QCOMPARE(spy.count(), 1); - QVERIFY(m_player->isMuted() == false);} - - // set volume while muted - {QSignalSpy muteSpy(m_player, SIGNAL(mutedChanged(bool))); - QSignalSpy volumeSpy(m_player, SIGNAL(volumeChanged(int))); - m_player->setMuted(true); - m_player->setVolume(volume); - QCOMPARE(m_player->volume(), volume); - QCOMPARE(muteSpy.count(), 1); - QCOMPARE(volumeSpy.count(), 1); - QVERIFY(m_player->isMuted() == true);} -} - -void tst_QMediaPlayer_s60::testMutedWhilePlaying() -{ - QFETCH_GLOBAL(QMediaContent, mediaContent); - QFETCH_GLOBAL(int, volume); - QFETCH_GLOBAL(bool, valid); - - if (valid) { - m_player->setMedia(mediaContent); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - - //reset mute & volume - m_player->setMuted(false); - m_player->setVolume(65); - QVERIFY(m_player->isMuted() == false); - QCOMPARE(m_player->volume(), 65); - - m_player->play(); - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - - // set muted - {QSignalSpy spy(m_player, SIGNAL(mutedChanged(bool))); - m_player->setMuted(true); - QCOMPARE(spy.count(), 1); - QVERIFY(m_player->isMuted() == true);} - - // set muted again - {QSignalSpy spy(m_player, SIGNAL(mutedChanged(bool))); - m_player->setMuted(true); - QCOMPARE(spy.count(), 0); - QVERIFY(m_player->isMuted() == true);} - - // unmute - {QSignalSpy spy(m_player, SIGNAL(mutedChanged(bool))); - m_player->setMuted(false); - QCOMPARE(spy.count(), 1); - QVERIFY(m_player->isMuted() == false);} - - // set volume while muted - {QSignalSpy muteSpy(m_player, SIGNAL(mutedChanged(bool))); - QSignalSpy volumeSpy(m_player, SIGNAL(volumeChanged(int))); - m_player->setMuted(true); - m_player->setVolume(volume); - QCOMPARE(m_player->volume(), volume); - QCOMPARE(muteSpy.count(), 1); - QCOMPARE(volumeSpy.count(), 1); - QVERIFY(m_player->isMuted() == true);} - - m_player->stop(); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - } -} - - -void tst_QMediaPlayer_s60::testVideoAndAudioAvailability() -{ - QFETCH_GLOBAL(bool, videoAvailable); - QFETCH_GLOBAL(bool, audioAvailable); - QFETCH_GLOBAL(bool, valid); - QFETCH_GLOBAL(QMediaContent, mediaContent); - - if(valid) { - QSignalSpy audioAvailableSpy(m_player, SIGNAL(audioAvailableChanged(bool))); - QSignalSpy videoAvailableSpy(m_player, SIGNAL(videoAvailableChanged(bool))); - - m_player->setMedia(mediaContent); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - - QVERIFY(m_player->isVideoAvailable() == videoAvailable); - QVERIFY(m_player->isAudioAvailable() == audioAvailable); - - QCOMPARE(audioAvailableSpy.count(), 1); - QCOMPARE(videoAvailableSpy.count(), 1); - } -} - -void tst_QMediaPlayer_s60::testError() -{ - QFETCH_GLOBAL(QMediaPlayer::Error, error); - QFETCH_GLOBAL(bool, videoAvailable); - QFETCH_GLOBAL(bool, audioAvailable); - QFETCH_GLOBAL(bool, valid); - QFETCH_GLOBAL(QMediaContent, mediaContent); - QFETCH_GLOBAL(QMediaPlayer::State, state); - QFETCH_GLOBAL(QMediaPlayer::MediaStatus, status); - - QSignalSpy errorSpy(m_player, SIGNAL(error(QMediaPlayer::Error))); - m_player->setMedia(mediaContent); - WAIT_FOR_CONDITION(m_player->mediaStatus(), (QMediaPlayer::NoMedia || QMediaPlayer::InvalidMedia || QMediaPlayer::LoadedMedia)); - QVERIFY(m_player->mediaStatus() == status); - QVERIFY(m_player->state() == state); - QVERIFY(m_player->error() == error); - if (error != QMediaPlayer::NoError) { - QVERIFY(errorSpy.count()!=0); - } -} - -void tst_QMediaPlayer_s60::testPlay() -{ - QFETCH_GLOBAL(bool, valid); - QFETCH_GLOBAL(bool, streamable); - QFETCH_GLOBAL(QMediaContent, mediaContent); - QFETCH_GLOBAL(QMediaPlayer::State, state); - - m_player->setMedia(mediaContent); - WAIT_FOR_CONDITION(m_player->mediaStatus(), (QMediaPlayer::NoMedia || QMediaPlayer::InvalidMedia || QMediaPlayer::LoadedMedia)); - QVERIFY(m_player->state() == state); - QVERIFY(m_player->media() == mediaContent); - QSignalSpy spy(m_player, SIGNAL(stateChanged(QMediaPlayer::State))); - m_player->play(); - - if(valid) { - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - QCOMPARE(spy.count(), state == QMediaPlayer::PlayingState ? 0 : 1); - - //Play->Play - {QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - QSignalSpy stateSpy(m_player, SIGNAL(stateChanged(QMediaPlayer::State))); - m_player->play(); - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - QCOMPARE(stateSpy.count(), 0);} - - //Play->Pause - {QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - QSignalSpy stateSpy(m_player, SIGNAL(stateChanged(QMediaPlayer::State))); - m_player->pause(); - QCOMPARE(m_player->state(), QMediaPlayer::PausedState); - QCOMPARE(stateSpy.count(), 1);} - - //Play->Stop - {m_player->play(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - if (m_player->mediaStatus() != QMediaPlayer::EndOfMedia) { - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - QSignalSpy stateSpy(m_player, SIGNAL(stateChanged(QMediaPlayer::State))); - m_player->stop(); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE(stateSpy.count(), 1); - } else { - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE(spy.count(), 4); - }} - } else if (streamable) { - m_player->stop(); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE(spy.count(), 2); - } else { - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE(spy.count(), 0); - } - - m_player->stop(); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); -} - -void tst_QMediaPlayer_s60::testPause() -{ - QFETCH_GLOBAL(bool, valid); - QFETCH_GLOBAL(bool, streamable); - QFETCH_GLOBAL(QMediaContent, mediaContent); - QFETCH_GLOBAL(QMediaPlayer::State, state); - - m_player->setMedia(mediaContent); - WAIT_FOR_CONDITION(m_player->mediaStatus(), (QMediaPlayer::NoMedia || QMediaPlayer::InvalidMedia || QMediaPlayer::LoadedMedia)); - QVERIFY(m_player->state() == state); - QVERIFY(m_player->media() == mediaContent); - QSignalSpy spy(m_player, SIGNAL(stateChanged(QMediaPlayer::State))); - m_player->pause(); - - if(valid) { - QCOMPARE(m_player->state(), QMediaPlayer::PausedState); - QCOMPARE(spy.count(), 1); - - //Pause->Play - {QCOMPARE(m_player->state(), QMediaPlayer::PausedState); - QSignalSpy stateSpy(m_player, SIGNAL(stateChanged(QMediaPlayer::State))); - m_player->play(); - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - QCOMPARE(stateSpy.count(), 1);} - - //Pause->Pause - {m_player->pause(); - QCOMPARE(m_player->state(), QMediaPlayer::PausedState); - QSignalSpy stateSpy(m_player, SIGNAL(stateChanged(QMediaPlayer::State))); - m_player->pause(); - QCOMPARE(m_player->state(), QMediaPlayer::PausedState); - QCOMPARE(stateSpy.count(), 0);} - - //Pause->Stop - {QCOMPARE(m_player->state(), QMediaPlayer::PausedState); - QSignalSpy stateSpy(m_player, SIGNAL(stateChanged(QMediaPlayer::State))); - m_player->stop(); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE(stateSpy.count(), 1);} - } else if (streamable) { - m_player->stop(); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE(spy.count(), 2); - } else { - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE(spy.count(), 0); - } -} - -void tst_QMediaPlayer_s60::testStop() -{ - QFETCH_GLOBAL(bool, valid); - QFETCH_GLOBAL(QMediaContent, mediaContent); - QFETCH_GLOBAL(QMediaPlayer::State, state); - - m_player->setMedia(mediaContent); - WAIT_FOR_CONDITION(m_player->mediaStatus(), (QMediaPlayer::NoMedia || QMediaPlayer::InvalidMedia || QMediaPlayer::LoadedMedia)); - QVERIFY(m_player->state() == state); - QVERIFY(m_player->media() == mediaContent); - - QSignalSpy spy(m_player, SIGNAL(stateChanged(QMediaPlayer::State))); - m_player->stop(); - - if(valid) { - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE(spy.count(), 0); - - //Stop->Play - {QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QSignalSpy stateSpy(m_player, SIGNAL(stateChanged(QMediaPlayer::State))); - m_player->play(); - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - QCOMPARE(stateSpy.count(), 1);} - - //Stop->Pause - {m_player->stop(); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QSignalSpy stateSpy(m_player, SIGNAL(stateChanged(QMediaPlayer::State))); - m_player->pause(); - QCOMPARE(m_player->state(), QMediaPlayer::PausedState); - QCOMPARE(stateSpy.count(), 1);} - - //Stop->Stop - {m_player->stop(); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QSignalSpy stateSpy(m_player, SIGNAL(stateChanged(QMediaPlayer::State))); - m_player->stop(); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE(stateSpy.count(), 0);} - } else { - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE(spy.count(), 0); - } -} - -void tst_QMediaPlayer_s60::testMediaStatus() -{ - QFETCH_GLOBAL(bool, videoAvailable); - QFETCH_GLOBAL(bool, valid); - QFETCH_GLOBAL(bool, streamable); - QFETCH_GLOBAL(QMediaContent, mediaContent); - - QSignalSpy statusSpy(m_player, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus))); - mediaStatusList list(m_player, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus))); - m_player->setMedia(mediaContent); - WAIT_FOR_CONDITION(m_player->mediaStatus(), (QMediaPlayer::NoMedia || QMediaPlayer::InvalidMedia || QMediaPlayer::LoadedMedia)); - - if(valid) { - if (videoAvailable) { - QCOMPARE(statusSpy.count(), 3); - QCOMPARE(list.count(), 3); - QCOMPARE(list.at(0), QMediaPlayer::UnknownMediaStatus); - QCOMPARE(list.at(1), QMediaPlayer::LoadingMedia); - QCOMPARE(list.at(2), QMediaPlayer::LoadedMedia); - QCOMPARE(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - - m_player->play(); - {WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia);} - QCOMPARE(statusSpy.count(), 5); - QCOMPARE(list.count(), 5); - QCOMPARE(list.at(3), QMediaPlayer::BufferingMedia); - QCOMPARE(list.at(4), QMediaPlayer::BufferedMedia); - QCOMPARE(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - - {WAIT_LONG_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::EndOfMedia);} - QVERIFY(statusSpy.count() == 6); - QVERIFY(list.count() == 6); - QCOMPARE(list.last(), QMediaPlayer::EndOfMedia); - QCOMPARE(m_player->mediaStatus(), QMediaPlayer::EndOfMedia); - }else { - QCOMPARE(statusSpy.count(), 3); - QCOMPARE(list.count(), 3); - QCOMPARE(list.at(0), QMediaPlayer::UnknownMediaStatus); - QCOMPARE(list.at(1), QMediaPlayer::LoadingMedia); - QCOMPARE(list.at(2), QMediaPlayer::LoadedMedia); - QCOMPARE(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - - m_player->play(); - {WAIT_LONG_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::EndOfMedia);} - QVERIFY(statusSpy.count() == 4); - QVERIFY(list.count() == 4); - QCOMPARE(list.last(), QMediaPlayer::EndOfMedia); - QCOMPARE(m_player->mediaStatus(), QMediaPlayer::EndOfMedia); - } - } else if (mediaContent.isNull()) { - QCOMPARE(statusSpy.count(), 2); - QCOMPARE(list.count(), 2); - QCOMPARE(list.at(0), QMediaPlayer::UnknownMediaStatus); - QCOMPARE(list.at(1), QMediaPlayer::NoMedia); - QCOMPARE(m_player->mediaStatus(), QMediaPlayer::NoMedia); - m_player->play(); - QCOMPARE(statusSpy.count(), 2); - QCOMPARE(list.count(), 2); - QCOMPARE(m_player->mediaStatus(), QMediaPlayer::NoMedia); - } else if (streamable) { - QCOMPARE(statusSpy.count(), 3); - QCOMPARE(list.count(), 3); - QCOMPARE(list.at(0), QMediaPlayer::UnknownMediaStatus); - QCOMPARE(list.at(1), QMediaPlayer::LoadingMedia); - QCOMPARE(list.at(2), QMediaPlayer::LoadedMedia); - QCOMPARE(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - m_player->play(); - QCOMPARE(statusSpy.count(), 3); - QCOMPARE(list.count(), 3); - QCOMPARE(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - } else { - QCOMPARE(statusSpy.count(), 3); - QCOMPARE(list.count(), 3); - QCOMPARE(list.at(0), QMediaPlayer::UnknownMediaStatus); - QCOMPARE(list.at(1), QMediaPlayer::LoadingMedia); - QCOMPARE(list.at(2), QMediaPlayer::InvalidMedia); - QCOMPARE(m_player->mediaStatus(), QMediaPlayer::InvalidMedia); - m_player->play(); - QCOMPARE(statusSpy.count(), 3); - QCOMPARE(list.count(), 3); - QCOMPARE(m_player->mediaStatus(), QMediaPlayer::InvalidMedia); - } - - m_player->stop(); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); -} - -void tst_QMediaPlayer_s60::testPlaylist() -{ - if(!runonce) { - QMediaContent content0(QUrl::fromLocalFile(TestFilePath + "test_mp4.mp4")); - QMediaContent content1(QUrl::fromLocalFile(TestFilePath + "test_WAV.dat")); - QMediaContent content2(QUrl::fromLocalFile(TestFilePath + "test_mp4.mp4")); - QMediaContent content3(QUrl::fromLocalFile(TestFilePath + "test_WAV.dat")); - QMediaContent content4(QUrl::fromLocalFile(TestFilePath + "test_MIDI.dat")); - - QMediaPlaylist *playlist = new QMediaPlaylist(m_player); - m_player->setPlaylist(playlist); - - QSignalSpy stateSpy(m_player, SIGNAL(stateChanged(QMediaPlayer::State))); - QSignalSpy mediaSpy(m_player, SIGNAL(mediaChanged(QMediaContent))); - - // Test the player does nothing with an empty playlist attached. - m_player->play(); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE(m_player->media(), QMediaContent()); - QCOMPARE(stateSpy.count(), 0); - QCOMPARE(mediaSpy.count(), 0); - - playlist->addMedia(content0); - playlist->addMedia(content1); - playlist->addMedia(content2); - playlist->addMedia(content3); - - // Test changing the playlist position, changes the current media, but not the playing state. - playlist->setCurrentIndex(1); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - QCOMPARE(m_player->media(), content1); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - QCOMPARE(stateSpy.count(), 0); - QCOMPARE(mediaSpy.count(), 1); - - // Test playing starts with the current media. - m_player->play(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - QCOMPARE(m_player->media(), content1); - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - QVERIFY(m_player->mediaStatus() == (QMediaPlayer::BufferedMedia||QMediaPlayer::BufferingMedia)); - QCOMPARE(stateSpy.count(), 1); - QCOMPARE(mediaSpy.count(), 1); - - // Test pausing doesn't change the current media. - m_player->pause(); - QCOMPARE(m_player->media(), content1); - QCOMPARE(m_player->state(), QMediaPlayer::PausedState); - QVERIFY(m_player->mediaStatus() == (QMediaPlayer::BufferedMedia||QMediaPlayer::BufferingMedia)); - QCOMPARE(stateSpy.count(), 2); - QCOMPARE(mediaSpy.count(), 1); - - // Test stopping doesn't change the current media. - m_player->stop(); - QCOMPARE(m_player->media(), content1); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - QCOMPARE(stateSpy.count(), 3); - QCOMPARE(mediaSpy.count(), 1); - - // Test when the player service reaches the end of the current media, the player moves onto - // the next item without stopping. - m_player->play(); - QCOMPARE(m_player->media(), content1); - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - QCOMPARE(stateSpy.count(), 4); - QCOMPARE(mediaSpy.count(), 1); - - WAIT_FOR_CONDITION(mediaSpy.count(), 2); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - QCOMPARE(m_player->media(), content2); - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - QVERIFY(m_player->mediaStatus() == (QMediaPlayer::BufferedMedia||QMediaPlayer::BufferingMedia)); - QCOMPARE(stateSpy.count(), 6); - QCOMPARE(mediaSpy.count(), 2); - - // Test skipping the current media doesn't change the state. - playlist->next(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - QCOMPARE(m_player->media(), content3); - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - QVERIFY(m_player->mediaStatus() == (QMediaPlayer::BufferedMedia||QMediaPlayer::BufferingMedia)); - QCOMPARE(stateSpy.count(), 6); - QCOMPARE(mediaSpy.count(), 3); - - // Test changing the current media while paused doesn't change the state. - m_player->pause(); - QCOMPARE(m_player->media(), content3); - QCOMPARE(m_player->state(), QMediaPlayer::PausedState); - QVERIFY(m_player->mediaStatus() == (QMediaPlayer::BufferedMedia||QMediaPlayer::BufferingMedia)); - QCOMPARE(stateSpy.count(), 7); - QCOMPARE(mediaSpy.count(), 3); - - playlist->previous(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - QCOMPARE(m_player->media(), content2); - QCOMPARE(m_player->state(), QMediaPlayer::PausedState); - QVERIFY(m_player->mediaStatus() == (QMediaPlayer::BufferedMedia||QMediaPlayer::BufferingMedia)); - QCOMPARE(stateSpy.count(), 7); - QCOMPARE(mediaSpy.count(), 4); - - // Test changing the current media while stopped doesn't change the state. - m_player->stop(); - QCOMPARE(m_player->media(), content2); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - QCOMPARE(stateSpy.count(), 8); - QCOMPARE(mediaSpy.count(), 4); - - playlist->next(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - QCOMPARE(m_player->media(), content3); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - QCOMPARE(stateSpy.count(), 8); - QCOMPARE(mediaSpy.count(), 5); - - // Test the player is stopped and the current media cleared when it reaches the end of the last - // item in the playlist. - m_player->play(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - QCOMPARE(m_player->media(), content3); - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - QVERIFY(m_player->mediaStatus() == (QMediaPlayer::BufferedMedia||QMediaPlayer::BufferingMedia)); - QCOMPARE(stateSpy.count(), 9); - QCOMPARE(mediaSpy.count(), 5); - - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::EndOfMedia); - QCOMPARE(m_player->media(), QMediaContent()); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE(m_player->mediaStatus(), QMediaPlayer::NoMedia); - QCOMPARE(stateSpy.count(), 10); - QCOMPARE(mediaSpy.count(), 6); - - // Test starts playing from the start of the playlist if there is no current media selected. - m_player->play(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - QCOMPARE(m_player->media(), content0); - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - QVERIFY(m_player->mediaStatus() == (QMediaPlayer::BufferedMedia||QMediaPlayer::BufferingMedia)); - QCOMPARE(stateSpy.count(), 11); - QCOMPARE(mediaSpy.count(), 7); - - // Test deleting the playlist stops the player and clears the media it set. - delete playlist; - QCOMPARE(m_player->media(), QMediaContent()); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE(m_player->mediaStatus(), QMediaPlayer::NoMedia); - QCOMPARE(stateSpy.count(), 12); - QCOMPARE(mediaSpy.count(), 8); - - // Test the player works as normal with the playlist removed. - m_player->play(); - QCOMPARE(m_player->media(), QMediaContent()); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE(m_player->mediaStatus(), QMediaPlayer::NoMedia); - QCOMPARE(stateSpy.count(), 12); - QCOMPARE(mediaSpy.count(), 8); - - m_player->setMedia(content1); - m_player->play(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia) - QCOMPARE(m_player->media(), content1); - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - QVERIFY(m_player->mediaStatus() == (QMediaPlayer::BufferedMedia||QMediaPlayer::BufferingMedia)); - QCOMPARE(stateSpy.count(), 13); - QCOMPARE(mediaSpy.count(), 9); - m_player->stop(); - runonce = true; - } -} - -void tst_QMediaPlayer_s60::testStreamControl() -{ - QFETCH_GLOBAL(bool, valid); - QFETCH_GLOBAL(bool, streamable); - QFETCH_GLOBAL(QMediaContent, mediaContent); - QFETCH_GLOBAL(QMediaPlayer::State, state); - QFETCH_GLOBAL(bool, videoAvailable); - QFETCH_GLOBAL(bool, audioAvailable); - - QMediaStreamsControl* m_streamControl = (QMediaStreamsControl*)(m_player->service()->requestControl(QMediaStreamsControl_iid)); - if(m_streamControl) { - if (valid || streamable) { - if (audioAvailable && !videoAvailable) { - QSignalSpy streamInfoSpy(m_streamControl, SIGNAL(streamsChanged())); - m_player->setMedia(mediaContent); - WAIT_FOR_CONDITION(m_player->mediaStatus(), (QMediaPlayer::NoMedia || QMediaPlayer::InvalidMedia || QMediaPlayer::LoadedMedia)); - QVERIFY(m_streamControl->streamCount() == 1); - QVERIFY(m_streamControl->streamType(1) == QMediaStreamsControl::AudioStream); - QVERIFY(m_streamControl->isActive(1) == true); - QCOMPARE(streamInfoSpy.count(), 1); - }else if (audioAvailable && videoAvailable){ - QSignalSpy streamInfoSpy(m_streamControl, SIGNAL(streamsChanged())); - m_player->setMedia(mediaContent); - WAIT_FOR_CONDITION(m_player->mediaStatus(), (QMediaPlayer::NoMedia || QMediaPlayer::InvalidMedia || QMediaPlayer::LoadedMedia)); - QVERIFY(m_streamControl->streamCount() == 2); - QVERIFY(m_streamControl->streamType(1) == QMediaStreamsControl::VideoStream); - QVERIFY(m_streamControl->isActive(2) == true); - QCOMPARE(streamInfoSpy.count(), 1); - }else if (!audioAvailable && videoAvailable) { - QSignalSpy streamInfoSpy(m_streamControl, SIGNAL(streamsChanged())); - m_player->setMedia(mediaContent); - WAIT_FOR_CONDITION(m_player->mediaStatus(), (QMediaPlayer::NoMedia || QMediaPlayer::InvalidMedia || QMediaPlayer::LoadedMedia)); - QVERIFY(m_streamControl->streamCount() == 1); - QVERIFY(m_streamControl->streamType(1) == QMediaStreamsControl::VideoStream); - QVERIFY(m_streamControl->isActive(2) == true); - QCOMPARE(streamInfoSpy.count(), 1); - } - - // Test that streamsChanged signal do not get emitted when adding same media - QSignalSpy streamInfoSpy(m_streamControl, SIGNAL(streamsChanged())); - m_player->setMedia(mediaContent); - WAIT_FOR_CONDITION(m_player->mediaStatus(), (QMediaPlayer::NoMedia || QMediaPlayer::InvalidMedia || QMediaPlayer::LoadedMedia)); - QCOMPARE(streamInfoSpy.count(), 0); - } - } -} diff --git a/tests/auto/qmediaplayer/tst_qmediaplayer_s60.h b/tests/auto/qmediaplayer/tst_qmediaplayer_s60.h deleted file mode 100755 index 1ebe42588..000000000 --- a/tests/auto/qmediaplayer/tst_qmediaplayer_s60.h +++ /dev/null @@ -1,137 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $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$ -** -****************************************************************************/ -#ifndef TST_QMEDIAPLAYER_S60_H -#define TST_QMEDIAPLAYER_S60_H - -#include <QtTest/QtTest> -#include <QtCore> -#include <QtGui> -#include <QFile> - -#include <QMediaPlayer> -#include <QMediaPlayerControl> -#include <QMediaPlaylist> -#include <QMediaService> -#include <QMediaStreamsControl> -#include <QVideoWidget> - -QT_USE_NAMESPACE - -#define WAIT_FOR_CONDITION(a,e) \ - for (int _i = 0; _i < 500; _i += 1) { \ - if ((a) == (e)) break; \ - QTest::qWait(10);} - - -#define WAIT_LONG_FOR_CONDITION(a,e) \ - for (int _i = 0; _i < 1800; _i += 1) { \ - if ((a) == (e)) break; \ - QTest::qWait(100);} - -class mediaStatusList : public QObject, public QList<QMediaPlayer::MediaStatus> -{ - Q_OBJECT -public slots: - void mediaStatus(QMediaPlayer::MediaStatus status) { - append(status); - } - -public: - mediaStatusList(QObject *obj, const char *aSignal) - : QObject() - { - connect(obj, aSignal, this, SLOT(mediaStatus(QMediaPlayer::MediaStatus))); - } -}; - -class MockProvider_s60 : public QMediaServiceProvider -{ -public: - MockProvider_s60(QMediaService *service):mockService(service) {} - QMediaService *requestService(const QByteArray &, const QMediaServiceProviderHint &) - { - return mockService; - } - - void releaseService(QMediaService *service) { delete service; } - - QMediaService *mockService; -}; - -class tst_QMediaPlayer_s60: public QObject -{ - Q_OBJECT - -public slots: - void initTestCase_data(); - void initTestCase_data_default_winscw(); - void initTestCase_data_default_armv5(); - void initTestCase(); - void cleanupTestCase(); - void init(); - void cleanup(); - -private slots: - void testNullService(); - void testMedia(); - void testDuration(); - void testPosition(); - void testPositionWhilePlaying(); - void testVolume(); - void testVolumeWhilePlaying(); - void testMuted(); - void testMutedWhilePlaying(); - void testVideoAndAudioAvailability(); - void testError(); - void testPlay(); - void testPause(); - void testStop(); - void testMediaStatus(); - void testPlaylist(); - void testStreamControl(); - -private: - QMediaPlayer *m_player; - QVideoWidget *m_widget; - bool runonce; -}; - -#endif // TST_QMEDIAPLAYER_S60_H diff --git a/tests/auto/qmediaplayer/tst_qmediaplayer_xa.cpp b/tests/auto/qmediaplayer/tst_qmediaplayer_xa.cpp deleted file mode 100644 index 403fe5457..000000000 --- a/tests/auto/qmediaplayer/tst_qmediaplayer_xa.cpp +++ /dev/null @@ -1,1413 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $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$ -** -****************************************************************************/ - -#include "tst_QMediaPlayer_xa.h" - -QT_USE_NAMESPACE - -#define QTEST_MAIN_XA(TestObject) \ - int main(int argc, char *argv[]) { \ - char *new_argv[3]; \ - QApplication app(argc, argv); \ - \ - QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log"; \ - QByteArray bytes = str.toAscii(); \ - \ - char arg1[] = "-o"; \ - \ - new_argv[0] = argv[0]; \ - new_argv[1] = arg1; \ - new_argv[2] = bytes.data(); \ - \ - TestObject tc; \ - return QTest::qExec(&tc, 3, new_argv); \ - } - -#define WAIT_FOR_CONDITION(a,e) \ - for (int _i = 0; _i < 500; _i += 1) { \ - if ((a) == (e)) break; \ - QTest::qWait(10);} - -#define WAIT_FOR_EITHER_CONDITION(a,e,f) \ - for (int _i = 0; _i < 500; _i += 1) { \ - if (((a) == (e)) || ((a) == (f))) break; \ - QTest::qWait(10);} - -#define WAIT_FOR_CONDITION1(a) \ - for (int _i = 0; _i < 500; _i += 1) { \ - if (a) break; \ - QTest::qWait(10);} - - -#define WAIT_LONG_FOR_CONDITION(a,e) \ - for (int _i = 0; _i < 1800; _i += 1) { \ - if ((a) == (e)) break; \ - QTest::qWait(10);} - -#define WAIT_LONG_FOR_CONDITION1(a) \ - for (int _i = 0; _i < 1800; _i += 1) { \ - if (a) break; \ - QTest::qWait(100);} - -tst_QMediaPlayer_xa::tst_QMediaPlayer_xa(): m_player(NULL), m_widget(NULL), m_windowWidget(NULL) -{ - audioOnlyContent = new QMediaContent(QUrl("file:///C:/data/testfiles/test.mp3")); - videoOnlyContent = new QMediaContent(QUrl("file:///C:/data/testfiles/test_video.3gp")); - audioVideoContent = new QMediaContent(QUrl("file:///C:/data/testfiles/test.3gp")); - audioVideoAltContent = new QMediaContent(QUrl("file:///C:/data/testfiles/test_alt.3gp")); - //streamingContent = new QMediaContent(QUrl("rtsp://10.48.2.51/Copyright_Free_Test_Content/Clips/Video/3GP/176x144/h263/h263_176x144_15fps_384kbps_AAC-LC_128kbps_mono_44.1kHz.3gp")); - streamingContent3gp = new QMediaContent(QUrl("http://www.mobileplayground.co.uk/video/Crazy Frog.3gp")); - audioStreamingContent = new QMediaContent(QUrl("http://myopusradio.com:8000/easy")); - mediaContent = audioVideoContent; -} - -tst_QMediaPlayer_xa::~tst_QMediaPlayer_xa() -{ - delete audioOnlyContent; - delete videoOnlyContent; - delete audioVideoContent; - delete audioVideoAltContent; -} - -void tst_QMediaPlayer_xa::initTestCase_data() -{ -} - -void tst_QMediaPlayer_xa::initTestCase() -{ - m_player = new QMediaPlayer(); - - // Symbian back end needs coecontrol for creation. - m_widget = new QVideoWidget(); - m_widget->setGeometry ( 0, 100, 350, 250 ); - m_player->setVideoOutput(m_widget); - m_widget->showNormal(); -} - -void tst_QMediaPlayer_xa::cleanupTestCase() -{ - delete m_player; - delete m_widget; - delete m_windowWidget; -} - -void tst_QMediaPlayer_xa::resetPlayer() -{ - delete m_player; - m_player = new QMediaPlayer(); - m_player->setVideoOutput(m_widget); -} - -void tst_QMediaPlayer_xa::resetPlayer_WindowControl() -{ - delete m_player; - m_player = new QMediaPlayer(); - - if(!m_windowWidget) { - m_windowWidget = new QWidget(); - m_windowWidget->showMaximized(); - } - - QVideoWindowControl* windowControl = (QVideoWindowControl*)(m_player->service()->requestControl(QVideoWindowControl_iid)); - if (windowControl) - windowControl->setWinId(m_windowWidget->winId()); -} - -void tst_QMediaPlayer_xa::init() -{ - qRegisterMetaType<QMediaPlayer::State>("QMediaPlayer::State"); - qRegisterMetaType<QMediaPlayer::Error>("QMediaPlayer::Error"); - qRegisterMetaType<QMediaPlayer::MediaStatus>("QMediaPlayer::MediaStatus"); - qRegisterMetaType<QMediaContent>("QMediaContent"); - updateLog("QT MediaPlayer Auto Test Cases", true); -} - -void tst_QMediaPlayer_xa::cleanup() -{ -} - - -void tst_QMediaPlayer_xa::testMedia() -{ - updateLog("*****testMedia"); - - setAudioVideoContent(); - - QTest::qWait(500); - QCOMPARE(m_player->media(), *mediaContent); - - updateLog("*****testMedia: PASSED"); -} - - -void tst_QMediaPlayer_xa::testDuration() -{ - updateLog("*****testDuration"); - - resetPlayer(); - - QSignalSpy spy(m_player, SIGNAL(durationChanged(qint64))); - setAudioVideoContent(); - - WAIT_FOR_CONDITION1(spy.count()>0); - - QVERIFY(m_player->duration() == duration); - - updateLog("*****testDuration: PASSED"); -} - -void tst_QMediaPlayer_xa::testPosition() -{ - updateLog("*****testPosition"); - resetPlayer(); - - qint64 position = 60000; - setAudioVideoContent(); - - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - - QCOMPARE(m_player->isSeekable(), true); - - // preset position - { - QSignalSpy spy(m_player, SIGNAL(positionChanged(qint64))); - m_player->setPosition(position); - WAIT_FOR_CONDITION(spy.count(), 1); - QCOMPARE(m_player->position(), position); - QCOMPARE(spy.count(), 1); - QCOMPARE(spy.at(0).at(0).toLongLong(), position); - } - - // same pos second time - { - QSignalSpy spy(m_player, SIGNAL(positionChanged(qint64))); - m_player->setPosition(position); - QCOMPARE(m_player->position(), position); - QCOMPARE(spy.count(), 0); - } - - //zero pos - { - QSignalSpy spy(m_player, SIGNAL(positionChanged(qint64))); - m_player->setPosition(0); - QCOMPARE(m_player->position(), qint64(0)); - QCOMPARE(spy.count(), 1); - QCOMPARE(spy.at(0).at(0).toLongLong(), qint64(0)); - } - - //end pos - { - QSignalSpy spy(m_player, SIGNAL(positionChanged(qint64))); - m_player->setPosition(duration); - QCOMPARE(m_player->position(), duration); - QCOMPARE(spy.count(), 1); - QCOMPARE(spy.at(0).at(0).toLongLong(), duration); - } - - //negative pos - { - QSignalSpy spy(m_player, SIGNAL(positionChanged(qint64))); - m_player->setPosition(qint64(-1)); - QCOMPARE(m_player->position(), qint64(0)); - QCOMPARE(spy.count(), 1); - QCOMPARE(spy.at(0).at(0).toLongLong(), qint64(0)); - } - - //over duration - { - QSignalSpy spy(m_player, SIGNAL(positionChanged(qint64))); - m_player->setPosition(duration+1); - QCOMPARE(m_player->position(), duration); - QCOMPARE(spy.count(), 1); - QCOMPARE(spy.at(0).at(0).toLongLong(), duration); - } - -} - - -void tst_QMediaPlayer_xa::testPositionWhilePlaying() -{ - updateLog("*****testPositionWhilePlaying"); - resetPlayer(); - - qint64 position = 60000; - - setAudioVideoContent(); - - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - - // preset position - { - QSignalSpy spy(m_player, SIGNAL(positionChanged(qint64))); - m_player->play(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - m_player->setPosition(position); - WAIT_FOR_CONDITION1(spy.count()>0); - QVERIFY(m_player->mediaStatus() == QMediaPlayer::BufferingMedia || m_player->mediaStatus() == QMediaPlayer::BufferedMedia); - - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - QVERIFY(m_player->position()>=position); - QVERIFY(spy.count()!=0); - } - - //reset position - m_player->stop(); - m_player->setPosition(position); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - - //zero pos - { QSignalSpy spy(m_player, SIGNAL(positionChanged(qint64))); - m_player->play(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - m_player->setPosition(0); - WAIT_FOR_CONDITION1(spy.count()>0); - QVERIFY(m_player->mediaStatus() == QMediaPlayer::BufferingMedia || - m_player->mediaStatus() == QMediaPlayer::BufferedMedia); - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - QVERIFY(m_player->position() >= qint64(0)); - QVERIFY(spy.count()!=0); - } - - //reset position - m_player->stop(); - m_player->setPosition(position); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - - updateLog("*****testPositionWhilePlaying: PASSED"); -} - - -void tst_QMediaPlayer_xa::testVolume() -{ - updateLog("*****testVolume"); - - int volume = 20; - - // preset volume - { - QSignalSpy spy(m_player, SIGNAL(volumeChanged(int))); - m_player->setVolume(volume); - QCOMPARE(m_player->volume(), volume); - QCOMPARE(m_player->isMuted(), false); - QCOMPARE(spy.count(), 1); - } - - // same volume - { - QSignalSpy spy(m_player, SIGNAL(volumeChanged(int))); - int currentVolume = m_player->volume(); - m_player->setVolume(currentVolume); - QCOMPARE(m_player->volume(), currentVolume); - QCOMPARE(m_player->isMuted(), false); - QCOMPARE(spy.count(), 0); - } - - // zero volume - { - QSignalSpy spy(m_player, SIGNAL(volumeChanged(int))); - m_player->setVolume(0); - QCOMPARE(m_player->volume(), 0); - QCOMPARE(m_player->isMuted(), false); - QCOMPARE(spy.count(), 1); - } - - // max volume - { - QSignalSpy spy(m_player, SIGNAL(volumeChanged(int))); - m_player->setVolume(100); - QCOMPARE(m_player->volume(), 100); - QCOMPARE(m_player->isMuted(), false); - QCOMPARE(spy.count(), 1); - } - - // negative volume - { - QSignalSpy spy(m_player, SIGNAL(volumeChanged(int))); - m_player->setVolume(int(-1)); - QCOMPARE(m_player->volume(), 0); - QCOMPARE(m_player->isMuted(), false); - QCOMPARE(spy.count(), 1); - } - - // over max volume - { - QSignalSpy spy(m_player, SIGNAL(volumeChanged(int))); - m_player->setVolume(1000); - QCOMPARE(m_player->volume(), 100); - QCOMPARE(m_player->isMuted(), false); - QCOMPARE(spy.count(), 1); - } - - updateLog("*****testVolume: PASSED"); -} - -void tst_QMediaPlayer_xa::testVolumeWhilePlaying() -{ - updateLog("*****testVideoAndAudioAvailability"); - resetPlayer(); - - int volume = 20; - - setAudioVideoContent(); - - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - - m_player->play(); - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - - // preset volume - { - QSignalSpy spy(m_player, SIGNAL(volumeChanged(int))); - m_player->setVolume(volume); - QCOMPARE(m_player->volume(), volume); - QCOMPARE(m_player->isMuted(), false); - QCOMPARE(spy.count(), 1); - } - - // same volume - { - QSignalSpy spy(m_player, SIGNAL(volumeChanged(int))); - int currentVolume = m_player->volume(); - m_player->setVolume(currentVolume); - QCOMPARE(m_player->volume(), currentVolume); - QCOMPARE(m_player->isMuted(), false); - QCOMPARE(spy.count(), 0); - } - - // zero volume - { - QSignalSpy spy(m_player, SIGNAL(volumeChanged(int))); - m_player->setVolume(0); - QCOMPARE(m_player->volume(), 0); - QCOMPARE(m_player->isMuted(), false); - QCOMPARE(spy.count(), 1); - } - - // max volume - { - QSignalSpy spy(m_player, SIGNAL(volumeChanged(int))); - m_player->setVolume(100); - QCOMPARE(m_player->volume(), 100); - QCOMPARE(m_player->isMuted(), false); - QCOMPARE(spy.count(), 1); - } - - // negative volume - { - QSignalSpy spy(m_player, SIGNAL(volumeChanged(int))); - m_player->setVolume(int(-1)); - QCOMPARE(m_player->volume(), 0); - QCOMPARE(m_player->isMuted(), false); - QCOMPARE(spy.count(), 1); - } - - // over max volume - { - QSignalSpy spy(m_player, SIGNAL(volumeChanged(int))); - m_player->setVolume(1000); - QCOMPARE(m_player->volume(), 100); - QCOMPARE(m_player->isMuted(), false); - QCOMPARE(spy.count(), 1); - } - - m_player->stop(); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - - updateLog("*****testVideoAndAudioAvailability: PASSED"); -} - - -void tst_QMediaPlayer_xa::testMuted() -{ - updateLog("*****testMuted"); - - int volume = 20; - - //reset mute & volume - m_player->setMuted(false); - m_player->setVolume(0); - QVERIFY(m_player->isMuted() == false); - QCOMPARE(m_player->volume(), 0); - - // set muted - { - QSignalSpy spy(m_player, SIGNAL(mutedChanged(bool))); - m_player->setMuted(true); - QCOMPARE(spy.count(), 1); - QVERIFY(m_player->isMuted() == true); - } - - // set muted again - { - QSignalSpy spy(m_player, SIGNAL(mutedChanged(bool))); - m_player->setMuted(true); - QCOMPARE(spy.count(), 0); - QVERIFY(m_player->isMuted() == true); - } - - // unmute - { - QSignalSpy spy(m_player, SIGNAL(mutedChanged(bool))); - m_player->setMuted(false); - QCOMPARE(spy.count(), 1); - QVERIFY(m_player->isMuted() == false); - } - - // set volume while muted - { - QSignalSpy muteSpy(m_player, SIGNAL(mutedChanged(bool))); - QSignalSpy volumeSpy(m_player, SIGNAL(volumeChanged(int))); - m_player->setMuted(true); - m_player->setVolume(volume); - QCOMPARE(m_player->volume(), volume); - QCOMPARE(muteSpy.count(), 1); - QCOMPARE(volumeSpy.count(), 1); - QVERIFY(m_player->isMuted() == true); - } - - updateLog("*****testMuted: PASSED"); -} - -void tst_QMediaPlayer_xa::testMutedWhilePlaying() -{ - updateLog("*****testMutedWhilePlaying"); - resetPlayer(); - - int volume = 20; - - setAudioVideoContent(); - - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - - //reset mute & volume - m_player->setMuted(false); - m_player->setVolume(65); - QVERIFY(m_player->isMuted() == false); - QCOMPARE(m_player->volume(), 65); - - m_player->play(); - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - - // set muted - { - QSignalSpy spy(m_player, SIGNAL(mutedChanged(bool))); - m_player->setMuted(true); - QCOMPARE(spy.count(), 1); - QVERIFY(m_player->isMuted() == true); - } - - // set muted again - { - QSignalSpy spy(m_player, SIGNAL(mutedChanged(bool))); - m_player->setMuted(true); - QCOMPARE(spy.count(), 0); - QVERIFY(m_player->isMuted() == true); - } - - // unmute - { - QSignalSpy spy(m_player, SIGNAL(mutedChanged(bool))); - m_player->setMuted(false); - QCOMPARE(spy.count(), 1); - QVERIFY(m_player->isMuted() == false); - } - - // set volume while muted - { - QSignalSpy muteSpy(m_player, SIGNAL(mutedChanged(bool))); - QSignalSpy volumeSpy(m_player, SIGNAL(volumeChanged(int))); - m_player->setMuted(true); - m_player->setVolume(volume); - QCOMPARE(m_player->volume(), volume); - QCOMPARE(muteSpy.count(), 1); - QCOMPARE(volumeSpy.count(), 1); - QVERIFY(m_player->isMuted() == true); - } - - m_player->stop(); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - - - updateLog("*****testMutedWhilePlaying: PASSED"); -} - -void tst_QMediaPlayer_xa::testVideoAndAudioAvailability() -{ - updateLog("*****testVideoAndAudioAvailability"); - resetPlayer(); - - QList<QVariant> arguments; - - - setVideoOnlyContent(); - - - QSignalSpy audioAvailableSpy(m_player, SIGNAL(audioAvailableChanged(bool))); - QSignalSpy videoAvailableSpy(m_player, SIGNAL(videoAvailableChanged(bool))); - - setAudioOnlyContent(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - updateLog("SetMedia: audioOnlyContent"); - WAIT_FOR_CONDITION(m_player->isAudioAvailable(), true); - updateLog("\t isAudioAvailable() == true"); - QVERIFY(m_player->isVideoAvailable() == false); - updateLog("\t isVideoAvailable() == false"); - QCOMPARE(audioAvailableSpy.count(), 1); - arguments = audioAvailableSpy.takeFirst(); - QVERIFY(arguments.at(0).toBool() == true); - updateLog("\t audioAvailableChanged(true)"); - QCOMPARE(videoAvailableSpy.count(), 1); - arguments = videoAvailableSpy.takeFirst(); - QVERIFY(arguments.at(0).toBool() == false); - updateLog("\t videoAvailableChanged(false)"); - - setVideoOnlyContent(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - updateLog("SetMedia: videoOnlyContent"); - WAIT_FOR_CONDITION(m_player->isVideoAvailable(), true); - updateLog("\t isVideoAvailable() == true"); - QVERIFY(m_player->isAudioAvailable() == false); - updateLog("\t isAudioAvailable() == false"); - QCOMPARE(audioAvailableSpy.count(), 1); - arguments = audioAvailableSpy.takeFirst(); - QVERIFY(arguments.at(0).toBool() == false); - updateLog("\t audioAvailableChanged(false)"); - QCOMPARE(videoAvailableSpy.count(), 1); - arguments = videoAvailableSpy.takeFirst(); - QVERIFY(arguments.at(0).toBool() == true); - updateLog("\t videoAvailableChanged(true)"); - - setAudioVideoContent(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - updateLog("SetMedia: audioVideoContent"); - WAIT_FOR_CONDITION(m_player->isAudioAvailable(), true); - updateLog("\t isAudioAvailable() == true"); - QCOMPARE(audioAvailableSpy.count(), 1); - arguments = audioAvailableSpy.takeFirst(); - QVERIFY(arguments.at(0).toBool() == true); - updateLog("\t audioAvailableChanged(true)"); - QCOMPARE(videoAvailableSpy.count(), 0); - - updateLog("*****testVideoAndAudioAvailability: PASSED"); - -} - -void tst_QMediaPlayer_xa::testStreamInformation() -{ - updateLog("*****testStreamInformation"); - resetPlayer(); - QMediaStreamsControl* m_streamControl = (QMediaStreamsControl*)(m_player->service()->requestControl(QMediaStreamsControl_iid)); - setVideoOnlyContent(); - - if(m_streamControl) - { - { - QSignalSpy streamInfoSpy(m_streamControl, SIGNAL(streamsChanged())); - setAudioOnlyContent(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - QVERIFY(m_streamControl->streamCount() == 1); - QCOMPARE(streamInfoSpy.count(), 1); - } - - { - QSignalSpy streamInfoSpy(m_streamControl, SIGNAL(streamsChanged())); - setAudioVideoContent(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - QVERIFY(m_streamControl->streamCount() == 2); - QCOMPARE(streamInfoSpy.count(), 1); - } - - { - QSignalSpy streamInfoSpy(m_streamControl, SIGNAL(streamsChanged())); - setAudioVideoContent(); //set alternate content - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - QVERIFY(m_streamControl->streamCount() == 2); - QCOMPARE(streamInfoSpy.count(), 1); - } - - { - QSignalSpy streamInfoSpy(m_streamControl, SIGNAL(streamsChanged())); - setVideoOnlyContent(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - QVERIFY(m_streamControl->streamCount() == 1); - QCOMPARE(streamInfoSpy.count(), 1); - } - - updateLog("*****testStreamInformation: PASSED"); - } -} - -void tst_QMediaPlayer_xa::testPlay() -{ - updateLog("*****testPlay"); - resetPlayer(); - - setAudioVideoContent(); - - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - QVERIFY(m_player->media() == *mediaContent); - QSignalSpy spy(m_player, SIGNAL(stateChanged(QMediaPlayer::State))); - m_player->play(); - - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - - //Play->Play - { - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - QSignalSpy stateSpy(m_player, SIGNAL(stateChanged(QMediaPlayer::State))); - m_player->play(); - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - QCOMPARE(stateSpy.count(), 0); - } - - //Play->Pause - { - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - QSignalSpy stateSpy(m_player, SIGNAL(stateChanged(QMediaPlayer::State))); - m_player->pause(); - QCOMPARE(m_player->state(), QMediaPlayer::PausedState); - QCOMPARE(stateSpy.count(), 1); - } - - //Play->Stop - { - m_player->play(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - QSignalSpy stateSpy(m_player, SIGNAL(stateChanged(QMediaPlayer::State))); - m_player->stop(); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE(stateSpy.count(), 1); - } - - m_player->stop(); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - - updateLog("*****testPlay: PASSED"); -} - -void tst_QMediaPlayer_xa::testPause() -{ - updateLog("*****testPause"); - resetPlayer(); - - setAudioVideoContent(); - - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - QVERIFY(m_player->media() == *mediaContent); - QSignalSpy spy(m_player, SIGNAL(stateChanged(QMediaPlayer::State))); - m_player->pause(); - // at present there is no support for stop->pause state transition. TODO: uncomment when support added - //QCOMPARE(m_player->state(), QMediaPlayer::PausedState); - //QCOMPARE(spy.count(), 1); - - //Pause->Play - { - //QCOMPARE(m_player->state(), QMediaPlayer::PausedState); - QSignalSpy stateSpy(m_player, SIGNAL(stateChanged(QMediaPlayer::State))); - m_player->play(); - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - QCOMPARE(stateSpy.count(), 1); - } - - //Pause->Pause - { - m_player->pause(); - QCOMPARE(m_player->state(), QMediaPlayer::PausedState); - QSignalSpy stateSpy(m_player, SIGNAL(stateChanged(QMediaPlayer::State))); - m_player->pause(); - QCOMPARE(m_player->state(), QMediaPlayer::PausedState); - QCOMPARE(stateSpy.count(), 0); - } - - //Pause->Stop - { - QCOMPARE(m_player->state(), QMediaPlayer::PausedState); - QSignalSpy stateSpy(m_player, SIGNAL(stateChanged(QMediaPlayer::State))); - m_player->stop(); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE(stateSpy.count(), 1); - } - - m_player->stop(); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - - updateLog("*****testPause: PASSED"); - -} - -void tst_QMediaPlayer_xa::testStop() -{ - updateLog("*****testStop"); - resetPlayer(); - setAudioVideoContent(); - - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - QVERIFY(m_player->media() == *mediaContent); - - QSignalSpy spy(m_player, SIGNAL(stateChanged(QMediaPlayer::State))); - m_player->stop(); - - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE(spy.count(), 0); - - //Stop->Play - { - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QSignalSpy stateSpy(m_player, SIGNAL(stateChanged(QMediaPlayer::State))); - m_player->play(); - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - QCOMPARE(stateSpy.count(), 1); - } - // at present there is no support for stop->pause state transition. TODO: uncomment when support added - //Stop->Pause -/* { - m_player->stop(); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QSignalSpy stateSpy(m_player, SIGNAL(stateChanged(QMediaPlayer::State))); - m_player->pause(); - QCOMPARE(m_player->state(), QMediaPlayer::PausedState); - QCOMPARE(stateSpy.count(), 1); - } -*/ - //Stop->Stop - { - m_player->stop(); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QSignalSpy stateSpy(m_player, SIGNAL(stateChanged(QMediaPlayer::State))); - m_player->stop(); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE(stateSpy.count(), 0); - } - - m_player->stop(); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - - updateLog("*****testStop: PASSED"); -} - -void tst_QMediaPlayer_xa::testMediaStatus() -{ - updateLog("*****testMediaStatus"); - resetPlayer(); - - QSignalSpy statusSpy(m_player, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus))); - - setAudioVideoContent(); - - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - QVERIFY(statusSpy.count()>0); - - { - QSignalSpy statusSpy(m_player, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus))); - m_player->play(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - QCOMPARE(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - QVERIFY(statusSpy.count()>0); - } - - { - QSignalSpy statusSpy(m_player, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus))); - m_player->setPosition(duration - 10); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::EndOfMedia); - QCOMPARE(m_player->mediaStatus(), QMediaPlayer::EndOfMedia); - QVERIFY(statusSpy.count()>0); - } - - m_player->stop(); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - - updateLog("*****testMediaStatus: PASSED"); -} - -void tst_QMediaPlayer_xa::testBufferStatus() -{ - updateLog("*****testBufferStatus"); - resetPlayer(); - m_player->setNotifyInterval(50); //Since default interval is 1 sec,could not receive any bufferStatusChanged SIGNAL,hence checking for 50milliseconds - QSignalSpy spy(m_player, SIGNAL(bufferStatusChanged(int))); - // setStreamingContent(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - QCOMPARE(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - m_player->play(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - QCOMPARE(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - WAIT_FOR_CONDITION(m_player->bufferStatus(), 100); - QVERIFY(spy.count()>0); - updateLog("*****testBufferStatus: PASSED"); -} - -void tst_QMediaPlayer_xa::testPlaybackRate() -{ - updateLog("*****testPlaybackRate"); - - resetPlayer(); - - qreal playbackRate = 1.5; - - setAudioVideoContent(); - - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - - m_player->setPlaybackRate(playbackRate); - QVERIFY(m_player->playbackRate() == playbackRate); - - QSignalSpy spy(m_player, SIGNAL(playbackRateChanged(qreal))); - m_player->setPlaybackRate(playbackRate + 0.5f); - QCOMPARE(m_player->playbackRate(), playbackRate + 0.5f); - QCOMPARE(spy.count(), 1); - - updateLog("*****testPlaybackRate: PASSED"); -} - -void tst_QMediaPlayer_xa::testPlaybackRateWhilePlaying() -{ - updateLog("*****testPlaybackRateWhilePlaying"); - resetPlayer(); - - qreal playbackRate = 1.5; - - setAudioVideoContent(); - - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - - m_player->play(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - - m_player->setPlaybackRate(playbackRate); - QVERIFY(m_player->playbackRate() == playbackRate); - - QSignalSpy spy(m_player, SIGNAL(playbackRateChanged(qreal))); - m_player->setPlaybackRate(playbackRate + 0.5f); - QCOMPARE(m_player->playbackRate(), playbackRate + 0.5f); - QCOMPARE(spy.count(), 1); - - updateLog("*****testPlaybackRateWhilePlaying: PASSED"); -} - -void tst_QMediaPlayer_xa::testSeekable() -{ - updateLog("*****testBufferStatus"); - resetPlayer(); - QSignalSpy spy(m_player, SIGNAL(seekableChanged(bool))); - setAudioVideoContent(); - qint64 position = 1000; - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - QVERIFY(m_player->isSeekable()==true); - m_player->setPosition(position); - QCOMPARE(spy.count(), 0); - QVERIFY(m_player->isSeekable()==true); - - updateLog("*****testBufferStatus: PASSED"); - -} - -void tst_QMediaPlayer_xa::testAspectRatioMode() -{ - updateLog("*****testBufferStatus"); - resetPlayer(); - setAudioVideoContent(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - QVideoWidgetControl* m_videoWidgetControl = (QVideoWidgetControl*)(m_player->service()->requestControl(QVideoWidgetControl_iid)); - - m_player->play(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - - QCOMPARE(m_videoWidgetControl->aspectRatioMode(), Qt::KeepAspectRatio); //default - - QTest::qWait(5000); //wait for 5 seconds - - { - m_videoWidgetControl->setAspectRatioMode(Qt::IgnoreAspectRatio); - QCOMPARE(m_videoWidgetControl->aspectRatioMode(), Qt::IgnoreAspectRatio); - QTest::qWait(5000); //wait for 5 seconds - } - - { - m_videoWidgetControl->setAspectRatioMode(Qt::KeepAspectRatioByExpanding); - QCOMPARE(m_videoWidgetControl->aspectRatioMode(), Qt::KeepAspectRatioByExpanding); - QTest::qWait(5000); //wait for 5 seconds - } - { - m_videoWidgetControl->setAspectRatioMode(Qt::KeepAspectRatio); - QCOMPARE(m_videoWidgetControl->aspectRatioMode(), Qt::KeepAspectRatio); - QTest::qWait(5000); //wait for 5 seconds - } - - updateLog("*****testBufferStatus: PASSED"); - -} - -void tst_QMediaPlayer_xa::testFullScreen() -{ - updateLog("*****testFullScreen"); - resetPlayer(); - setAudioVideoContent(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - QVideoWidgetControl* m_videoWidgetControl = (QVideoWidgetControl*)(m_player->service()->requestControl(QVideoWidgetControl_iid)); - - m_player->play(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - - //m_widget->resize(50, 50); - m_widget->showNormal(); - QTest::qWait(10000); //wait for 5 seconds - - - if(m_videoWidgetControl) - { - QSignalSpy spy(m_videoWidgetControl, SIGNAL(fullScreenChanged(bool))); - m_videoWidgetControl->setFullScreen(true); - QTest::qWait(10000); //wait for 5 seconds - QCOMPARE(m_videoWidgetControl->isFullScreen(), true); - QCOMPARE(spy.count(), 1); - } - - - if(m_videoWidgetControl) - { - QSignalSpy spy(m_videoWidgetControl, SIGNAL(fullScreenChanged(bool))); - m_videoWidgetControl->setFullScreen(false); - QCOMPARE(m_videoWidgetControl->isFullScreen(), false); - QTest::qWait(10000); //wait for 5 seconds - QCOMPARE(spy.count(), 1); - } - - updateLog("*****testFullScreen: PASSED"); -} - -void tst_QMediaPlayer_xa::testWindowControl_NativeSize() -{ - updateLog("*****testWindowControl_NativeSize"); - resetPlayer_WindowControl(); - setAudioVideoContent(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - QVERIFY(m_player->media() == *mediaContent); - m_player->play(); - WAIT_LONG_FOR_CONDITION(m_player->state(), QMediaPlayer::PlayingState); - QVideoWindowControl* windowControl = (QVideoWindowControl*)(m_player->service()->requestControl(QVideoWindowControl_iid)); - if (windowControl) - { - QSize size = windowControl->nativeSize(); - } - - WAIT_LONG_FOR_CONDITION(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - - updateLog("*****testWindowControl_NativeSize: PASSED"); -} - -void tst_QMediaPlayer_xa::testWindowControl_AspectRatioMode() -{ - updateLog("*****testWindowControl_AspectRatioMode"); - resetPlayer_WindowControl(); - setAudioVideoContent(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - QVideoWindowControl* windowControl = (QVideoWindowControl*)(m_player->service()->requestControl(QVideoWindowControl_iid)); - - m_player->play(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - - QCOMPARE(windowControl->aspectRatioMode(), Qt::KeepAspectRatio); //default - - QTest::qWait(5000); //wait for 5 seconds - - { - windowControl->setAspectRatioMode(Qt::IgnoreAspectRatio); - QCOMPARE(windowControl->aspectRatioMode(), Qt::IgnoreAspectRatio); - QTest::qWait(5000); //wait for 5 seconds - } - - { - windowControl->setAspectRatioMode(Qt::KeepAspectRatioByExpanding); - QCOMPARE(windowControl->aspectRatioMode(), Qt::KeepAspectRatioByExpanding); - QTest::qWait(5000); //wait for 5 seconds - } - { - windowControl->setAspectRatioMode(Qt::KeepAspectRatio); - QCOMPARE(windowControl->aspectRatioMode(), Qt::KeepAspectRatio); - QTest::qWait(5000); //wait for 5 seconds - } - - updateLog("*****testWindowControl_AspectRatioMode: PASSED"); - -} - -void tst_QMediaPlayer_xa::testWindowControl_FullScreen() -{ - updateLog("*****testWindowControl_FullScreen"); - resetPlayer_WindowControl(); - setAudioVideoContent(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - QVideoWindowControl* windowControl = (QVideoWindowControl*)(m_player->service()->requestControl(QVideoWindowControl_iid)); - - m_player->play(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - - //m_windowWidget->resize(250, 350); - m_windowWidget->showNormal(); - QTest::qWait(10000); //wait for 5 seconds - - if(windowControl) - { - QSignalSpy spy(windowControl, SIGNAL(fullScreenChanged(bool))); - windowControl->setFullScreen(true); - QTest::qWait(10000); //wait for 5 seconds - QCOMPARE(windowControl->isFullScreen(), true); - QCOMPARE(spy.count(), 1); - } - - - if(windowControl) - { - QSignalSpy spy(windowControl, SIGNAL(fullScreenChanged(bool))); - windowControl->setFullScreen(false); - QCOMPARE(windowControl->isFullScreen(), false); - QTest::qWait(10000); //wait for 5 seconds - QCOMPARE(spy.count(), 1); - } - - updateLog("*****testWindowControl_FullScreen: PASSED"); -} - - -//adding access-point testcase - - -void tst_QMediaPlayer_xa::testSetconfigurationsAP() -{ - updateLog("*****testSetconfigurationsAP"); - resetPlayer(); - - //Passing only valid Accesspoint in QList - QList<QNetworkConfiguration> configs; - accesspointlist = manager.allConfigurations(); - for (int i=0; i<=accesspointlist.size()-1;i++) - qDebug()<<"accesspointlist"<< accesspointlist.at(i).name(); - configs<<accesspointlist.at(8); - QSignalSpy spy(m_player, SIGNAL(networkConfigurationChanged(const QNetworkConfiguration&))); - m_player->setNetworkConfigurations(configs); - setStreamingContent3gp(); - m_player->play(); - QTest::qWait(100000); - WAIT_LONG_FOR_CONDITION(m_player->state(), QMediaPlayer::PlayingState); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - m_player->stop(); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE((m_player->currentNetworkConfiguration().name()), accesspointlist.at(8).name()); - updateLog("*****testSetconfigurationsAP: PASSED"); - -} - - -void tst_QMediaPlayer_xa::testSetAccesspoint() -{ - updateLog("*****testSetAccesspoint"); - resetPlayer(); - QList<QNetworkConfiguration> configs; - accesspointlist = manager.allConfigurations(); - configs<<accesspointlist.at(0); - configs<<accesspointlist.at(3); - configs<<accesspointlist.at(10); - configs<<accesspointlist.at(8); - //Passing only valid Accesspoint in QList - QSignalSpy spy(m_player, SIGNAL(networkConfigurationChanged(const QNetworkConfiguration&))); - m_player->setNetworkConfigurations(configs); - - setStreamingContent3gp(); - QTest::qWait(200000); - m_player->play(); - QTest::qWait(10000); - WAIT_LONG_FOR_CONDITION(m_player->state(), QMediaPlayer::PlayingState); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - m_player->stop(); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE((m_player->currentNetworkConfiguration().name()), accesspointlist.at(8).name()); - - updateLog("*****testSetAccesspoint: PASSED"); -} - - -void tst_QMediaPlayer_xa::testGetAccesspoint() -{ - updateLog("*****testGetAccesspoint"); - resetPlayer(); - //getting information about the current configured accesspoint without setting any configurations - QNetworkConfiguration getaccespoint; - getaccespoint = m_player->currentNetworkConfiguration(); - QCOMPARE(getaccespoint.name(),QString("")); - updateLog("*****testGetAccesspoint: "); -} - - -void tst_QMediaPlayer_xa::testDiffmediacontentAP() -{ - updateLog("*****streaming Different mediacontent files via AP"); - resetPlayer(); - QList<QNetworkConfiguration> configs; - accesspointlist = manager.allConfigurations(); - configs<<accesspointlist.at(8); - QSignalSpy spy(m_player, SIGNAL(networkConfigurationChanged(const QNetworkConfiguration&))); - m_player->setNetworkConfigurations(configs); - //first mediacontent file - setAudioStreamingContent(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - QCOMPARE(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - m_player->play(); - QTest::qWait(30000); - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::EndOfMedia); - m_player->stop(); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - - //second mediacontent file - setStreamingContent3gp(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - QCOMPARE(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - m_player->play(); - QTest::qWait(20000); - QCOMPARE(m_player->state(), QMediaPlayer::PlayingState); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::EndOfMedia); - m_player->stop(); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - - QCOMPARE((m_player->currentNetworkConfiguration().name()), accesspointlist.at(8).name()); - QNetworkConfiguration getaccespoint; - getaccespoint = m_player->currentNetworkConfiguration(); - QCOMPARE(getaccespoint.name(), QString("MMMW")); - - updateLog("*****testDiffmediacontentAP: PASSED"); -} - - -void tst_QMediaPlayer_xa::testInvalidaddressAP() -{ - updateLog("*****testInvalidaddressAP"); - resetPlayer(); - //setting all invalid accesspoint - QList<QNetworkConfiguration> configs; - accesspointlist = manager.allConfigurations(); - configs<<accesspointlist.at(0); - configs<<accesspointlist.at(2); - configs<<accesspointlist.at(3); - QSignalSpy spy(m_player, SIGNAL(networkConfigurationChanged(const QNetworkConfiguration&))); - m_player->setNetworkConfigurations(configs); - QNetworkConfiguration getaccespoint; - getaccespoint = m_player->currentNetworkConfiguration(); - QCOMPARE(getaccespoint.name(), QString("")); - - updateLog("*****testInvalidaddressAP: PASSED"); -} - - - -void tst_QMediaPlayer_xa::testMultipleAccesspoints() -{ - updateLog("*****testMultipleAccesspoints"); - resetPlayer(); - QList<QNetworkConfiguration> configs; - accesspointlist = manager.allConfigurations(); - configs<<accesspointlist.at(8); - QSignalSpy spy(m_player, SIGNAL(networkConfigurationChanged(const QNetworkConfiguration&))); - m_player->setNetworkConfigurations(configs); - setStreamingContent3gp(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - QCOMPARE(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - m_player->play(); - WAIT_LONG_FOR_CONDITION(m_player->state(), QMediaPlayer::PlayingState); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - QTest::qWait(20000); - m_player->stop(); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE((m_player->currentNetworkConfiguration().name()), accesspointlist.at(8).name()); - //Second configuration list - QList<QNetworkConfiguration> secconfigs; - secaccesspoint = manager.allConfigurations(); - secconfigs<<secaccesspoint.at(5); - QSignalSpy spy1(m_player, SIGNAL(networkConfigurationChanged(const QNetworkConfiguration&))); - m_player->setNetworkConfigurations(secconfigs); - setStreamingContent3gp(); - // setAudioStreamingContent(); - QTest::qWait(30000); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - QCOMPARE(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - m_player->play(); - WAIT_LONG_FOR_CONDITION(m_player->state(), QMediaPlayer::PlayingState); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - QTest::qWait(10000); - updateLog("*****testSetAccesspoint: PASSED"); - QCOMPARE((m_player->currentNetworkConfiguration().name()), accesspointlist.at(5).name()); - QNetworkConfiguration getaccespoint; - getaccespoint = m_player->currentNetworkConfiguration(); - QCOMPARE(getaccespoint.name(), QString("Mobile Office")); - - updateLog("*****testMultipleAccesspoints: PASSED"); -} - - -void tst_QMediaPlayer_xa::testReconnectAPWhilestreaming() -{ - updateLog("*****testReconnectAPWhilestreaming"); - resetPlayer(); - QList<QNetworkConfiguration> configs; - accesspointlist = manager.allConfigurations(); - configs<<accesspointlist.at(15); - configs<<accesspointlist.at(12); - configs<<accesspointlist.at(0); - configs<<accesspointlist.at(8); - QSignalSpy spy(m_player, SIGNAL(networkConfigurationChanged(const QNetworkConfiguration&))); - m_player->setNetworkConfigurations(configs); - setAudioStreamingContent(); - m_player->play(); - QTest::qWait(200000); - configs<<accesspointlist.at(5); - m_player->setNetworkConfigurations(configs); - m_player->play(); - QTest::qWait(20000); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::EndOfMedia); - QCOMPARE((m_player->currentNetworkConfiguration().name()), accesspointlist.at(8).name()); - QNetworkConfiguration getaccespoint; - getaccespoint = m_player->currentNetworkConfiguration(); - QCOMPARE(getaccespoint.name(), QString("MMMW")); - updateLog("*****testReconnectAPWhilestreaming: PASSED"); -} - - -void tst_QMediaPlayer_xa::teststreampausestream() -{ - updateLog("*****teststreampausestream"); - resetPlayer(); - QList<QNetworkConfiguration> configs; - accesspointlist = manager.allConfigurations(); - configs<<accesspointlist.at(8); - QSignalSpy spy(m_player, SIGNAL(networkConfigurationChanged(const QNetworkConfiguration&))); - m_player->setNetworkConfigurations(configs); - setStreamingContent3gp(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - m_player->play(); - WAIT_LONG_FOR_CONDITION(m_player->state(), QMediaPlayer::PlayingState); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - QTest::qWait(10000); - m_player->pause(); - WAIT_LONG_FOR_CONDITION(m_player->state(), QMediaPlayer::PausedState); - - //Setting up the accesspoint when the player is in paused state - QList<QNetworkConfiguration> secconfigs; - secaccesspoint = manager.allConfigurations(); - secconfigs<<secaccesspoint.at(5); - m_player->setNetworkConfigurations(secconfigs); - m_player->play(); - QTest::qWait(20000); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - QCOMPARE((m_player->currentNetworkConfiguration()).name(), accesspointlist.at(8).name()); - m_player->stop(); - WAIT_LONG_FOR_CONDITION(m_player->state(), QMediaPlayer::StoppedState); - setStreamingContent3gp(); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - QCOMPARE(m_player->mediaStatus(), QMediaPlayer::LoadedMedia); - m_player->play(); - QTest::qWait(20000); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - m_player->stop(); - WAIT_LONG_FOR_CONDITION(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE((m_player->currentNetworkConfiguration().name()), accesspointlist.at(5).name()); - - updateLog("*****teststreampausestream: PASSED"); -} - - - -void tst_QMediaPlayer_xa::testStressAccessPoint() -{ - updateLog("*****testStressAccessPoint"); - resetPlayer(); - for (int i=0; i<=50; i++) { - QList<QNetworkConfiguration> configs; - accesspointlist = manager.allConfigurations(); - configs<<accesspointlist.at(8); - QSignalSpy spy(m_player, SIGNAL(networkConfigurationChanged(const QNetworkConfiguration&))); - m_player->setNetworkConfigurations(configs); - setStreamingContent3gp(); - m_player->play(); - QTest::qWait(20000); - WAIT_LONG_FOR_CONDITION(m_player->state(), QMediaPlayer::PlayingState); - WAIT_FOR_CONDITION(m_player->mediaStatus(), QMediaPlayer::BufferedMedia); - m_player->stop(); - QCOMPARE(m_player->state(), QMediaPlayer::StoppedState); - QCOMPARE((m_player->currentNetworkConfiguration().name()), accesspointlist.at(8).name()); - resetPlayer(); - } - - updateLog("*****testStressAccessPoint: PASSED"); -} - - - -void tst_QMediaPlayer_xa::updateLog(QString log, bool delFile) -{ - QString logFileName = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + "_detailed.log"; - if(delFile) - { - QFile::remove(logFileName); - } - - QFile f(logFileName); - - if( !f.open( QIODevice::WriteOnly | QIODevice::Append ) ) - { - return; - } - - QTextStream ts( &f ); - - ts<<log<<"\n"; - - f.close(); -} diff --git a/tests/auto/qmediaplayer/tst_qmediaplayer_xa.h b/tests/auto/qmediaplayer/tst_qmediaplayer_xa.h deleted file mode 100644 index 732cbd4bf..000000000 --- a/tests/auto/qmediaplayer/tst_qmediaplayer_xa.h +++ /dev/null @@ -1,194 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $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$ -** -****************************************************************************/ -#ifndef TST_QMEDIAPLAYER_XA_H -#define TST_QMEDIAPLAYER_XA_H - -#include <QtTest/QtTest> -#include <QtCore> -#include <QtGui> -#include <QFile> - -#include <QMediaPlayer> -#include <QMediaPlayerControl> -#include <QMediaService> -#include <QMediaStreamsControl> -#include <QVideoWidget> -#include <QVideoWidgetControl> -#include <QVideoWindowControl> -#include <QMetadataReaderControl> -#include <QtNetwork/qnetworkconfiguration.h> -#include <QtNetwork/qnetworkconfigmanager.h> -#include <qmedianetworkaccesscontrol.h> - -QT_USE_NAMESPACE -class mediaStatusList; -/* -class mediaStatusList : public QObject, public QList<QMediaPlayer::MediaStatus> -{ - Q_OBJECT -public slots: - void mediaStatus(QMediaPlayer::MediaStatus status) { - append(status); - } - -public: - mediaStatusList(QObject *obj, const char *aSignal) - : QObject() - { - connect(obj, aSignal, this, SLOT(mediaStatus(QMediaPlayer::MediaStatus))); - } -}; -*/ -class tst_QMediaPlayer_xa: public QObject -{ - Q_OBJECT - -public: - tst_QMediaPlayer_xa(); - ~tst_QMediaPlayer_xa(); - -private slots: - void initTestCase_data(); - void initTestCase(); - void cleanupTestCase(); - void init(); - void cleanup(); - - void testMediaStatus(); - void testBufferStatus(); - void testPositionWhilePlaying(); - void testFullScreen(); - void testWindowControl_FullScreen(); - void testSeekable(); - void testStreamInformation(); - void testAspectRatioMode(); - void testMedia(); - void testDuration(); - void testPosition(); - void testVolume(); - void testVolumeWhilePlaying(); - void testMuted(); - void testMutedWhilePlaying(); - void testVideoAndAudioAvailability(); - void testPlay(); - void testPause(); - void testStop(); - void testPlaybackRate(); - void testPlaybackRateWhilePlaying(); - void testWindowControl_NativeSize(); - void testWindowControl_AspectRatioMode(); - void testSetconfigurationsAP(); - void testSetAccesspoint(); - void testGetAccesspoint(); - void testDiffmediacontentAP(); - void testInvalidaddressAP(); - void testMultipleAccesspoints(); - void testReconnectAPWhilestreaming(); - void teststreampausestream(); - void testStressAccessPoint(); - -private: - - void resetPlayer(); - void resetPlayer_WindowControl(); - - void updateLog(QString str, bool delFile=false); - void setAudioOnlyContent() - { - mediaContent = audioOnlyContent; - - m_player->setMedia(*mediaContent); - } - - void setVideoOnlyContent() - { - mediaContent = videoOnlyContent; - duration = 60000; - - m_player->setMedia(*mediaContent); - } - - void setAudioVideoContent() - { - if (mediaContent == audioVideoContent) { - mediaContent = audioVideoAltContent; - duration = 101840; - } else { - mediaContent = audioVideoContent; - duration = 141000; - } - m_player->setMedia(*mediaContent); - } - - void setStreamingContent3gp() - { - mediaContent = streamingContent3gp; - - m_player->setMedia(*mediaContent); - } - - void setAudioStreamingContent() - { - mediaContent = audioStreamingContent; - - m_player->setMedia(*mediaContent); - } - - - QMediaContent* audioOnlyContent; - QMediaContent* videoOnlyContent; - QMediaContent* audioVideoContent; - QMediaContent* audioVideoAltContent; - QMediaContent* mediaContent; - QMediaContent* streamingContent3gp; - QMediaContent* audioStreamingContent; - //for access-point requirement - QList<QNetworkConfiguration> accesspointlist; - QList<QNetworkConfiguration> secaccesspoint; - QNetworkConfigurationManager manager; - - qint64 duration; - QMediaPlayer *m_player; - QVideoWidget *m_widget; - QWidget *m_windowWidget; -}; - -#endif // TST_QMEDIAPLAYER_XA_H diff --git a/tests/auto/qmediaplayerbackend/qmediaplayerbackend.pro b/tests/auto/qmediaplayerbackend/qmediaplayerbackend.pro index 023217013..178a9194a 100644 --- a/tests/auto/qmediaplayerbackend/qmediaplayerbackend.pro +++ b/tests/auto/qmediaplayerbackend/qmediaplayerbackend.pro @@ -8,17 +8,7 @@ QT += multimediakit-private # TARGET = tst_qmediaplayerbackend # CONFIG += testcase -symbian*: { - PLAYLIST_TESTDATA.sources = testdata/* - PLAYLIST_TESTDATA.path = testdata - DEPLOYMENT += PLAYLIST_TESTDATA -} - -wince* { - DEFINES+= TESTDATA_DIR=\\\"./\\\" -}else:!symbian { - DEFINES += TESTDATA_DIR=\\\"$$PWD/\\\" -} +DEFINES += TESTDATA_DIR=\\\"$$PWD/\\\" SOURCES += \ tst_qmediaplayerbackend.cpp diff --git a/tests/auto/qmediaplaylist/qmediaplaylist.pro b/tests/auto/qmediaplaylist/qmediaplaylist.pro index c7b9a5837..373129471 100644 --- a/tests/auto/qmediaplaylist/qmediaplaylist.pro +++ b/tests/auto/qmediaplaylist/qmediaplaylist.pro @@ -8,17 +8,7 @@ QT += multimediakit-private # TARGET = tst_qmediaplaylist # CONFIG += testcase -symbian*: { - PLAYLIST_TESTDATA.sources = testdata/* - PLAYLIST_TESTDATA.path = testdata - DEPLOYMENT += PLAYLIST_TESTDATA -} - -wince* { - DEFINES+= TESTDATA_DIR=\\\"./\\\" -}else:!symbian { - DEFINES += TESTDATA_DIR=\\\"$$PWD/\\\" -} +DEFINES += TESTDATA_DIR=\\\"$$PWD/\\\" HEADERS += \ $$QT.multimediakit.sources/../plugins/m3u/qm3uhandler.h diff --git a/tests/auto/qmediaplaylist/tst_qmediaplaylist.cpp b/tests/auto/qmediaplaylist/tst_qmediaplaylist.cpp index 1a0395a54..7fd78fcbb 100644 --- a/tests/auto/qmediaplaylist/tst_qmediaplaylist.cpp +++ b/tests/auto/qmediaplaylist/tst_qmediaplaylist.cpp @@ -454,20 +454,12 @@ void tst_QMediaPlaylist::saveAndLoad() QCOMPARE(playlist.media(0), playlist2.media(0)); QCOMPARE(playlist.media(1), playlist2.media(1)); QCOMPARE(playlist.media(3), playlist2.media(3)); -#ifdef Q_OS_SYMBIAN - res = playlist.save(QUrl(QLatin1String("file:///c:/data/test_m3u.m3u")), "m3u"); -#else res = playlist.save(QUrl(QLatin1String("tmp.m3u")), "m3u"); -#endif QVERIFY(res); playlist2.clear(); QVERIFY(playlist2.isEmpty()); -#ifdef Q_OS_SYMBIAN - playlist2.load(QUrl(QLatin1String("file:///c:/data/test_m3u.m3u")), "m3u"); -#else playlist2.load(QUrl(QLatin1String("tmp.m3u")), "m3u"); -#endif QCOMPARE(playlist.error(), QMediaPlaylist::NoError); QCOMPARE(playlist.mediaCount(), playlist2.mediaCount()); diff --git a/tests/auto/qmediarecorder/main.cpp b/tests/auto/qmediarecorder/main.cpp index 816a55ea7..2193b73d9 100755 --- a/tests/auto/qmediarecorder/main.cpp +++ b/tests/auto/qmediarecorder/main.cpp @@ -43,38 +43,11 @@ #include "tst_qmediarecorder.h" -#ifdef Q_OS_SYMBIAN -#include "s60common.h" -#include "tst_qmediarecorder_xa.h" -#include "tst_qmediarecorder_mmf.h" -#endif - int main(int argc, char**argv) { QApplication app(argc,argv); int ret; tst_QMediaRecorder test_api; ret = QTest::qExec(&test_api, argc, argv); -#ifdef Q_OS_SYMBIAN - char *new_argv[3]; - QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log"; - QByteArray bytes = str.toAscii(); - char arg1[] = "-o"; - new_argv[0] = argv[0]; - new_argv[1] = arg1; - new_argv[2] = bytes.data(); - tst_QMediaRecorder_xa test_xa; - ret = QTest::qExec(&test_xa, 3, new_argv); - char *new_argv1[3]; - QString str1 = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + "_s60.log"; - QByteArray bytes1 = str1.toAscii(); - char arg2[] = "-o"; - new_argv1[0] = argv[0]; - new_argv1[1] = arg2; - new_argv1[2] = bytes1.data(); - tst_QMediaRecorder_mmf test_mmf; - ret = QTest::qExec(&test_mmf, 3, new_argv1); - -#endif return ret; } diff --git a/tests/auto/qmediarecorder/qmediarecorder.pro b/tests/auto/qmediarecorder/qmediarecorder.pro index 41e708fe7..283231fcd 100644 --- a/tests/auto/qmediarecorder/qmediarecorder.pro +++ b/tests/auto/qmediarecorder/qmediarecorder.pro @@ -5,14 +5,6 @@ QT += multimediakit-private # TARGET = tst_qmediarecorder # CONFIG += testcase -symbian { - HEADERS += s60common.h - HEADERS += tst_qmediarecorder_xa.h - SOURCES += tst_qmediarecorder_xa.cpp - HEADERS += tst_qmediarecorder_mmf.h - SOURCES += tst_qmediarecorder_mmf.cpp - TARGET.CAPABILITY = UserEnvironment ReadDeviceData WriteDeviceData AllFiles -} HEADERS += tst_qmediarecorder.h SOURCES += main.cpp tst_qmediarecorder.cpp diff --git a/tests/auto/qmediarecorder/s60common.h b/tests/auto/qmediarecorder/s60common.h deleted file mode 100755 index 4e55004f8..000000000 --- a/tests/auto/qmediarecorder/s60common.h +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $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$ -** -****************************************************************************/ - -#ifndef S60COMMON_H -#define S60COMMON_H - -QT_USE_NAMESPACE - -#define QTRY_COMPARE(a,e) \ - for (int _i = 0; _i < 5000; _i += 100) { \ - if ((a) == (e)) break; \ - QTest::qWait(100); \ - } \ - QCOMPARE(a, e) - -#define QTRY_VERIFY(a) \ - for (int _i = 0; _i < 5000; _i += 100) { \ - if (a) break; \ - QTest::qWait(100); \ - } \ - QVERIFY(a) - -#endif //S60COMMON_H diff --git a/tests/auto/qmediarecorder/tst_qmediarecorder_mmf.cpp b/tests/auto/qmediarecorder/tst_qmediarecorder_mmf.cpp deleted file mode 100755 index 48327bdd0..000000000 --- a/tests/auto/qmediarecorder/tst_qmediarecorder_mmf.cpp +++ /dev/null @@ -1,180 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $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$ -** -****************************************************************************/ -#include "tst_qmediarecorder_mmf.h" - -QT_USE_NAMESPACE - -void tst_QMediaRecorder_mmf::initTestCase() -{ - qRegisterMetaType<QMediaRecorder::State>("QMediaRecorder::State"); - qRegisterMetaType<QMediaRecorder::Error>("QMediaRecorder::Error"); - - captureSource = new QAudioCaptureSource; - audiocapture = new QMediaRecorder(captureSource); - - QVERIFY(captureSource->service()); - - audioEndpoint = qobject_cast<QAudioEndpointSelector*>(captureSource->service()->requestControl(QAudioEndpointSelector_iid)); - audioEncoder = qobject_cast<QAudioEncoderControl*>(captureSource->service()->requestControl(QAudioEncoderControl_iid)); -} - -void tst_QMediaRecorder_mmf::cleanupTestCase() -{ - delete audiocapture; - delete captureSource; -} - -QUrl tst_QMediaRecorder_mmf::recordPathAudio(QDir outputDir) -{ - int lastImage = 0; - int fileCount = 0; - foreach( QString fileName, outputDir.entryList(QStringList() << "testclip_*.amr") ) { - int imgNumber = fileName.mid(5, fileName.size()-9).toInt(); - lastImage = qMax(lastImage, imgNumber); - if (outputDir.exists(fileName)) - fileCount+=1; - } - lastImage+=fileCount; - - QUrl location(QDir::toNativeSeparators(outputDir.canonicalPath()+QString("/testclip_%1.amr").arg(lastImage+1,4,10,QLatin1Char('0')))); - return location; -} - -void tst_QMediaRecorder_mmf::testAudioSink() -{ - audiocapture->setOutputLocation(QUrl("test.tmp")); - QUrl s = audiocapture->outputLocation(); - QCOMPARE(s.toString(), QString("test.tmp")); -} - -void tst_QMediaRecorder_mmf::testAudioRecord() -{ - QSignalSpy stateSignal(audiocapture,SIGNAL(stateChanged(QMediaRecorder::State))); - QCOMPARE(audiocapture->state(), QMediaRecorder::StoppedState); - QTest::qWait(500); // wait for recorder to initialize itself - audiocapture->setOutputLocation(recordPathAudio(QDir::rootPath())); - audiocapture->record(); - QTRY_COMPARE(stateSignal.count(), 1); // wait for callbacks to complete in symbian API - QCOMPARE(audiocapture->state(), QMediaRecorder::RecordingState); - QCOMPARE(audiocapture->error(), QMediaRecorder::NoError); - QCOMPARE(audiocapture->errorString(), QString()); - QCOMPARE(stateSignal.count(), 1); - audiocapture->pause(); - QTRY_COMPARE(stateSignal.count(), 2); // wait for callbacks to complete in symbian API - QCOMPARE(audiocapture->state(), QMediaRecorder::PausedState); - QCOMPARE(stateSignal.count(), 2); - audiocapture->stop(); - QTRY_COMPARE(stateSignal.count(), 3); // wait for callbacks to complete in symbian API - QCOMPARE(audiocapture->state(), QMediaRecorder::StoppedState); - QCOMPARE(stateSignal.count(), 3); -} - -void tst_QMediaRecorder_mmf::testAudioRecordWithAMR() -{ - QSignalSpy stateSignal(audiocapture,SIGNAL(stateChanged(QMediaRecorder::State))); - QCOMPARE(audiocapture->state(), QMediaRecorder::StoppedState); - audiocapture->setOutputLocation(recordPathAudio(QDir::rootPath())); - QAudioEncoderSettings audioSettings; - QVideoEncoderSettings videoSettings; - audioSettings.setCodec("AMR"); - QString format = audiocapture->containerMimeType(); - format = QString("audio/amr"); - audiocapture->setEncodingSettings(audioSettings,videoSettings,format); - audiocapture->record(); - QTRY_COMPARE(stateSignal.count(), 1); // wait for callbacks to complete in symbian API - QCOMPARE(audiocapture->state(), QMediaRecorder::RecordingState); - QCOMPARE(audiocapture->error(), QMediaRecorder::NoError); - QCOMPARE(audiocapture->errorString(), QString()); - QCOMPARE(stateSignal.count(), 1); - audiocapture->pause(); - QTRY_COMPARE(stateSignal.count(), 2); // wait for callbacks to complete in symbian API - QCOMPARE(audiocapture->state(), QMediaRecorder::PausedState); - QCOMPARE(stateSignal.count(), 2); - audiocapture->stop(); - QTRY_COMPARE(stateSignal.count(), 3); // wait for callbacks to complete in symbian API - QCOMPARE(audiocapture->state(), QMediaRecorder::StoppedState); - QCOMPARE(stateSignal.count(), 3); -} - -void tst_QMediaRecorder_mmf::testAudioEndPointSelector() -{ - QSignalSpy audioSignal(audioEndpoint,SIGNAL(activeEndpointChanged(QString))); - QVERIFY(audioEndpoint->availableEndpoints().count() == 1); - QVERIFY(audioEndpoint->defaultEndpoint().compare("default") == 0); - audioEndpoint->setActiveEndpoint("device2"); - QVERIFY(audioEndpoint->activeEndpoint().compare("device2") == 0); - QVERIFY(audioSignal.count() == 1); - QVERIFY(audioEndpoint->endpointDescription("device2").compare("") == 0); -} - -void tst_QMediaRecorder_mmf::testAudioEncoderControl() -{ - QStringList codecs = audiocapture->supportedAudioCodecs(); - QVERIFY(codecs.count() == 2); - QVERIFY(audiocapture->audioCodecDescription("PCM") == "Pulse code modulation"); - QStringList options = audioEncoder->supportedEncodingOptions("PCM"); - QCOMPARE(options.count(), 3); - QCOMPARE(audiocapture->supportedAudioSampleRates().count(), 12); - audioEncoder->setEncodingOption("PCM", "channels", QVariant(2)); - QCOMPARE(audioEncoder->encodingOption("PCM","channels").toInt(), 2); - audioEncoder->setEncodingOption("PCM", "quality", QVariant(int(QtMultimediaKit::NormalQuality))); - QCOMPARE(audioEncoder->encodingOption("PCM","quality").toInt(), int(QtMultimediaKit::NormalQuality)); - audioEncoder->setEncodingOption("PCM", "samplerate", QVariant(44100)); - QCOMPARE(audioEncoder->encodingOption("PCM","samplerate").toInt(), 44100); -} - -void tst_QMediaRecorder_mmf::testMediaFormatsControl() -{ - //audioocontainer types - // Containers supported are dynamically queried from MMF. We cannot guarentee that 2 platforms - // will support the same set. - //QCOMPARE(audiocapture->supportedContainers(), QStringList() << "audio/wav" << "audio/amr"); - QCOMPARE(audiocapture->containerDescription("audio/wav"), QString("WAV Write Format")); - QCOMPARE(audiocapture->containerDescription("audio/amr"), QString("AMR Write Format")); -} - -void tst_QMediaRecorder_mmf::testDefaultAudioEncodingSettings() -{ - QAudioEncoderSettings audioSettings = audiocapture->audioSettings(); - QCOMPARE(audioSettings.codec(), QString("AMR")); - QString format = audiocapture->containerMimeType(); - QCOMPARE(format, QString("audio/amr")); -} diff --git a/tests/auto/qmediarecorder/tst_qmediarecorder_mmf.h b/tests/auto/qmediarecorder/tst_qmediarecorder_mmf.h deleted file mode 100755 index 83058a214..000000000 --- a/tests/auto/qmediarecorder/tst_qmediarecorder_mmf.h +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $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$ -** -****************************************************************************/ -#ifndef TST_QMEDIARECORDER_MMF -#define TST_QMEDIARECORDER_MMF - -#include <QtTest/QtTest> -#include <QDebug> -#include <qmediaobject.h> -#include <qmediacontrol.h> -#include <qmediaservice.h> -#include <qmediarecordercontrol.h> -#include <qmediarecorder.h> -#include <qaudioendpointselector.h> -#include <qaudioencodercontrol.h> -#include <qmediacontainercontrol.h> -#include <qaudioformat.h> -#include <qaudiocapturesource.h> - -#include "s60common.h" - -QT_USE_NAMESPACE -class tst_QMediaRecorder_mmf: public QObject -{ - Q_OBJECT - -public slots: - void initTestCase(); - void cleanupTestCase(); - -private slots: - void testAudioSink(); - void testAudioRecord(); - void testAudioRecordWithAMR(); - void testAudioEndPointSelector(); - void testAudioEncoderControl(); - void testMediaFormatsControl(); - void testDefaultAudioEncodingSettings(); - -private: - QUrl recordPathAudio(QDir outputDir); - - QAudioEncoderControl *audioEncoder; - QAudioEndpointSelector *audioEndpoint; - QMediaRecorder *audiocapture; - QAudioCaptureSource *captureSource; -}; -#endif diff --git a/tests/auto/qmediarecorder/tst_qmediarecorder_xa.cpp b/tests/auto/qmediarecorder/tst_qmediarecorder_xa.cpp deleted file mode 100755 index b8777b4fc..000000000 --- a/tests/auto/qmediarecorder/tst_qmediarecorder_xa.cpp +++ /dev/null @@ -1,323 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $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$ -** -****************************************************************************/ - -#include "tst_qmediarecorder_xa.h" - -QT_USE_NAMESPACE - -void tst_QMediaRecorder_xa::initTestCase() -{ - audiosource = new QAudioCaptureSource; - audiocapture = new QMediaRecorder(audiosource); -} - -void tst_QMediaRecorder_xa::cleanupTestCase() -{ - delete audiocapture; - delete audiosource; -} - -void tst_QMediaRecorder_xa::testMediaRecorderObject() -{ - //audioocontainer types - QCOMPARE(audiocapture->audioCodecDescription("pcm"), QString("pcm")); - QCOMPARE(audiocapture->audioCodecDescription("amr"), QString("amr")); - QCOMPARE(audiocapture->audioCodecDescription("aac"), QString("aac")); - QCOMPARE(audiocapture->containerDescription("audio/wav"), QString("wav container")); - QCOMPARE(audiocapture->containerDescription("audio/amr"), QString("amr File format")); - QCOMPARE(audiocapture->containerDescription("audio/mpeg"), QString("mpeg container")); - QCOMPARE(audiocapture->containerMimeType(), QString("audio/wav")); - QCOMPARE(audiocapture->error(), QMediaRecorder::NoError); - QCOMPARE(audiocapture->errorString(), QString()); - QCOMPARE(audiocapture->outputLocation().toLocalFile(), QString()); - QCOMPARE(audiocapture->state(), QMediaRecorder::StoppedState); - QCOMPARE(audiocapture->supportedAudioCodecs().count(), 3); // "pcm", "amr", "aac" - QAudioEncoderSettings settings; - settings.setCodec("pcm"); - QCOMPARE(audiocapture->supportedAudioSampleRates(settings).count(), 5); - bool isContinuous; - audiocapture->supportedAudioSampleRates(settings, &isContinuous); - QCOMPARE(isContinuous, false); - QCOMPARE(audiocapture->supportedContainers().count(), 3); // "audio/wav", "audio/amr", "audio/mpeg" -} - -void tst_QMediaRecorder_xa::testDefaultAudioEncodingSettings() -{ - QAudioEncoderSettings audioSettings = audiocapture->audioSettings(); - QCOMPARE(audioSettings.codec(), QString("pcm")); - QCOMPARE(audiocapture->containerMimeType(), QString("audio/wav")); - QCOMPARE(audioSettings.bitRate(), 0); - QCOMPARE(audioSettings.channelCount(), -1); - QCOMPARE(audioSettings.encodingMode(), QtMultimediaKit::ConstantQualityEncoding); - QCOMPARE(audioSettings.quality(), QtMultimediaKit::NormalQuality); - QCOMPARE(audioSettings.sampleRate(), -1); -} - -void tst_QMediaRecorder_xa::testAudioRecordingLocationOnly() -{ - QSignalSpy stateSignal(audiocapture,SIGNAL(stateChanged(QMediaRecorder::State))); - QCOMPARE(audiocapture->state(), QMediaRecorder::StoppedState); - QTest::qWait(500); // wait for recorder to initialize itself - audiocapture->setOutputLocation(nextFileName(QDir::rootPath(), "locationonly", "wav")); - audiocapture->record(); - QTRY_COMPARE(stateSignal.count(), 1); // wait for callbacks to complete in symbian API - QCOMPARE(audiocapture->state(), QMediaRecorder::RecordingState); - QCOMPARE(audiocapture->error(), QMediaRecorder::NoError); - QCOMPARE(audiocapture->errorString(), QString()); - QCOMPARE(stateSignal.count(), 1); - QTest::qWait(5000); // wait for 5 seconds - audiocapture->pause(); - QTRY_COMPARE(stateSignal.count(), 2); // wait for callbacks to complete in symbian API - QCOMPARE(audiocapture->state(), QMediaRecorder::PausedState); - QCOMPARE(stateSignal.count(), 2); - audiocapture->stop(); - QTRY_COMPARE(stateSignal.count(), 3); // wait for callbacks to complete in symbian API - QCOMPARE(audiocapture->state(), QMediaRecorder::StoppedState); - QCOMPARE(stateSignal.count(), 3); -} - -void tst_QMediaRecorder_xa::testAudioRecording_data() -{ - QTest::addColumn<QString>("mime"); // "audio/wav", "audio/amr", "audio/mpeg" - QTest::addColumn<QString>("codec"); // "pcm", "amr", "aac" - QTest::addColumn<QString>("filename_desc"); - QTest::addColumn<QString>("filename_ext"); // "wav", "amr", "mp4" - QTest::addColumn<QString>("settings"); - QTest::addColumn<int>("bitrate"); - QTest::addColumn<int>("samplerate"); - QTest::addColumn<int>("channels"); - - QTest::newRow("wav default") << "audio/wav" << "pcm" << "default" << "wav" << "default" << 0 << 0 << 0; - QTest::newRow("amr default") << "audio/amr" << "amr" << "default" << "amr" << "default" << 4750 << 8000 << -1; - QTest::newRow("aac default") << "audio/mpeg" << "aac" << "default" << "mp4" << "default" << 0 << 48000 << -1; - QTest::newRow("wav 08kHz Mono") << "audio/wav" << "pcm" << "Sr08kHzMono" << "wav" << "user" << 0 << 8000 << 1; - QTest::newRow("wav 08kHz Stereo") << "audio/wav" << "pcm" << "Sr08kHzStereo" << "wav" << "user" << 0 << 8000 << 2; - QTest::newRow("wav 16kHz Mono") << "audio/wav" << "pcm" << "Sr16kHzMono" << "wav" << "user" << 0 << 16000 << 1; - QTest::newRow("wav 16kHz Stereo") << "audio/wav" << "pcm" << "Sr16kHzStereo" << "wav" << "user" << 0 << 16000 << 2; - QTest::newRow("wav 32kHz Mono") << "audio/wav" << "pcm" << "Sr32kHzMono" << "wav" << "user" << 0 << 32000 << 1; - QTest::newRow("wav 32kHz Stereo") << "audio/wav" << "pcm" << "Sr32kHzStereo" << "wav" << "user" << 0<< 32000 << 2; - QTest::newRow("wav 48kHz Mono") << "audio/wav" << "pcm" << "Sr48kHzMono" << "wav" << "user" << 0 << 48000 << 1; - QTest::newRow("wav 48kHz Stereo") << "audio/wav" << "pcm" << "Sr48kHzStereo" << "wav" << "user" << 0 << 48000 << 2; - QTest::newRow("amr Br04750bps") << "audio/amr" << "amr" << "Br04750bps" << "amr" << "user" << 4750 << 8000 << 1; - QTest::newRow("amr Br05150bps") << "audio/amr" << "amr" << "Br05150bps" << "amr" << "user" << 5150 << 8000 << 1; - QTest::newRow("amr Br05900bps") << "audio/amr" << "amr" << "Br05900bps" << "amr" << "user" << 5900 << 8000 << 1; - QTest::newRow("amr Br06700bps") << "audio/amr" << "amr" << "Br06700bps" << "amr" << "user" << 6700 << 8000 << 1; - QTest::newRow("amr Br07400bps") << "audio/amr" << "amr" << "Br07400bps" << "amr" << "user" << 7400 << 8000 << 1; - QTest::newRow("amr Br07950bps") << "audio/amr" << "amr" << "Br07950bps" << "amr" << "user" << 7950 << 8000 << 1; - QTest::newRow("amr Br10200bps") << "audio/amr" << "amr" << "Br10200bps" << "amr" << "user" << 10200 << 8000 << 1; - QTest::newRow("amr Br12200bps") << "audio/amr" << "amr" << "Br12200bps" << "amr" << "user" << 10200 << 8000 << 1; - QTest::newRow("amr verylowqual") << "audio/amr" << "amr" << "verylowqual" << "amr" << "preset" << -1 << 8000 << -1; - QTest::newRow("amr lowqual") << "audio/amr" << "amr" << "lowqual" << "amr" << "preset" << -2 << 8000 << -1; - QTest::newRow("amr normalqual") << "audio/amr" << "amr" << "normalqual" << "amr" << "preset" << -3 << 8000 << -1; - QTest::newRow("amr highqual") << "audio/amr" << "amr" << "highqual" << "amr" << "preset" << -4 << 8000 << -1; - QTest::newRow("amr veryhighqual") << "audio/amr" << "amr" << "veryhighqual" << "amr" << "preset" << -5 << 8000 << -1; - - // Combinations supported for sample rate 8kHz - QTest::newRow("aac Br32k Sr8kHz Mono") << "audio/mpeg" << "aac" << "Br32kSr8kHzMono" << "mp4" << "user" << 32000 << 8000 << 1; - QTest::newRow("aac Br32k Sr8kHz Stereo") << "audio/mpeg" << "aac" << "Br32kSr8kHzStereo" << "mp4" << "user" << 32000 << 8000 << 2; - QTest::newRow("aac Br64k Sr8kHz Stereo") << "audio/mpeg" << "aac" << "Br64kSr8kHzStereo" << "mp4" << "user" << 64000 << 8000 << 2; - // Combinations supported for sample rate 16kHz - QTest::newRow("aac Br32k Sr16kHz Mono") << "audio/mpeg" << "aac" << "Br32kSr16kHzMono" << "mp4" << "user" << 32000 << 16000 << 1; - QTest::newRow("aac Br64k Sr16kHz Mono") << "audio/mpeg" << "aac" << "Br64kSr16kHzMonoo" << "mp4" << "user" << 64000 << 16000 << 1; - QTest::newRow("aac Br32k Sr16kHz Stereo") << "audio/mpeg" << "aac" << "Br32kSr16kHzStereo" << "mp4" << "user" << 32000 << 16000 << 2; - QTest::newRow("aac Br64k Sr16kHz Stereo") << "audio/mpeg" << "aac" << "Br64kSr16kHzStereo" << "mp4" << "user" << 64000 << 16000 << 2; - QTest::newRow("aac Br96k Sr16kHz Stereo") << "audio/mpeg" << "aac" << "Br96kSr16kHzStereo" << "mp4" << "user" << 96000 << 16000 << 2; - QTest::newRow("aac Br128k Sr16kHz Stereo") << "audio/mpeg" << "aac" << "Br128kSr16kHzStereo" << "mp4" << "user" << 128000 << 16000 << 2; - QTest::newRow("aac Br160k Sr16kHz Stereo") << "audio/mpeg" << "aac" << "Br160kSr16kHzStereo" << "mp4" << "user" << 160000 << 16000 << 2; - // Combinations supported for sample rate 24kHz - QTest::newRow("aac Br32k Sr24kHz Mono") << "audio/mpeg" << "aac" << "Br32kSr24kHzMono" << "mp4" << "user" << 32000 << 24000 << 1; - QTest::newRow("aac Br64k Sr24kHz Mono") << "audio/mpeg" << "aac" << "Br64kSr24kHzMono" << "mp4" << "user" << 64000 << 24000 << 1; - QTest::newRow("aac Br96k Sr24kHz Mono") << "audio/mpeg" << "aac" << "Br96kSr24kHzMono" << "mp4" << "user" << 96000 << 24000 << 1; - QTest::newRow("aac Br32k Sr24kHz Stereo") << "audio/mpeg" << "aac" << "Br32kSr24kHzStereo" << "mp4" << "user" << 32000 << 24000 << 2; - QTest::newRow("aac Br64k Sr24kHz Stereo") << "audio/mpeg" << "aac" << "Br64kSr24kHzStereo" << "mp4" << "user" << 64000 << 24000 << 2; - QTest::newRow("aac Br96k Sr24kHz Stereo") << "audio/mpeg" << "aac" << "Br96kSr24kHzStereo" << "mp4" << "user" << 96000 << 24000 << 2; - QTest::newRow("aac Br128k Sr24kHz Stereo") << "audio/mpeg" << "aac" << "Br128kSr24kHzStereo" << "mp4" << "user" << 128000 << 24000 << 2; - QTest::newRow("aac Br160k Sr24kHz Stereo") << "audio/mpeg" << "aac" << "Br160kSr24kHzStereo" << "mp4" << "user" << 160000 << 24000 << 2; - QTest::newRow("aac Br192k Sr24kHz Stereo") << "audio/mpeg" << "aac" << "Br192kSr24kHzStereo" << "mp4" << "user" << 192000 << 24000 << 2; - // Combinations supported for sample rate 32kHz - QTest::newRow("aac Br32k Sr32kHz Mono") << "audio/mpeg" << "aac" << "Br32kSr32kHzMono" << "mp4" << "user" << 32000 << 32000 << 1; - QTest::newRow("aac Br64k Sr32kHz Mono") << "audio/mpeg" << "aac" << "Br64kSr32kHzMono" << "mp4" << "user" << 64000 << 32000 << 1; - QTest::newRow("aac Br96k Sr32kHz Mono") << "audio/mpeg" << "aac" << "Br96kSr32kHzMono" << "mp4" << "user" << 96000 << 32000 << 1; - QTest::newRow("aac Br128k Sr32kHz Mono") << "audio/mpeg" << "aac" << "Br128kSr32kHzMono" << "mp4" << "user" << 128000 << 32000 << 1; - QTest::newRow("aac Br160k Sr32kHz Mono") << "audio/mpeg" << "aac" << "Br160kSr32kHzMono" << "mp4" << "user" << 160000 << 32000 << 1; - QTest::newRow("aac Br32k Sr32kHz Stereo") << "audio/mpeg" << "aac" << "Br32kSr32kHzStereo" << "mp4" << "user" << 32000 << 32000 << 2; - QTest::newRow("aac Br64k Sr32kHz Stereo") << "audio/mpeg" << "aac" << "Br64kSr32kHzStereo" << "mp4" << "user" << 64000 << 32000 << 2; - QTest::newRow("aac Br96k Sr32kHz Stereo") << "audio/mpeg" << "aac" << "Br96kSr32kHzStereo" << "mp4" << "user" << 96000 << 32000 << 2; - QTest::newRow("aac Br128k Sr32kHz Stereo") << "audio/mpeg" << "aac" << "Br128kSr32kHzStereo" << "mp4" << "user" << 128000 << 32000 << 2; - QTest::newRow("aac Br160k Sr32kHz Stereo") << "audio/mpeg" << "aac" << "Br160kSr32kHzStereo" << "mp4" << "user" << 160000 << 32000 << 2; - QTest::newRow("aac Br192k Sr32kHz Stereo") << "audio/mpeg" << "aac" << "Br192kSr32kHzStereo" << "mp4" << "user" << 192000 << 32000 << 2; - QTest::newRow("aac Br224k Sr32kHz Stereo") << "audio/mpeg" << "aac" << "Br224kSr32kHzStereo" << "mp4" << "user" << 224000 << 32000 << 2; - QTest::newRow("aac Br256k Sr32kHz Stereo") << "audio/mpeg" << "aac" << "Br256kSr32kHzStereo" << "mp4" << "user" << 256000 << 32000 << 2; - // Combinations supported for sample rate 48kHz - QTest::newRow("aac Br32k Sr48kHz Mono") << "audio/mpeg" << "aac" << "Br32kSr48kHzMono" << "mp4" << "user" << 32000 << 48000 << 1; - QTest::newRow("aac Br64k Sr48kHz Mono") << "audio/mpeg" << "aac" << "Br64kSr48kHzMono" << "mp4" << "user" << 64000 << 48000 << 1; - QTest::newRow("aac Br96k Sr48kHz Mono") << "audio/mpeg" << "aac" << "Br96kSr48kHzMono" << "mp4" << "user" << 96000 << 48000 << 1; - QTest::newRow("aac Br128k Sr48kHz Mono") << "audio/mpeg" << "aac" << "Br128kSr48kHzMono" << "mp4" << "user" << 128000 << 48000 << 1; - QTest::newRow("aac Br160k Sr48kHz Mono") << "audio/mpeg" << "aac" << "Br160kSr48kHzMono" << "mp4" << "user" << 160000 << 48000 << 1; - QTest::newRow("aac Br192k Sr48kHz Mono") << "audio/mpeg" << "aac" << "Br192kSr48kHzMono" << "mp4" << "user" << 192000 << 48000 << 1; - QTest::newRow("aac Br224k Sr48kHz Mono") << "audio/mpeg" << "aac" << "Br224kSr48kHzMono" << "mp4" << "user" << 224000 << 48000 << 1; - QTest::newRow("aac Br32k Sr48kHz Stereo") << "audio/mpeg" << "aac" << "Br32kSr48kHzStereo" << "mp4" << "user" << 32000 << 48000 << 2; - QTest::newRow("aac Br64k Sr48kHz Stereo") << "audio/mpeg" << "aac" << "Br64kSr48kHzStereo" << "mp4" << "user" << 64000 << 48000 << 2; - QTest::newRow("aac Br96k Sr48kHz Stereo") << "audio/mpeg" << "aac" << "Br96kSr48kHzStereo" << "mp4" << "user" << 96000 << 48000 << 2; - QTest::newRow("aac Br128k Sr48kHz Stereo") << "audio/mpeg" << "aac" << "Br128kSr48kHzStereo" << "mp4" << "user" << 128000 << 48000 << 2; - QTest::newRow("aac Br160k Sr48kHz Stereo") << "audio/mpeg" << "aac" << "Br160kSr48kHzStereo" << "mp4" << "user" << 160000 << 48000 << 2; - QTest::newRow("aac Br192k Sr48kHz Stereo") << "audio/mpeg" << "aac" << "Br192kSr48kHzStereo" << "mp4" << "user" << 192000 << 48000 << 2; - QTest::newRow("aac Br224k Sr48kHz Stereo") << "audio/mpeg" << "aac" << "Br224kSr48kHzStereo" << "mp4" << "user" << 224000 << 48000 << 2; - QTest::newRow("aac Br256k Sr48kHz Stereo") << "audio/mpeg" << "aac" << "Br256kSr48kHzStereo" << "mp4" << "user" << 256000 << 48000 << 2; - QTest::newRow("aac verylowqual") << "audio/mpeg" << "aac" << "verylowqual" << "mp4" << "preset" << -1 << 8000 << -1; - QTest::newRow("aac lowqual") << "audio/mpeg" << "aac" << "lowqual" << "mp4" << "preset" << -2 << 24000 << -1; - QTest::newRow("aac normalqual") << "audio/mpeg" << "aac" << "normalqual" << "mp4" << "preset" << -3 << 32000 << -1; - QTest::newRow("aac highqual") << "audio/mpeg" << "aac" << "highqual" << "mp4" << "preset" << -4 << 48000 << -1; - QTest::newRow("aac veryhighqual") << "audio/mpeg" << "aac" << "veryhighqual" << "mp4" << "preset" << -5 << 48000 << -1; - } - -void tst_QMediaRecorder_xa::testAudioRecording() -{ - QFETCH(QString, mime); - QFETCH(QString, codec); - QFETCH(QString, filename_desc); - QFETCH(QString, filename_ext); - QFETCH(QString, settings); - - QSignalSpy stateSignal(audiocapture,SIGNAL(stateChanged(QMediaRecorder::State))); - audiocapture->setOutputLocation(nextFileName(QDir::rootPath(), filename_desc, filename_ext)); - QAudioEncoderSettings audioSettings; - audioSettings.setCodec(codec); - if (settings.compare("default") == 0) { - audioSettings.setSampleRate(-1); - } - else if (settings.compare("user") == 0) { - QFETCH(int, bitrate); - QFETCH(int, samplerate); - QFETCH(int, channels); - audioSettings.setEncodingMode(QtMultimediaKit::ConstantBitRateEncoding); - if (bitrate > 0) - audioSettings.setBitRate(bitrate); - if (samplerate > 0) - audioSettings.setSampleRate(samplerate); - if ((channels > 0) || (channels == -1)) - audioSettings.setChannelCount(channels); - } - else if (settings.compare("preset") == 0) { - QFETCH(int, bitrate); - QFETCH(int, samplerate); - QFETCH(int, channels); - audioSettings.setEncodingMode(QtMultimediaKit::ConstantQualityEncoding); - QtMultimediaKit::EncodingQuality quality = QtMultimediaKit::NormalQuality; - switch(bitrate) { - case -1: - quality = QtMultimediaKit::VeryLowQuality; - break; - case -2: - quality = QtMultimediaKit::LowQuality; - break; - default: - case -3: - quality = QtMultimediaKit::NormalQuality; - break; - case -4: - quality = QtMultimediaKit::HighQuality; - break; - case -5: - quality = QtMultimediaKit::VeryHighQuality; - break; - } - audioSettings.setQuality(quality); - if (samplerate > 0) - audioSettings.setSampleRate(samplerate); - if ((channels > 0) || (channels == -1)) - audioSettings.setChannelCount(channels); - } - QVideoEncoderSettings videoSettings; - audiocapture->setEncodingSettings(audioSettings, videoSettings, mime); - QCOMPARE(audiocapture->state(), QMediaRecorder::StoppedState); - QTest::qWait(500); // wait for recorder to initialize itself - int expectedSignalCount = 1; - audiocapture->record(); - QTRY_COMPARE(stateSignal.count(), expectedSignalCount); // wait for callbacks to complete in symbian API - QCOMPARE(audiocapture->state(), QMediaRecorder::RecordingState); - QCOMPARE(audiocapture->error(), QMediaRecorder::NoError); - QCOMPARE(audiocapture->errorString(), QString()); - QCOMPARE(stateSignal.count(), expectedSignalCount); - QTest::qWait(5000); // wait for 5 seconds - // If we are not testing aac recording to mp4 container - if (!((mime.compare("audio/mpeg") == 0) && (codec.compare("aac") == 0))) { - expectedSignalCount++; - audiocapture->pause(); - QTRY_COMPARE(stateSignal.count(), expectedSignalCount); // wait for callbacks to complete in symbian API - QCOMPARE(audiocapture->state(), QMediaRecorder::PausedState); - QCOMPARE(stateSignal.count(), expectedSignalCount); - } - expectedSignalCount++; - audiocapture->stop(); - QTRY_COMPARE(stateSignal.count(), expectedSignalCount); // wait for callbacks to complete in symbian API - QCOMPARE(audiocapture->state(), QMediaRecorder::StoppedState); - QCOMPARE(stateSignal.count(), expectedSignalCount); - /* testAudioRecording() function gets executed for each rown in the table. - * If and when all tests in the table passes, test log will just contain one - * entry 'PASS : tst_QMediaRecorder_xa::testAudioRecording()'. To figure out - * which test in the loop completed successfully, just print a debug message - * which also goes into the test log generated.*/ - qDebug() << "----> PASS"; -} - -void tst_QMediaRecorder_xa::testOutputLocation() -{ - audiocapture->setOutputLocation(QUrl("test.wav")); - QUrl s = audiocapture->outputLocation(); - QCOMPARE(s.toString(), QString("test.wav")); -} - -QUrl tst_QMediaRecorder_xa::nextFileName(QDir outputDir, QString appendName, QString ext) -{ - int lastImage = 0; - int fileCount = 0; - foreach( QString fileName, outputDir.entryList(QStringList() << "testclip_*." + ext) ) { - int imgNumber = fileName.mid(5, fileName.size()-9).toInt(); - lastImage = qMax(lastImage, imgNumber); - if (outputDir.exists(fileName)) - fileCount+=1; - } - lastImage+=fileCount; - - QUrl location(QDir::toNativeSeparators(outputDir.canonicalPath() + QString("/testclip_%1").arg(lastImage+1 , 4, 10, QLatin1Char('0')) + appendName + "." + ext)); - return location; -} diff --git a/tests/auto/qmediarecorder/tst_qmediarecorder_xa.h b/tests/auto/qmediarecorder/tst_qmediarecorder_xa.h deleted file mode 100755 index c7fe415e4..000000000 --- a/tests/auto/qmediarecorder/tst_qmediarecorder_xa.h +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $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$ -** -****************************************************************************/ - -#ifndef TST_QMEDIARECORDER_XA_H -#define TST_QMEDIARECORDER_XA_H - -#include <QtTest/QtTest> -#include <qmediarecorder.h> -#include <qaudiocapturesource.h> - -#include "s60common.h" - -QT_USE_NAMESPACE - -class tst_QMediaRecorder_xa: public QObject -{ - Q_OBJECT - -public slots: - void initTestCase(); - void cleanupTestCase(); - -private slots: - void testMediaRecorderObject(); //1 - void testDefaultAudioEncodingSettings(); //2 - void testOutputLocation(); //3 - void testAudioRecordingLocationOnly(); //4 - void testAudioRecording_data(); //5 - void testAudioRecording(); //6 - -private: - QUrl nextFileName(QDir outputDir, QString appendName, QString ext); - -private: - QAudioCaptureSource* audiosource; - QMediaRecorder* audiocapture; - -}; - -#endif /* TST_QMEDIARECORDER_XA_H */ diff --git a/tests/auto/qpaintervideosurface/qpaintervideosurface.pro b/tests/auto/qpaintervideosurface/qpaintervideosurface.pro index 0364c45b0..9d14c4aeb 100644 --- a/tests/auto/qpaintervideosurface/qpaintervideosurface.pro +++ b/tests/auto/qpaintervideosurface/qpaintervideosurface.pro @@ -1,7 +1,7 @@ load(qttest_p4) QT += multimediakit-private -contains(QT_CONFIG, opengl) | contains(QT_CONFIG, opengles2): !symbian { +contains(QT_CONFIG, opengl) | contains(QT_CONFIG, opengles2) { QT += opengl } else { DEFINES += QT_NO_OPENGL diff --git a/tests/auto/qradiotuner/main.cpp b/tests/auto/qradiotuner/main.cpp index f161c8fd6..ca44f1f74 100755 --- a/tests/auto/qradiotuner/main.cpp +++ b/tests/auto/qradiotuner/main.cpp @@ -43,37 +43,11 @@ #include "tst_qradiotuner.h" -#ifdef Q_OS_SYMBIAN -#include "tst_qradiotuner_xa.h" -#include "tst_qradiotuner_s60.h" -#endif - int main(int argc, char**argv) { QApplication app(argc,argv); int ret; tst_QRadioTuner test_api; ret = QTest::qExec(&test_api, argc, argv); -#ifdef Q_OS_SYMBIAN - char *new_argv[3]; - QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + "_xa.log"; - QByteArray bytes = str.toAscii(); - char arg1[] = "-o"; - new_argv[0] = argv[0]; - new_argv[1] = arg1; - new_argv[2] = bytes.data(); - tst_QXARadio_xa test_xa; - ret = QTest::qExec(&test_xa, 3, new_argv); - char *new_argv1[3]; - QString str1 = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + "_s60.log"; - QByteArray bytes1 = str1.toAscii(); - char arg2[] = "-o"; - new_argv1[0] = argv[0]; - new_argv1[1] = arg2; - new_argv1[2] = bytes1.data(); - tst_QRadioTuner_s60 test_s60; - ret = QTest::qExec(&test_s60, 3, new_argv1); - -#endif return ret; } diff --git a/tests/auto/qradiotuner/qradiotuner.pro b/tests/auto/qradiotuner/qradiotuner.pro index b80043801..d8818d3db 100644 --- a/tests/auto/qradiotuner/qradiotuner.pro +++ b/tests/auto/qradiotuner/qradiotuner.pro @@ -5,15 +5,6 @@ QT += multimediakit-private # TARGET = tst_qradiotuner # CONFIG += testcase -symbian { - HEADERS += tst_qradiotuner_xa.h - SOURCES += tst_qradiotuner_xa.cpp - TARGET.CAPABILITY = ALL -TCB - HEADERS += tst_qradiotuner_s60.h - SOURCES += tst_qradiotuner_s60.cpp - -} - HEADERS += tst_qradiotuner.h SOURCES += main.cpp tst_qradiotuner.cpp diff --git a/tests/auto/qradiotuner/tst_qradiotuner_s60.cpp b/tests/auto/qradiotuner/tst_qradiotuner_s60.cpp deleted file mode 100644 index 3c3de22da..000000000 --- a/tests/auto/qradiotuner/tst_qradiotuner_s60.cpp +++ /dev/null @@ -1,170 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $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 "tst_qradiotuner_s60.h" - -#define QTRY_COMPARE_S60(a,e) \ - for (int _i = 0; _i < 5000; _i += 100) { \ - if ((a) == (e)) break; \ - QTest::qWait(100); \ - } - -void tst_QRadioTuner_s60::initTestCase() -{ - qRegisterMetaType<QRadioTuner::State>("QRadioTuner::State"); - qRegisterMetaType<QRadioTuner::Band>("QRadioTuner::Band"); - - radio = new QRadioTuner(0); - QVERIFY(radio->service() != 0); - - QSignalSpy stateSpy(radio, SIGNAL(stateChanged(QRadioTuner::State))); - - QCOMPARE(radio->state(), QRadioTuner::StoppedState); - radio->start(); - //QCOMPARE(radio->state(), QRadioTuner::ActiveState); - QTRY_COMPARE_S60(radio->state(), QRadioTuner::ActiveState); - - QCOMPARE(stateSpy.count(), 1); - QCOMPARE(stateSpy.first()[0].value<QRadioTuner::State>(), QRadioTuner::ActiveState); -} - -void tst_QRadioTuner_s60::cleanupTestCase() -{ - QVERIFY(radio->error() == QRadioTuner::NoError); - QVERIFY(radio->errorString().isEmpty()); - - QSignalSpy stateSpy(radio, SIGNAL(stateChanged(QRadioTuner::State))); - - radio->stop(); - QTRY_COMPARE_S60(radio->state(), QRadioTuner::StoppedState); - QCOMPARE(stateSpy.count(), 1); - - QCOMPARE(stateSpy.first()[0].value<QRadioTuner::State>(), QRadioTuner::StoppedState); - - delete radio; -} - -void tst_QRadioTuner_s60::testBand() -{ - QVERIFY(radio->isBandSupported(QRadioTuner::FM)); - QVERIFY(!radio->isBandSupported(QRadioTuner::SW)); - - if(radio->isBandSupported(QRadioTuner::AM)) { - QSignalSpy readSignal(radio, SIGNAL(bandChanged(QRadioTuner::Band))); - radio->setBand(QRadioTuner::AM); - QTestEventLoop::instance().enterLoop(1); - QVERIFY(radio->band() == QRadioTuner::AM); - QVERIFY(readSignal.count() == 1); - } -} - -void tst_QRadioTuner_s60::testFrequency() -{ - QSignalSpy readSignal(radio, SIGNAL(frequencyChanged(int))); - radio->setFrequency(104500000); - QTestEventLoop::instance().enterLoop(1); - QVERIFY(radio->frequency() == 104500000); - QVERIFY(readSignal.count() == 1); - - // frequencyStep for FM radio is 100kHz (100000Hz) - QVERIFY(radio->frequencyStep(QRadioTuner::FM) == 100000); - QPair<int,int> test = radio->frequencyRange(QRadioTuner::FM); - // frequency range for FM radio is 87,5MHz - 108MHz - QVERIFY(test.first == 87500000); - QVERIFY(test.second == 108000000); -} - -void tst_QRadioTuner_s60::testMute() -{ - QSignalSpy readSignal(radio, SIGNAL(mutedChanged(bool))); - radio->setMuted(true); - QTestEventLoop::instance().enterLoop(1); - QVERIFY(radio->isMuted()); - QVERIFY(readSignal.count() == 1); -} - -void tst_QRadioTuner_s60::testSearch() -{ - QSignalSpy readSignal(radio, SIGNAL(searchingChanged(bool))); - QVERIFY(!radio->isSearching()); - - radio->searchForward(); - QVERIFY(radio->isSearching()); - QVERIFY(readSignal.count() == 1); - - radio->cancelSearch(); - QTestEventLoop::instance().enterLoop(1); - QVERIFY(!radio->isSearching()); - QVERIFY(readSignal.count() == 2); - - radio->searchBackward(); - QVERIFY(radio->isSearching()); - QVERIFY(readSignal.count() == 3); - - radio->cancelSearch(); - QVERIFY(!radio->isSearching()); -} - -void tst_QRadioTuner_s60::testVolume() -{ - QVERIFY(radio->volume() == 50); - QSignalSpy readSignal(radio, SIGNAL(volumeChanged(int))); - radio->setVolume(70); - QTestEventLoop::instance().enterLoop(1); - QTRY_COMPARE_S60(radio->volume() , 70); - QTRY_COMPARE_S60(readSignal.count() ,1); -} - -void tst_QRadioTuner_s60::testSignal() -{ - int signalStrength = radio->signalStrength(); - QVERIFY(signalStrength == signalStrength); - // There is no set of this only a get, do nothing else. -} - -void tst_QRadioTuner_s60::testStereo() -{ - QVERIFY(radio->isStereo()); - radio->setStereoMode(QRadioTuner::ForceMono); - QVERIFY(radio->stereoMode() == QRadioTuner::ForceMono); -} diff --git a/tests/auto/qradiotuner/tst_qradiotuner_s60.h b/tests/auto/qradiotuner/tst_qradiotuner_s60.h deleted file mode 100644 index 2767fcb59..000000000 --- a/tests/auto/qradiotuner/tst_qradiotuner_s60.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $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$ -** -****************************************************************************/ -#ifndef TST_QRADIOTUNER_S60_H -#define TST_QRADIOTUNER_S60_H - -#include <QtTest/QtTest> -#include <QDebug> -#include <QTimer> - -#include <qmediaobject.h> -#include <qmediacontrol.h> -#include <qmediaservice.h> -#include <qradiotunercontrol.h> -#include <qradiotuner.h> - -#include <QMessageBox> - -QT_USE_NAMESPACE - -class tst_QRadioTuner_s60: public QObject -{ - Q_OBJECT - -public slots: - void initTestCase(); - void cleanupTestCase(); - -private slots: - void testBand(); - void testFrequency(); - void testMute(); - void testSearch(); - void testVolume(); - void testSignal(); - void testStereo(); - -private: - QRadioTuner *radio; -}; - -#endif diff --git a/tests/auto/qradiotuner/tst_qradiotuner_xa.cpp b/tests/auto/qradiotuner/tst_qradiotuner_xa.cpp deleted file mode 100644 index dec65f839..000000000 --- a/tests/auto/qradiotuner/tst_qradiotuner_xa.cpp +++ /dev/null @@ -1,224 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $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$ -** -****************************************************************************/ - -#include "tst_qradiotuner_xa.h" - -QT_USE_NAMESPACE - -#define QTEST_MAIN_S60(TestObject) \ - int main(int argc, char *argv[]) { \ - char *new_argv[3]; \ - QApplication app(argc, argv); \ - \ - QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log"; \ - QByteArray bytes = str.toAscii(); \ - \ - char arg1[] = "-o"; \ - \ - new_argv[0] = argv[0]; \ - new_argv[1] = arg1; \ - new_argv[2] = bytes.data(); \ - \ - TestObject tc; \ - return QTest::qExec(&tc, 3, new_argv); \ - } - -#define QTRY_COMPARE(a,e) \ - for (int _i = 0; _i < 5000; _i += 100) { \ - if ((a) == (e)) break; \ - QTest::qWait(100); \ - } \ -// QCOMPARE(a, e) - -void tst_QXARadio_xa::initTestCase() -{ - qRegisterMetaType<QRadioTuner::State>("QRadioTuner::State"); - radio = new QRadioTuner(0); -// QVERIFY(radio->service() != 0); -// QSignalSpy stateSpy(radio, SIGNAL(stateChanged(QRadioTuner::State))); - radio->start(); -// QTRY_COMPARE(stateSpy.count(), 1); // wait for callbacks to complete in symbian API -// QCOMPARE(radio->state(), QRadioTuner::ActiveState); - -} - -void tst_QXARadio_xa::cleanupTestCase() -{ - QVERIFY(radio->service() != 0); -} - -void tst_QXARadio_xa::testBand() -{ - qRegisterMetaType<QRadioTuner::Band>("QRadioTuner::Band"); - - QVERIFY(radio->isBandSupported(QRadioTuner::FM)); - QVERIFY(!radio->isBandSupported(QRadioTuner::SW)); - radio->setBand(QRadioTuner::FM); - QVERIFY(radio->band() == QRadioTuner::FM); - if(radio->isBandSupported(QRadioTuner::AM)) { - QSignalSpy readSignal(radio, SIGNAL(bandChanged(QRadioTuner::Band))); - radio->setBand(QRadioTuner::AM); - QTRY_COMPARE(readSignal.count(), 1); // wait for callbacks to complete in symbian API - QVERIFY(radio->band() == QRadioTuner::AM); - } -} - -void tst_QXARadio_xa::testFrequency() -{ - QSignalSpy readSignal(radio, SIGNAL(frequencyChanged(int))); - radio->setFrequency(90900000); - QTRY_COMPARE(readSignal.count(), 1); // wait for callbacks to complete in symbian API - QVERIFY(radio->frequency() == 90900000); - // frequencyStep for FM radio is 100kHz (100000Hz) - QVERIFY(radio->frequencyStep(QRadioTuner::FM) == 100000); - QPair<int,int> test = radio->frequencyRange(QRadioTuner::FM); - // frequency range for FM radio is 87,5MHz - 108MHz - QVERIFY(test.first == 87500000); - QVERIFY(test.second == 108000000); -} - -void tst_QXARadio_xa::testMute() -{ - QSignalSpy readSignal(radio, SIGNAL(mutedChanged(bool))); - radio->setMuted(true); - QTRY_COMPARE(readSignal.count(), 1); // wait for callbacks to complete in symbian API - QVERIFY(radio->isMuted()); - QVERIFY(readSignal.count() == 1); -} - -void tst_QXARadio_xa::testSearch() -{ - QSignalSpy readSignal(radio, SIGNAL(searchingChanged(bool))); - QVERIFY(!radio->isSearching()); - - radio->searchForward(); - // Note: DON'T wait for callback to complete in symbian API - QVERIFY(radio->isSearching()); - - radio->cancelSearch(); - QTRY_COMPARE(readSignal.count(), 1); // wait for callbacks to complete in symbian API - QVERIFY(!radio->isSearching()); - - radio->searchBackward(); - // Note: DON'T wait for callbacks to complete in symbian API - QVERIFY(radio->isSearching()); - - radio->cancelSearch(); - QTRY_COMPARE(readSignal.count(), 1); // wait for callbacks to complete in symbian API - QVERIFY(!radio->isSearching()); -} - -void tst_QXARadio_xa::testVolume() -{ - QSignalSpy readSignal(radio, SIGNAL(volumeChanged(int))); - radio->setVolume(50); - QTRY_COMPARE(readSignal.count(), 1); // wait for callbacks to complete in symbian API - QVERIFY(radio->volume() == 50); -} - -void tst_QXARadio_xa::testSignal() -{ - QVERIFY(radio->signalStrength() != 0); - // There is no set of this only a get, do nothing else. -} - -void tst_QXARadio_xa::testStereo() -{ - // Default = Auto. Testing transition from auto to mono: - QVERIFY(radio->isStereo()); - QSignalSpy readSignal(radio, SIGNAL(stereoStatusChanged(bool))); - radio->setStereoMode(QRadioTuner::ForceMono); - QTRY_COMPARE(readSignal.count(), 1); // wait for callbacks to complete in symbian API - QVERIFY(radio->stereoMode() == QRadioTuner::ForceMono); -// QVERIFY(readSignal.count() == 1); - - // testing transition from mono to stereo: - radio->setStereoMode(QRadioTuner::ForceStereo); - QTRY_COMPARE(readSignal.count(), 1); // wait for callbacks to complete in symbian API - QVERIFY(radio->stereoMode() == QRadioTuner::ForceStereo); -// QVERIFY(readSignal.count() == 1); - - // testing transition from stereo to auto: - radio->setStereoMode(QRadioTuner::Auto); - QTRY_COMPARE(readSignal.count(), 1); // wait for callbacks to complete in symbian API - QVERIFY(radio->stereoMode() == QRadioTuner::Auto); - // QVERIFY(readSignal.count() == 1); - - // testing transition from auto to stereo: - radio->setStereoMode(QRadioTuner::ForceStereo); - QTRY_COMPARE(readSignal.count(), 1); // wait for callbacks to complete in symbian API - QVERIFY(radio->stereoMode() == QRadioTuner::ForceStereo); - // QVERIFY(readSignal.count() == 1); - - // testing transition from stereo to mono: - radio->setStereoMode(QRadioTuner::ForceMono); - QTRY_COMPARE(readSignal.count(), 1); // wait for callbacks to complete in symbian API - QVERIFY(radio->stereoMode() == QRadioTuner::ForceMono); - // QVERIFY(readSignal.count() == 1); - - // testing transition from mono to auto: - radio->setStereoMode(QRadioTuner::Auto); - QTRY_COMPARE(readSignal.count(), 1); // wait for callbacks to complete in symbian API - QVERIFY(radio->stereoMode() == QRadioTuner::Auto); -// QVERIFY(readSignal.count() == 1); - -} - -void tst_QXARadio_xa::testAvailability() -{ - QVERIFY(radio->isAvailable()); - QVERIFY(radio->availabilityError() == QtMultimediaKit::NoError); -} - -void tst_QXARadio_xa::testStopRadio() -{ - QVERIFY(radio->service() != 0); - QVERIFY(radio->error() == QRadioTuner::NoError); - QVERIFY(radio->errorString().isEmpty()); - - QSignalSpy stateSpy(radio, SIGNAL(stateChanged(QRadioTuner::State))); - - radio->stop(); - QTRY_COMPARE(stateSpy.count(), 1); // wait for callbacks to complete in symbian API - QCOMPARE(radio->state(), QRadioTuner::StoppedState); - -// delete radio; -} diff --git a/tests/auto/qradiotuner/tst_qradiotuner_xa.h b/tests/auto/qradiotuner/tst_qradiotuner_xa.h deleted file mode 100644 index 6cb7c7802..000000000 --- a/tests/auto/qradiotuner/tst_qradiotuner_xa.h +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Mobility Components. -** -** $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$ -** -****************************************************************************/ -#ifndef TST_QRADIOTUNER_XA_H -#define TST_QRADIOTUNER_XA_H - -#include <QtTest/QtTest> -#include <QDebug> -#include <QTimer> -#include <qmediaobject.h> -#include <qmediacontrol.h> -#include <qmediaservice.h> -#include <qradiotunercontrol.h> -#include <qradiotuner.h> -#include <qtmedianamespace.h> - -#include <QMessageBox> - -QT_USE_NAMESPACE - -class tst_QXARadio_xa: public QObject -{ - Q_OBJECT - -public slots: - void initTestCase(); - void cleanupTestCase(); - -private slots: - void testBand(); - void testFrequency(); - void testMute(); - void testSearch(); - void testVolume(); - void testSignal(); - void testStereo(); - void testAvailability(); - void testStopRadio(); - -private: - QRadioTuner *radio; -}; - -#endif // TST_QRADIOTUNER_XA_H diff --git a/tests/auto/qsoundeffect/qsoundeffect.pro b/tests/auto/qsoundeffect/qsoundeffect.pro index c2efb1170..116aa30ab 100644 --- a/tests/auto/qsoundeffect/qsoundeffect.pro +++ b/tests/auto/qsoundeffect/qsoundeffect.pro @@ -6,17 +6,9 @@ QT += core declarative multimediakit-private SOURCES += tst_qsoundeffect.cpp -wince*|symbian { - deploy.files = test.wav - DEPLOYMENT = deploy - DEFINES += QT_QSOUNDEFFECT_USEAPPLICATIONPATH -} else:maemo* { - DEFINES += QT_QSOUNDEFFECT_USEAPPLICATIONPATH -} else { - DEFINES += SRCDIR=\\\"$$PWD/\\\" -} +DEFINES += SRCDIR=\\\"$$PWD/\\\" -unix:!mac:!symbian { +unix:!mac { !contains(QT_CONFIG, pulseaudio) { DEFINES += QT_MULTIMEDIA_QMEDIAPLAYER } |