summaryrefslogtreecommitdiffstats
path: root/src/3rdparty
diff options
context:
space:
mode:
authorGareth Stockwell <ext-gareth.stockwell@nokia.com>2009-12-02 16:20:00 (GMT)
committerGareth Stockwell <ext-gareth.stockwell@nokia.com>2009-12-08 13:07:30 (GMT)
commit89e1e7fcbcbe93d8096afe0f7c240fe706cc9069 (patch)
tree2e47fde0386d04d42d6aadf09c824ea10b72da5f /src/3rdparty
parent946dede337f0a43ccb394c10aa2045bc9ef59301 (diff)
downloadQt-89e1e7fcbcbe93d8096afe0f7c240fe706cc9069.zip
Qt-89e1e7fcbcbe93d8096afe0f7c240fe706cc9069.tar.gz
Qt-89e1e7fcbcbe93d8096afe0f7c240fe706cc9069.tar.bz2
Implemented support for playlist handling in Phonon MMF backend
The main changes are: 1. MediaObject emits prefinishMark at the appropriate instant 2. MediaObject emits aboutToFinish at the appropriate instant 3. MediaObject switches to next source when playback completes Task-number: QTBUG-6214 Reviewed-by: Frans Englich
Diffstat (limited to 'src/3rdparty')
-rw-r--r--src/3rdparty/phonon/mmf/abstractmediaplayer.cpp84
-rw-r--r--src/3rdparty/phonon/mmf/abstractmediaplayer.h17
-rw-r--r--src/3rdparty/phonon/mmf/abstractplayer.cpp22
-rw-r--r--src/3rdparty/phonon/mmf/abstractplayer.h13
-rw-r--r--src/3rdparty/phonon/mmf/audioplayer.cpp41
-rw-r--r--src/3rdparty/phonon/mmf/audioplayer.h5
-rw-r--r--src/3rdparty/phonon/mmf/dummyplayer.cpp19
-rw-r--r--src/3rdparty/phonon/mmf/dummyplayer.h8
-rw-r--r--src/3rdparty/phonon/mmf/mediaobject.cpp54
-rw-r--r--src/3rdparty/phonon/mmf/mediaobject.h11
-rw-r--r--src/3rdparty/phonon/mmf/mmf_videoplayer.cpp22
-rw-r--r--src/3rdparty/phonon/mmf/mmf_videoplayer.h3
12 files changed, 129 insertions, 170 deletions
diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
index 83c534a..18f96cc 100644
--- a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
+++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
@@ -20,6 +20,7 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#include "abstractmediaplayer.h"
#include "defs.h"
+#include "mediaobject.h"
#include "utils.h"
QT_BEGIN_NAMESPACE
@@ -43,22 +44,16 @@ const int BufferStatusTimerInterval = 100; // ms
// Constructor / destructor
//-----------------------------------------------------------------------------
-MMF::AbstractMediaPlayer::AbstractMediaPlayer() :
- m_playPending(false)
- , m_positionTimer(new QTimer(this))
- , m_bufferStatusTimer(new QTimer(this))
- , m_mmfMaxVolume(NullMaxVolume)
-{
- connect(m_positionTimer.data(), SIGNAL(timeout()), this, SLOT(positionTick()));
- connect(m_bufferStatusTimer.data(), SIGNAL(timeout()), this, SLOT(bufferStatusTick()));
-}
-
-MMF::AbstractMediaPlayer::AbstractMediaPlayer(const AbstractPlayer& player) :
- AbstractPlayer(player)
+MMF::AbstractMediaPlayer::AbstractMediaPlayer
+ (MediaObject *parent, const AbstractPlayer *player)
+ : AbstractPlayer(player)
+ , m_parent(parent)
, m_playPending(false)
, m_positionTimer(new QTimer(this))
, m_bufferStatusTimer(new QTimer(this))
, m_mmfMaxVolume(NullMaxVolume)
+ , m_prefinishMarkSent(false)
+ , m_aboutToFinishSent(false)
{
connect(m_positionTimer.data(), SIGNAL(timeout()), this, SLOT(positionTick()));
connect(m_bufferStatusTimer.data(), SIGNAL(timeout()), this, SLOT(bufferStatusTick()));
@@ -220,12 +215,7 @@ void MMF::AbstractMediaPlayer::doSetTickInterval(qint32 interval)
TRACE_EXIT_0();
}
-MediaSource MMF::AbstractMediaPlayer::source() const
-{
- return m_source;
-}
-
-void MMF::AbstractMediaPlayer::setFileSource(const MediaSource &source, RFile& file)
+void MMF::AbstractMediaPlayer::open(const MediaSource &source, RFile& file)
{
TRACE_CONTEXT(AbstractMediaPlayer::setFileSource, EAudioApi);
TRACE_ENTRY("state %d source.type %d", privateState(), source.type());
@@ -233,14 +223,10 @@ void MMF::AbstractMediaPlayer::setFileSource(const MediaSource &source, RFile& f
close();
changeState(GroundState);
- // TODO: is it correct to assign even if the media type is not supported in
- // the switch statement below?
- m_source = source;
-
TInt symbianErr = KErrNone;
QString errorMessage;
- switch (m_source.type()) {
+ switch (source.type()) {
case MediaSource::LocalFile: {
symbianErr = openFile(file);
if (KErrNone != symbianErr)
@@ -293,20 +279,6 @@ void MMF::AbstractMediaPlayer::setFileSource(const MediaSource &source, RFile& f
TRACE_EXIT_0();
}
-void MMF::AbstractMediaPlayer::setNextSource(const MediaSource &source)
-{
- TRACE_CONTEXT(AbstractMediaPlayer::setNextSource, EAudioApi);
- TRACE_ENTRY("state %d", privateState());
-
- // TODO: handle 'next source'
-
- m_nextSource = source;
- Q_UNUSED(source);
-
- TRACE_EXIT_0();
-}
-
-
void MMF::AbstractMediaPlayer::volumeChanged(qreal volume)
{
TRACE_CONTEXT(AbstractMediaPlayer::volumeChanged, EAudioInternal);
@@ -402,6 +374,23 @@ void MMF::AbstractMediaPlayer::maxVolumeChanged(int mmfMaxVolume)
doVolumeChanged();
}
+void MMF::AbstractMediaPlayer::playbackComplete(int error)
+{
+ stopTimers();
+
+ if (KErrNone == error) {
+ changeState(StoppedState);
+
+ // MediaObject::switchToNextSource deletes the current player, so we
+ // call it via delayed slot invokation to ensure that this object does
+ // not get deleted during execution of a member function.
+ QMetaObject::invokeMethod(m_parent, "switchToNextSource", Qt::QueuedConnection);
+ }
+ else {
+ setError(tr("Playback complete"), error);
+ }
+}
+
qint64 MMF::AbstractMediaPlayer::toMilliSeconds(const TTimeIntervalMicroSeconds &in)
{
return in.Int64() / 1000;
@@ -413,7 +402,26 @@ qint64 MMF::AbstractMediaPlayer::toMilliSeconds(const TTimeIntervalMicroSeconds
void MMF::AbstractMediaPlayer::positionTick()
{
- emit MMF::AbstractPlayer::tick(currentTime());
+ const qint64 current = currentTime();
+ const qint64 total = totalTime();
+ const qint64 remaining = total - current;
+
+ if (prefinishMark() && !m_prefinishMarkSent) {
+ if (remaining < (prefinishMark() + tickInterval()/2)) {
+ m_prefinishMarkSent = true;
+ emit prefinishMarkReached(remaining);
+ }
+ }
+
+ if (!m_aboutToFinishSent) {
+ if (remaining < tickInterval()) {
+ m_aboutToFinishSent = true;
+ emit aboutToFinish();
+ }
+ }
+
+ // For the MWC compiler, we need to qualify the base class.
+ emit MMF::AbstractPlayer::tick(current);
}
void MMF::AbstractMediaPlayer::bufferStatusTick()
diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.h b/src/3rdparty/phonon/mmf/abstractmediaplayer.h
index 7c11ec7..24fa228 100644
--- a/src/3rdparty/phonon/mmf/abstractmediaplayer.h
+++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.h
@@ -33,6 +33,7 @@ namespace Phonon
namespace MMF
{
class AudioOutput;
+class MediaObject;
/**
* Interface via which MMF client APIs for both audio and video can be
@@ -43,19 +44,17 @@ class AbstractMediaPlayer : public AbstractPlayer
Q_OBJECT
protected:
- AbstractMediaPlayer();
- explicit AbstractMediaPlayer(const AbstractPlayer& player);
+ AbstractMediaPlayer(MediaObject *parent, const AbstractPlayer *player);
public:
+ virtual void open(const Phonon::MediaSource&, RFile&);
+
// MediaObjectInterface
virtual void play();
virtual void pause();
virtual void stop();
virtual void seek(qint64 milliseconds);
virtual bool isSeekable() const;
- virtual MediaSource source() const;
- virtual void setFileSource(const Phonon::MediaSource&, RFile&);
- virtual void setNextSource(const MediaSource &source);
virtual void volumeChanged(qreal volume);
protected:
@@ -81,6 +80,8 @@ protected:
void bufferingStarted();
void bufferingComplete();
void maxVolumeChanged(int maxVolume);
+ void playbackComplete(int error);
+
static qint64 toMilliSeconds(const TTimeIntervalMicroSeconds &);
private:
@@ -96,6 +97,8 @@ private Q_SLOTS:
void bufferStatusTick();
private:
+ MediaObject *const m_parent;
+
/**
* This flag is set to true if play is called when the object is
* in a Loading state. Once loading is complete, playback will
@@ -110,8 +113,8 @@ private:
int m_mmfMaxVolume;
- MediaSource m_source;
- MediaSource m_nextSource;
+ bool m_prefinishMarkSent;
+ bool m_aboutToFinishSent;
QMultiMap<QString, QString> m_metaData;
diff --git a/src/3rdparty/phonon/mmf/abstractplayer.cpp b/src/3rdparty/phonon/mmf/abstractplayer.cpp
index 13ff5fb..53973eb 100644
--- a/src/3rdparty/phonon/mmf/abstractplayer.cpp
+++ b/src/3rdparty/phonon/mmf/abstractplayer.cpp
@@ -33,7 +33,7 @@ using namespace Phonon::MMF;
// Constructor / destructor
//-----------------------------------------------------------------------------
-MMF::AbstractPlayer::AbstractPlayer()
+MMF::AbstractPlayer::AbstractPlayer(const AbstractPlayer *player)
: m_videoOutput(0)
, m_volume(InitialVolume)
, m_state(GroundState)
@@ -42,19 +42,13 @@ MMF::AbstractPlayer::AbstractPlayer()
, m_transitionTime(0)
, m_prefinishMark(0)
{
-
-}
-
-MMF::AbstractPlayer::AbstractPlayer(const AbstractPlayer& player)
- : m_videoOutput(player.m_videoOutput)
- , m_volume(player.m_volume)
- , m_state(GroundState)
- , m_error(NoError)
- , m_tickInterval(player.tickInterval())
- , m_transitionTime(player.transitionTime())
- , m_prefinishMark(player.prefinishMark())
-{
-
+ if(player) {
+ m_videoOutput = player->m_videoOutput;
+ m_volume = player->m_volume;
+ m_tickInterval = player->m_tickInterval;
+ m_transitionTime = player->m_transitionTime;
+ m_prefinishMark = player->m_prefinishMark;
+ }
}
//-----------------------------------------------------------------------------
diff --git a/src/3rdparty/phonon/mmf/abstractplayer.h b/src/3rdparty/phonon/mmf/abstractplayer.h
index 5aaae3c..40ad7f8 100644
--- a/src/3rdparty/phonon/mmf/abstractplayer.h
+++ b/src/3rdparty/phonon/mmf/abstractplayer.h
@@ -53,8 +53,9 @@ class AbstractPlayer : public QObject
Q_OBJECT
public:
- AbstractPlayer();
- explicit AbstractPlayer(const AbstractPlayer& player);
+ AbstractPlayer(const AbstractPlayer *player);
+
+ virtual void open(const Phonon::MediaSource&, RFile&) = 0;
// MediaObjectInterface (implemented)
qint32 tickInterval() const;
@@ -75,12 +76,6 @@ public:
virtual Phonon::ErrorType errorType() const;
virtual QString errorString() const;
virtual qint64 totalTime() const = 0;
- virtual Phonon::MediaSource source() const = 0;
- // This is a temporary hack to work around KErrInUse from MMF
- // client utility OpenFileL calls
- //virtual void setSource(const Phonon::MediaSource &) = 0;
- virtual void setFileSource(const Phonon::MediaSource&, RFile&) = 0;
- virtual void setNextSource(const Phonon::MediaSource &) = 0;
virtual void volumeChanged(qreal volume);
@@ -114,6 +109,8 @@ Q_SIGNALS:
void stateChanged(Phonon::State oldState,
Phonon::State newState);
void metaDataChanged(const QMultiMap<QString, QString>& metaData);
+ void aboutToFinish();
+ void prefinishMarkReached(qint32 remaining);
protected:
/**
diff --git a/src/3rdparty/phonon/mmf/audioplayer.cpp b/src/3rdparty/phonon/mmf/audioplayer.cpp
index 0967a27..77488f4 100644
--- a/src/3rdparty/phonon/mmf/audioplayer.cpp
+++ b/src/3rdparty/phonon/mmf/audioplayer.cpp
@@ -34,13 +34,9 @@ using namespace Phonon::MMF;
// Constructor / destructor
//-----------------------------------------------------------------------------
-MMF::AudioPlayer::AudioPlayer()
-{
- construct();
-}
-
-MMF::AudioPlayer::AudioPlayer(const AbstractPlayer& player)
- : AbstractMediaPlayer(player)
+MMF::AudioPlayer::AudioPlayer(MediaObject *parent, const AbstractPlayer *player)
+ : AbstractMediaPlayer(parent, player)
+ , m_totalTime(0)
{
construct();
}
@@ -177,7 +173,7 @@ qint64 MMF::AudioPlayer::currentTime() const
qint64 MMF::AudioPlayer::totalTime() const
{
- return toMilliSeconds(m_player->Duration());
+ return m_totalTime;
}
@@ -200,7 +196,8 @@ void MMF::AudioPlayer::MapcInitComplete(TInt aError,
if (KErrNone == aError) {
maxVolumeChanged(m_player->MaxVolume());
- emit totalTimeChanged(totalTime());
+ m_totalTime = toMilliSeconds(m_player->Duration());
+ emit totalTimeChanged(m_totalTime);
updateMetaData();
changeState(StoppedState);
} else {
@@ -219,29 +216,9 @@ void MMF::AudioPlayer::MapcPlayComplete(TInt aError)
TRACE_CONTEXT(AudioPlayer::MapcPlayComplete, EAudioInternal);
TRACE_ENTRY("state %d error %d", state(), aError);
- if (KErrNone == aError) {
- changeState(StoppedState);
- // TODO: move on to m_nextSource
- } else {
- setError(tr("Playback complete"), aError);
- }
-
- /*
- if (aError == KErrNone) {
- if (m_nextSource.type() == MediaSource::Empty) {
- emit finished();
- } else {
- setSource(m_nextSource);
- m_nextSource = MediaSource();
- }
-
- changeState(StoppedState);
- }
- else {
- m_error = NormalError;
- changeState(ErrorState);
- }
- */
+ // Call base class function which handles end of playback for both
+ // audio and video clips.
+ playbackComplete(aError);
TRACE_EXIT_0();
}
diff --git a/src/3rdparty/phonon/mmf/audioplayer.h b/src/3rdparty/phonon/mmf/audioplayer.h
index 5c7cfc1..4c4bcd0 100644
--- a/src/3rdparty/phonon/mmf/audioplayer.h
+++ b/src/3rdparty/phonon/mmf/audioplayer.h
@@ -50,8 +50,7 @@ class AudioPlayer : public AbstractMediaPlayer
Q_OBJECT
public:
- AudioPlayer();
- explicit AudioPlayer(const AbstractPlayer& player);
+ AudioPlayer(MediaObject *parent = 0, const AbstractPlayer *player = 0);
virtual ~AudioPlayer();
// AbstractMediaPlayer
@@ -105,6 +104,8 @@ private:
* CMdaAudioPlayerUtility and CDrmPlayerUtility
*/
QScopedPointer<CPlayerType> m_player;
+
+ qint64 m_totalTime;
};
}
}
diff --git a/src/3rdparty/phonon/mmf/dummyplayer.cpp b/src/3rdparty/phonon/mmf/dummyplayer.cpp
index e6f3855..6970088 100644
--- a/src/3rdparty/phonon/mmf/dummyplayer.cpp
+++ b/src/3rdparty/phonon/mmf/dummyplayer.cpp
@@ -31,12 +31,7 @@ using namespace Phonon::MMF;
// Constructor / destructor
//-----------------------------------------------------------------------------
-MMF::DummyPlayer::DummyPlayer()
-{
-
-}
-
-MMF::DummyPlayer::DummyPlayer(const AbstractPlayer& player)
+MMF::DummyPlayer::DummyPlayer(const AbstractPlayer *player)
: AbstractPlayer(player)
{
@@ -97,17 +92,7 @@ qint64 MMF::DummyPlayer::totalTime() const
return 0;
}
-MediaSource MMF::DummyPlayer::source() const
-{
- return MediaSource();
-}
-
-void MMF::DummyPlayer::setFileSource(const Phonon::MediaSource &, RFile &)
-{
-
-}
-
-void MMF::DummyPlayer::setNextSource(const MediaSource &)
+void MMF::DummyPlayer::open(const Phonon::MediaSource &, RFile &)
{
}
diff --git a/src/3rdparty/phonon/mmf/dummyplayer.h b/src/3rdparty/phonon/mmf/dummyplayer.h
index c6270c9..6841b5d 100644
--- a/src/3rdparty/phonon/mmf/dummyplayer.h
+++ b/src/3rdparty/phonon/mmf/dummyplayer.h
@@ -42,8 +42,7 @@ class AudioOutput;
class DummyPlayer : public AbstractPlayer
{
public:
- DummyPlayer();
- DummyPlayer(const AbstractPlayer& player);
+ DummyPlayer(const AbstractPlayer *player = 0);
// MediaObjectInterface
virtual void play();
@@ -56,12 +55,9 @@ public:
virtual Phonon::State state() const;
virtual Phonon::ErrorType errorType() const;
virtual qint64 totalTime() const;
- virtual MediaSource source() const;
- // virtual void setSource(const MediaSource &);
- virtual void setFileSource(const Phonon::MediaSource&, RFile&);
- virtual void setNextSource(const MediaSource &source);
// AbstractPlayer
+ virtual void open(const Phonon::MediaSource&, RFile&);
virtual void doSetTickInterval(qint32 interval);
};
}
diff --git a/src/3rdparty/phonon/mmf/mediaobject.cpp b/src/3rdparty/phonon/mmf/mediaobject.cpp
index bf1f268..a9a012f 100644
--- a/src/3rdparty/phonon/mmf/mediaobject.cpp
+++ b/src/3rdparty/phonon/mmf/mediaobject.cpp
@@ -45,6 +45,7 @@ using namespace Phonon::MMF;
MMF::MediaObject::MediaObject(QObject *parent) : MMF::MediaNode::MediaNode(parent)
, m_recognizerOpened(false)
+ , m_nextSourceSet(false)
{
m_player.reset(new DummyPlayer());
@@ -211,18 +212,20 @@ qint64 MMF::MediaObject::totalTime() const
MediaSource MMF::MediaObject::source() const
{
- return m_player->source();
+ return m_source;
}
void MMF::MediaObject::setSource(const MediaSource &source)
{
- createPlayer(source);
-
- // This is a hack to work around KErrInUse from MMF client utility
- // OpenFileL calls
- m_player->setFileSource(source, m_file);
+ switchToSource(source);
+}
- emit currentSourceChanged(source);
+void MMF::MediaObject::switchToSource(const MediaSource &source)
+{
+ createPlayer(source);
+ m_source = source;
+ m_player->open(m_source, m_file);
+ emit currentSourceChanged(m_source);
}
void MMF::MediaObject::createPlayer(const MediaSource &source)
@@ -281,29 +284,16 @@ void MMF::MediaObject::createPlayer(const MediaSource &source)
switch (mediaType) {
case MediaTypeUnknown:
TRACE_0("Media type could not be determined");
- if (oldPlayer) {
- newPlayer = new DummyPlayer(*oldPlayer);
- } else {
- newPlayer = new DummyPlayer();
- }
-
+ newPlayer = new DummyPlayer(oldPlayer);
errorMessage = tr("Error opening source: media type could not be determined");
break;
case MediaTypeAudio:
- if (oldPlayer) {
- newPlayer = new AudioPlayer(*oldPlayer);
- } else {
- newPlayer = new AudioPlayer();
- }
+ newPlayer = new AudioPlayer(this, oldPlayer);
break;
case MediaTypeVideo:
- if (oldPlayer) {
- newPlayer = new VideoPlayer(*oldPlayer);
- } else {
- newPlayer = new VideoPlayer();
- }
+ newPlayer = new VideoPlayer(this, oldPlayer);
break;
}
@@ -323,6 +313,8 @@ void MMF::MediaObject::createPlayer(const MediaSource &source)
connect(m_player.data(), SIGNAL(tick(qint64)), SIGNAL(tick(qint64)));
connect(m_player.data(), SIGNAL(bufferStatus(int)), SIGNAL(bufferStatus(int)));
connect(m_player.data(), SIGNAL(metaDataChanged(QMultiMap<QString,QString>)), SIGNAL(metaDataChanged(QMultiMap<QString,QString>)));
+ connect(m_player.data(), SIGNAL(aboutToFinish()), SIGNAL(aboutToFinish()));
+ connect(m_player.data(), SIGNAL(prefinishMarkReached(qint32)), SIGNAL(tick(qint32)));
// We need to call setError() after doing the connects, otherwise the
// error won't be received.
@@ -336,7 +328,8 @@ void MMF::MediaObject::createPlayer(const MediaSource &source)
void MMF::MediaObject::setNextSource(const MediaSource &source)
{
- m_player->setNextSource(source);
+ m_nextSource = source;
+ m_nextSourceSet = true;
}
qint32 MMF::MediaObject::prefinishMark() const
@@ -385,5 +378,18 @@ bool MMF::MediaObject::activateOnMediaObject(MediaObject *)
return true;
}
+//-----------------------------------------------------------------------------
+// Playlist support
+//-----------------------------------------------------------------------------
+
+void MMF::MediaObject::switchToNextSource()
+{
+ if (m_nextSourceSet) {
+ m_nextSourceSet = false;
+ switchToSource(m_nextSource);
+ play();
+ }
+}
+
QT_END_NAMESPACE
diff --git a/src/3rdparty/phonon/mmf/mediaobject.h b/src/3rdparty/phonon/mmf/mediaobject.h
index 07baad0..7c39598 100644
--- a/src/3rdparty/phonon/mmf/mediaobject.h
+++ b/src/3rdparty/phonon/mmf/mediaobject.h
@@ -87,16 +87,16 @@ public:
public Q_SLOTS:
void volumeChanged(qreal volume);
+ void switchToNextSource();
Q_SIGNALS:
void totalTimeChanged(qint64 length);
void hasVideoChanged(bool hasVideo);
void seekableChanged(bool seekable);
void bufferStatus(int);
- // TODO: emit aboutToFinish from MediaObject
void aboutToFinish();
- // TODO: emit prefinishMarkReached from MediaObject
- void prefinishMarkReached(qint32);
+ void prefinishMarkReached(qint32 remaining);
+ // TODO: emit metaDataChanged from MediaObject
void metaDataChanged(const QMultiMap<QString, QString>& metaData);
void currentSourceChanged(const MediaSource& source);
void stateChanged(Phonon::State oldState,
@@ -105,6 +105,7 @@ Q_SIGNALS:
void tick(qint64 time);
private:
+ void switchToSource(const MediaSource &source);
void createPlayer(const MediaSource &source);
bool openRecognizer();
@@ -121,6 +122,10 @@ private:
RApaLsSession m_recognizer;
RFs m_fileServer;
+ MediaSource m_source;
+ MediaSource m_nextSource;
+ bool m_nextSourceSet;
+
// Storing the file handle here to work around KErrInUse error
// from MMF player utility OpenFileL functions
RFile m_file;
diff --git a/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp b/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp
index dab7505..877dfb3 100644
--- a/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp
+++ b/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp
@@ -44,20 +44,8 @@ using namespace Phonon::MMF;
// Constructor / destructor
//-----------------------------------------------------------------------------
-MMF::VideoPlayer::VideoPlayer()
- : m_wsSession(CCoeEnv::Static()->WsSession())
- , m_screenDevice(*CCoeEnv::Static()->ScreenDevice())
- , m_window(0)
- , m_totalTime(0)
- , m_pendingChanges(false)
- , m_dsaActive(false)
- , m_dsaWasActive(false)
-{
- construct();
-}
-
-MMF::VideoPlayer::VideoPlayer(const AbstractPlayer& player)
- : AbstractMediaPlayer(player)
+MMF::VideoPlayer::VideoPlayer(MediaObject *parent, const AbstractPlayer *player)
+ : AbstractMediaPlayer(parent, player)
, m_wsSession(CCoeEnv::Static()->WsSession())
, m_screenDevice(*CCoeEnv::Static()->ScreenDevice())
, m_window(0)
@@ -287,9 +275,9 @@ void MMF::VideoPlayer::MvpuoPlayComplete(TInt aError)
TRACE_CONTEXT(VideoPlayer::MvpuoPlayComplete, EVideoApi)
TRACE_ENTRY("state %d error %d", state(), aError);
- // TODO: handle aError
- Q_UNUSED(aError);
- changeState(StoppedState);
+ // Call base class function which handles end of playback for both
+ // audio and video clips.
+ playbackComplete(aError);
TRACE_EXIT_0();
}
diff --git a/src/3rdparty/phonon/mmf/mmf_videoplayer.h b/src/3rdparty/phonon/mmf/mmf_videoplayer.h
index 3ece19c..6200e39 100644
--- a/src/3rdparty/phonon/mmf/mmf_videoplayer.h
+++ b/src/3rdparty/phonon/mmf/mmf_videoplayer.h
@@ -44,8 +44,7 @@ class VideoPlayer : public AbstractMediaPlayer
Q_OBJECT
public:
- VideoPlayer();
- explicit VideoPlayer(const AbstractPlayer& player);
+ VideoPlayer(MediaObject *parent = 0, const AbstractPlayer *player = 0);
virtual ~VideoPlayer();
// AbstractPlayer