summaryrefslogtreecommitdiff
path: root/src/3rdparty/phonon/mmf/audioplayer.cpp
diff options
context:
space:
mode:
authorGareth Stockwell <ext-gareth.stockwell@nokia.com>2010-09-28 11:05:41 +0100
committerGareth Stockwell <ext-gareth.stockwell@nokia.com>2010-10-01 11:33:25 +0100
commit865a9214fbb858cd5089aa3073ad2cff305017ea (patch)
tree1894bb5b5266fb9ad863017bedf838b78c2c14b7 /src/3rdparty/phonon/mmf/audioplayer.cpp
parent1f14df23bf0e593c31efc846c13f11afb0fad6b8 (diff)
downloadqt4-tools-865a9214fbb858cd5089aa3073ad2cff305017ea.tar.gz
Progressive download in Phonon MMF backend: integrated with player
This commit integrates the Download class with the media playback classes in the backend, to implement Progressive Download. Note that this PDL implementation has one drawback: when video playback is paused due to shortage of data (i.e. due to the download being temporarily stalled), the display goes black. This is because, when the end of the currently-downloaded data is reached, the playback session is closed. When more data becomes available, the clip is re-opened, a seek is done to reach the previous playback position, and playback is re-started. Closing the playback session closes the video stack's connection to the display, thereby causing the video widget to go black while more data is buffered. This is a consequence of the level in the native video stack at which the Phonon integration is done: managing a network stall without requiring the playback session to be closed would require integration below the MMF client API, specifically at the MMF controller level. Task-number: QTBUG-10769 Reviewed-by: Derick Hawcroft
Diffstat (limited to 'src/3rdparty/phonon/mmf/audioplayer.cpp')
-rw-r--r--src/3rdparty/phonon/mmf/audioplayer.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/3rdparty/phonon/mmf/audioplayer.cpp b/src/3rdparty/phonon/mmf/audioplayer.cpp
index 7c8b9bd04f..dc5c800df1 100644
--- a/src/3rdparty/phonon/mmf/audioplayer.cpp
+++ b/src/3rdparty/phonon/mmf/audioplayer.cpp
@@ -16,6 +16,7 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <QDir>
#include <QUrl>
#include "audioplayer.h"
@@ -109,6 +110,13 @@ int MMF::AudioPlayer::setDeviceVolume(int mmfVolume)
#endif
}
+int MMF::AudioPlayer::openFile(const QString &fileName)
+{
+ const QHBufC nativeFileName(QDir::toNativeSeparators(fileName));
+ TRAPD(err, m_player->OpenFileL(*nativeFileName));
+ return err;
+}
+
int MMF::AudioPlayer::openFile(RFile& file)
{
TRAPD(err, m_player->OpenFileL(file));
@@ -150,7 +158,7 @@ int MMF::AudioPlayer::bufferStatus() const
return result;
}
-void MMF::AudioPlayer::close()
+void MMF::AudioPlayer::doClose()
{
m_player->Close();
}
@@ -160,9 +168,9 @@ bool MMF::AudioPlayer::hasVideo() const
return false;
}
-qint64 MMF::AudioPlayer::currentTime() const
+qint64 MMF::AudioPlayer::getCurrentTime() const
{
- TRACE_CONTEXT(AudioPlayer::currentTime, EAudioApi);
+ TRACE_CONTEXT(AudioPlayer::getCurrentTime, EAudioApi);
TTimeIntervalMicroSeconds us;
const TInt err = m_player->GetPosition(us);
@@ -203,7 +211,9 @@ void MMF::AudioPlayer::MapcInitComplete(TInt aError,
TRACE_CONTEXT(AudioPlayer::MapcInitComplete, EAudioInternal);
TRACE_ENTRY("state %d error %d", state(), aError);
- __ASSERT_ALWAYS(LoadingState == state(), Utils::panic(InvalidStatePanic));
+ __ASSERT_ALWAYS(LoadingState == state() ||
+ progressiveDownloadStalled() && BufferingState == state(),
+ Utils::panic(InvalidStatePanic));
if (KErrNone == aError) {
maxVolumeChanged(m_player->MaxVolume());