diff options
author | Frans Englich <frans.englich@nokia.com> | 2009-09-29 18:20:44 +0200 |
---|---|---|
committer | Frans Englich <frans.englich@nokia.com> | 2009-09-29 18:20:44 +0200 |
commit | 946b656791cef433b249ad0bebd2143a1b54c6f4 (patch) | |
tree | e01047632f83a82eae0d20b6fd984ecf92be7d4b | |
parent | a9ea6e24db0e25ec8c84c9a29356aac999421d07 (diff) | |
parent | 1cbe6b2126a10ad846167d147b4cfbf3c6d9b402 (diff) | |
download | qt4-tools-946b656791cef433b249ad0bebd2143a1b54c6f4.tar.gz |
Merge branch 'mmfphonon' of scm.dev.nokia.troll.no:qt/qt-s60-public into mmfphonon
Conflicts:
src/3rdparty/phonon/mmf/abstractplayer.cpp
-rw-r--r-- | src/3rdparty/phonon/mmf/TODO.txt | 5 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/abstractmediaplayer.cpp | 28 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/abstractmediaplayer.h | 1 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/abstractplayer.cpp | 12 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/abstractplayer.h | 7 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/dummyplayer.cpp | 10 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/dummyplayer.h | 3 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/mmf_videoplayer.cpp | 14 |
8 files changed, 51 insertions, 29 deletions
diff --git a/src/3rdparty/phonon/mmf/TODO.txt b/src/3rdparty/phonon/mmf/TODO.txt index 2c13632fb0..a2b1865e42 100644 --- a/src/3rdparty/phonon/mmf/TODO.txt +++ b/src/3rdparty/phonon/mmf/TODO.txt @@ -3,8 +3,13 @@ TODO list for MMF Phonon backend The following items are in rough order of priority. +* Activating full-screen video playback in qmediaplayer causes the app to crash +This may be symptomatic of more general problems with re-sizing / re-positioning video while playing. + * Implement audio effects +* Support for playing "file:" URLs + * Support for network streaming playback The main question here is how best to implement the MIME type detection for streams. The OpenUrlL functions only take a URL, whereas the corresponding OpenFileL functions have overloads for filenames and for open RFile handles. This is because files support random access whereas streams do not. A naieve approach to MIME type detection for streams is as follows; is there a more efficient approach? 1. Open network connection diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp index e8f8a67080..8fe1e4de9f 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp @@ -41,7 +41,6 @@ const int NullMaxVolume = -1; MMF::AbstractMediaPlayer::AbstractMediaPlayer() : m_playPending(false) , m_tickTimer(new QTimer(this)) - , m_volume(InitialVolume) , m_mmfMaxVolume(NullMaxVolume) { connect(m_tickTimer.data(), SIGNAL(timeout()), this, SLOT(tick())); @@ -51,7 +50,6 @@ MMF::AbstractMediaPlayer::AbstractMediaPlayer(const AbstractPlayer& player) : AbstractPlayer(player) , m_playPending(false) , m_tickTimer(new QTimer(this)) - , m_volume(InitialVolume) , m_mmfMaxVolume(NullMaxVolume) { connect(m_tickTimer.data(), SIGNAL(timeout()), this, SLOT(tick())); @@ -296,7 +294,7 @@ void MMF::AbstractMediaPlayer::volumeChanged(qreal volume) TRACE_CONTEXT(AbstractMediaPlayer::volumeChanged, EAudioInternal); TRACE_ENTRY("state %d", privateState()); - m_volume = volume; + AbstractPlayer::volumeChanged(volume); doVolumeChanged(); TRACE_EXIT_0(); @@ -373,17 +371,21 @@ void MMF::AbstractMediaPlayer::changeState(PrivateState newState) setState(newState); - // Check whether play() was called while clip was being loaded. If so, - // playback should be started now if ( - LoadingState == oldPhononState - and StoppedState == newPhononState - and m_playPending - ) { - TRACE_0("play was called while loading; starting playback now"); - m_playPending = false; - play(); - } + LoadingState == oldPhononState + and StoppedState == newPhononState + ) { + // Ensure initial volume is set on MMF API before starting playback + doVolumeChanged(); + + // Check whether play() was called while clip was being loaded. If so, + // playback should be started now + if (m_playPending) { + TRACE_0("play was called while loading; starting playback now"); + m_playPending = false; + play(); + } + } TRACE_EXIT_0(); } diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.h b/src/3rdparty/phonon/mmf/abstractmediaplayer.h index 20109efa98..698b899e96 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.h +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.h @@ -104,7 +104,6 @@ private: QScopedPointer<QTimer> m_tickTimer; - qreal m_volume; int m_mmfMaxVolume; MediaSource m_source; diff --git a/src/3rdparty/phonon/mmf/abstractplayer.cpp b/src/3rdparty/phonon/mmf/abstractplayer.cpp index 0d97272b67..62fccef27c 100644 --- a/src/3rdparty/phonon/mmf/abstractplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractplayer.cpp @@ -34,6 +34,7 @@ MMF::AbstractPlayer::AbstractPlayer() : m_videoOutput(0) , m_state(GroundState) , m_error(NoError) + , m_volume(InitialVolume) , m_tickInterval(DefaultTickInterval) , m_transitionTime(0) , m_prefinishMark(0) @@ -45,6 +46,7 @@ MMF::AbstractPlayer::AbstractPlayer(const AbstractPlayer& player) : m_videoOutput(player.m_videoOutput) , m_state(GroundState) , m_error(NoError) + , m_volume(player.m_volume) , m_tickInterval(player.tickInterval()) , m_transitionTime(player.transitionTime()) , m_prefinishMark(player.prefinishMark()) @@ -89,6 +91,16 @@ void MMF::AbstractPlayer::setTransitionTime(qint32 time) //----------------------------------------------------------------------------- +// VolumeObserver +//----------------------------------------------------------------------------- + +void MMF::AbstractPlayer::volumeChanged(qreal volume) +{ + m_volume = volume; +} + + +//----------------------------------------------------------------------------- // Video output //----------------------------------------------------------------------------- diff --git a/src/3rdparty/phonon/mmf/abstractplayer.h b/src/3rdparty/phonon/mmf/abstractplayer.h index 9f9057d848..276a47d5cc 100644 --- a/src/3rdparty/phonon/mmf/abstractplayer.h +++ b/src/3rdparty/phonon/mmf/abstractplayer.h @@ -85,6 +85,9 @@ public: virtual void setFileSource(const Phonon::MediaSource&, RFile&) = 0; virtual void setNextSource(const Phonon::MediaSource &) = 0; + // VolumeObserver + virtual void volumeChanged(qreal volume); + void setVideoOutput(VideoOutput* videoOutput); /** @@ -143,7 +146,9 @@ private: protected: // Not owned VideoOutput* m_videoOutput; - + + qreal m_volume; + private: PrivateState m_state; Phonon::ErrorType m_error; diff --git a/src/3rdparty/phonon/mmf/dummyplayer.cpp b/src/3rdparty/phonon/mmf/dummyplayer.cpp index afe4771a42..4c059c4498 100644 --- a/src/3rdparty/phonon/mmf/dummyplayer.cpp +++ b/src/3rdparty/phonon/mmf/dummyplayer.cpp @@ -115,16 +115,6 @@ void MMF::DummyPlayer::setNextSource(const MediaSource &) //----------------------------------------------------------------------------- -// VolumeObserver -//----------------------------------------------------------------------------- - -void MMF::DummyPlayer::volumeChanged(qreal) -{ - -} - - -//----------------------------------------------------------------------------- // AbstractPlayer //----------------------------------------------------------------------------- diff --git a/src/3rdparty/phonon/mmf/dummyplayer.h b/src/3rdparty/phonon/mmf/dummyplayer.h index 52399bad2a..9ff9f78af7 100644 --- a/src/3rdparty/phonon/mmf/dummyplayer.h +++ b/src/3rdparty/phonon/mmf/dummyplayer.h @@ -62,9 +62,6 @@ public: virtual void setFileSource(const Phonon::MediaSource&, RFile&); virtual void setNextSource(const MediaSource &source); - // VolumeObserver - virtual void volumeChanged(qreal volume); - // AbstractPlayer virtual void doSetTickInterval(qint32 interval); diff --git a/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp b/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp index 8a38b7606c..64e6568193 100644 --- a/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp +++ b/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp @@ -147,10 +147,22 @@ void MMF::VideoPlayer::doStop() void MMF::VideoPlayer::doSeek(qint64 ms) { TRACE_CONTEXT(VideoPlayer::doSeek, EVideoApi); + + bool wasPlaying = false; + if(state() == PlayingState) { + // The call to SetPositionL does not have any effect if playback is + // ongoing, so we pause before seeking. + doPause(); + wasPlaying = true; + } TRAPD(err, m_player->SetPositionL(TTimeIntervalMicroSeconds(ms * 1000))); - if (KErrNone != err) { + if(KErrNone == err) { + if(wasPlaying) + doPlay(); + } + else { TRACE("SetPositionL error %d", err); setError(NormalError); } |