diff options
author | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2009-12-01 17:55:30 (GMT) |
---|---|---|
committer | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2009-12-08 11:15:28 (GMT) |
commit | bed33ac62d87073120d56ff75a3d2356c99c64ea (patch) | |
tree | 5a949097061061981afe3d92a32855591ebcd8bd /src/3rdparty/phonon/mmf/mmf_videoplayer.cpp | |
parent | 3117e3a6a9c1bf95fc30ebee4d8d11b646cb7125 (diff) | |
download | Qt-bed33ac62d87073120d56ff75a3d2356c99c64ea.zip Qt-bed33ac62d87073120d56ff75a3d2356c99c64ea.tar.gz Qt-bed33ac62d87073120d56ff75a3d2356c99c64ea.tar.bz2 |
Implemented buffer status notifications in Phonon MMF backend
When clips are buffering (either at the start of playback, or
during playback, when buffer levels drop due to e.g. CPU, file system
or network load), the backend receives notification from the MMF.
While buffering is ongoing, the backend periodically queries the
filling status and emits a signal.
Task-number: QTBUG-4660
Reviewed-by: Frans Englich
Diffstat (limited to 'src/3rdparty/phonon/mmf/mmf_videoplayer.cpp')
-rw-r--r-- | src/3rdparty/phonon/mmf/mmf_videoplayer.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp b/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp index 62bbdef..4a70d58 100644 --- a/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp +++ b/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp @@ -93,6 +93,8 @@ void MMF::VideoPlayer::construct() // CVideoPlayerUtility::NewL starts DSA m_dsaActive = true; + m_player->RegisterForVideoLoadingNotification(*this); + TRACE_EXIT_0(); } @@ -178,6 +180,13 @@ int MMF::VideoPlayer::openUrl(const QString& url) return err; } +int MMF::VideoPlayer::bufferStatus() const +{ + int result = 0; + TRAP_IGNORE(m_player->GetVideoLoadingProgressL(result)); + return result; +} + void MMF::VideoPlayer::close() { m_player->Close(); @@ -292,7 +301,8 @@ void MMF::VideoPlayer::MvpuoPlayComplete(TInt aError) TRACE_CONTEXT(VideoPlayer::MvpuoPlayComplete, EVideoApi) TRACE_ENTRY("state %d error %d", state(), aError); - Q_UNUSED(aError); // suppress warnings in release builds + // TODO: handle aError + Q_UNUSED(aError); changeState(StoppedState); TRACE_EXIT_0(); @@ -310,6 +320,21 @@ void MMF::VideoPlayer::MvpuoEvent(const TMMFEvent &aEvent) //----------------------------------------------------------------------------- +// MVideoLoadingObserver callbacks +//----------------------------------------------------------------------------- + +void MMF::VideoPlayer::MvloLoadingStarted() +{ + bufferingStarted(); +} + +void MMF::VideoPlayer::MvloLoadingComplete() +{ + bufferingComplete(); +} + + +//----------------------------------------------------------------------------- // Video window updates //----------------------------------------------------------------------------- |