Remove a few more obsolete parts.

Change-Id: I3a001f01ab7fd8cf63452126037b98c1b01df80d
Reviewed-on: http://codereview.qt.nokia.com/1797
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com>
This commit is contained in:
Michael Goddard
2011-07-19 10:40:05 +10:00
committed by Qt by Nokia
parent 1403a1c7be
commit eccb43d73c
100 changed files with 50 additions and 8051 deletions

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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();
}

View File

@@ -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

View File

@@ -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());
}
}

View File

@@ -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