summaryrefslogtreecommitdiff
path: root/src/3rdparty/phonon/mmf
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
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')
-rw-r--r--src/3rdparty/phonon/mmf/abstractmediaplayer.cpp148
-rw-r--r--src/3rdparty/phonon/mmf/abstractmediaplayer.h17
-rw-r--r--src/3rdparty/phonon/mmf/abstractvideoplayer.cpp24
-rw-r--r--src/3rdparty/phonon/mmf/abstractvideoplayer.h5
-rw-r--r--src/3rdparty/phonon/mmf/audioplayer.cpp18
-rw-r--r--src/3rdparty/phonon/mmf/audioplayer.h5
-rw-r--r--src/3rdparty/phonon/mmf/mediaobject.cpp36
-rw-r--r--src/3rdparty/phonon/mmf/mediaobject.h1
8 files changed, 211 insertions, 43 deletions
diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
index 3702560c5f..a72842328e 100644
--- a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
+++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
@@ -51,10 +51,13 @@ MMF::AbstractMediaPlayer::AbstractMediaPlayer
, m_parent(parent)
, m_pending(NothingPending)
, m_positionTimer(new QTimer(this))
+ , m_position(0)
, m_bufferStatusTimer(new QTimer(this))
, m_mmfMaxVolume(NullMaxVolume)
, m_prefinishMarkSent(false)
, m_aboutToFinishSent(false)
+ , m_download(0)
+ , m_downloadStalled(false)
{
connect(m_positionTimer.data(), SIGNAL(timeout()), this, SLOT(positionTick()));
connect(m_bufferStatusTimer.data(), SIGNAL(timeout()), this, SLOT(bufferStatusTick()));
@@ -183,6 +186,7 @@ void MMF::AbstractMediaPlayer::seek(qint64 ms)
}
doSeek(ms);
+ m_position = ms;
resetMarksIfRewound();
if(wasPlaying && state() != ErrorState) {
@@ -207,6 +211,11 @@ bool MMF::AbstractMediaPlayer::isSeekable() const
return true;
}
+qint64 MMF::AbstractMediaPlayer::currentTime() const
+{
+ return m_position;
+}
+
void MMF::AbstractMediaPlayer::doSetTickInterval(qint32 interval)
{
TRACE_CONTEXT(AbstractMediaPlayer::doSetTickInterval, EAudioApi);
@@ -247,6 +256,14 @@ void MMF::AbstractMediaPlayer::open()
symbianErr = openFile(*file);
if (KErrNone != symbianErr)
errorMessage = tr("Error opening file");
+ } else if (url.scheme() == QLatin1String("http")) {
+ Q_ASSERT(!m_download);
+ m_download = new Download(url, this);
+ connect(m_download, SIGNAL(lengthChanged(qint64)),
+ this, SLOT(downloadLengthChanged(qint64)));
+ connect(m_download, SIGNAL(stateChanged(Download::State)),
+ this, SLOT(downloadStateChanged(Download::State)));
+ m_download->start();
} else {
symbianErr = openUrl(url.toString());
if (KErrNone != symbianErr)
@@ -288,6 +305,14 @@ void MMF::AbstractMediaPlayer::open()
TRACE_EXIT_0();
}
+void MMF::AbstractMediaPlayer::close()
+{
+ doClose();
+ delete m_download;
+ m_download = 0;
+ m_position = 0;
+}
+
void MMF::AbstractMediaPlayer::volumeChanged(qreal volume)
{
TRACE_CONTEXT(AbstractMediaPlayer::volumeChanged, EAudioInternal);
@@ -374,7 +399,8 @@ void MMF::AbstractMediaPlayer::bufferingComplete()
{
stopBufferStatusTimer();
emit MMF::AbstractPlayer::bufferStatus(100);
- changeState(m_stateBeforeBuffering);
+ if (!progressiveDownloadStalled())
+ changeState(m_stateBeforeBuffering);
}
void MMF::AbstractMediaPlayer::maxVolumeChanged(int mmfMaxVolume)
@@ -385,13 +411,28 @@ void MMF::AbstractMediaPlayer::maxVolumeChanged(int mmfMaxVolume)
void MMF::AbstractMediaPlayer::loadingComplete(int error)
{
- Q_ASSERT(Phonon::LoadingState == state());
-
- if (KErrNone == error) {
- updateMetaData();
- changeState(StoppedState);
+ TRACE_CONTEXT(AbstractMediaPlayer::loadingComplete, EAudioApi);
+ TRACE_ENTRY("state %d error %d", state(), error);
+ if (progressiveDownloadStalled()) {
+ Q_ASSERT(Phonon::BufferingState == state());
+ if (KErrNone == error) {
+ bufferingComplete();
+ doSeek(m_position);
+ startPlayback();
+ m_downloadStalled = false;
+ }
} else {
- setError(tr("Loading clip failed"), error);
+ Q_ASSERT(Phonon::LoadingState == state());
+ if (KErrNone == error) {
+ updateMetaData();
+ changeState(StoppedState);
+ } else {
+ if (isProgressiveDownload() && KErrCorrupt == error) {
+ setProgressiveDownloadStalled();
+ } else {
+ setError(tr("Loading clip failed"), error);
+ }
+ }
}
}
@@ -415,8 +456,12 @@ void MMF::AbstractMediaPlayer::playbackComplete(int error)
QMetaObject::invokeMethod(m_parent, "switchToNextSource", Qt::QueuedConnection);
}
else {
- setError(tr("Playback complete"), error);
- emit finished();
+ if (isProgressiveDownload() && KErrCorrupt == error) {
+ setProgressiveDownloadStalled();
+ } else {
+ setError(tr("Playback complete"), error);
+ emit finished();
+ }
}
}
@@ -425,15 +470,28 @@ qint64 MMF::AbstractMediaPlayer::toMilliSeconds(const TTimeIntervalMicroSeconds
return in.Int64() / 1000;
}
+bool MMF::AbstractMediaPlayer::isProgressiveDownload() const
+{
+ return (0 != m_download);
+}
+
+bool MMF::AbstractMediaPlayer::progressiveDownloadStalled() const
+{
+ return m_downloadStalled;
+}
+
//-----------------------------------------------------------------------------
// Slots
//-----------------------------------------------------------------------------
void MMF::AbstractMediaPlayer::positionTick()
{
- const qint64 current = currentTime();
- emitMarksIfReached(current);
- emit MMF::AbstractPlayer::tick(current);
+ const qint64 pos = getCurrentTime();
+ if (pos > m_position) {
+ m_position = pos;
+ emitMarksIfReached(m_position);
+ emit MMF::AbstractPlayer::tick(m_position);
+ }
}
void MMF::AbstractMediaPlayer::emitMarksIfReached(qint64 current)
@@ -458,7 +516,7 @@ void MMF::AbstractMediaPlayer::emitMarksIfReached(qint64 current)
void MMF::AbstractMediaPlayer::resetMarksIfRewound()
{
- const qint64 current = currentTime();
+ const qint64 current = getCurrentTime();
const qint64 total = totalTime();
const qint64 remaining = total - current;
@@ -487,9 +545,71 @@ void MMF::AbstractMediaPlayer::startPlayback()
changeState(PlayingState);
}
+void MMF::AbstractMediaPlayer::setProgressiveDownloadStalled()
+{
+ TRACE_CONTEXT(AbstractMediaPlayer::setProgressiveDownloadStalled, EAudioApi);
+ TRACE_ENTRY("state %d", state());
+ Q_ASSERT(isProgressiveDownload());
+ m_downloadStalled = true;
+ doClose();
+ bufferingStarted();
+ // Video player loses window handle when closed - need to reapply it here
+ videoOutputChanged();
+#ifdef QT_PHONON_MMF_DOWNLOAD_DUMMY
+ m_download->resume();
+#endif
+}
+
void MMF::AbstractMediaPlayer::bufferStatusTick()
{
- emit MMF::AbstractPlayer::bufferStatus(bufferStatus());
+ // During progressive download, there is no way to detect the buffering status.
+ // Phonon does not support a "buffering; amount unknown" signal, therefore we
+ // return a buffering status of zero.
+ const int status = progressiveDownloadStalled() ? 0 : bufferStatus();
+ emit MMF::AbstractPlayer::bufferStatus(status);
+}
+
+void MMF::AbstractMediaPlayer::downloadLengthChanged(qint64 length)
+{
+ TRACE_CONTEXT(AbstractMediaPlayer::downloadLengthChanged, EAudioApi);
+ TRACE_ENTRY("length %Ld", length);
+ Q_UNUSED(length)
+ if (m_downloadStalled) {
+ bufferingComplete();
+ int err = m_parent->openFileHandle(m_download->targetFileName());
+ if (KErrNone == err)
+ err = openFile(*m_parent->file());
+ if (KErrNone != err)
+ setError(tr("Error opening file"));
+ }
+}
+
+void MMF::AbstractMediaPlayer::downloadStateChanged(Download::State state)
+{
+ TRACE_CONTEXT(AbstractMediaPlayer::downloadStateChanged, EAudioApi);
+ TRACE_ENTRY("state %d", state);
+ switch (state) {
+ case Download::Idle:
+ case Download::Initializing:
+ break;
+ case Download::Downloading:
+ {
+ int err = m_parent->openFileHandle(m_download->targetFileName());
+ if (KErrNone == err)
+ err = openFile(*m_parent->file());
+ else if (KErrCorrupt == err)
+ // Insufficient data downloaded - enter Buffering state
+ setProgressiveDownloadStalled();
+ if (KErrNone != err)
+ setError(tr("Error opening file"));
+ }
+ break;
+ case Download::Complete:
+ break;
+ case Download::Error:
+ setError(tr("Download error"));
+ break;
+ }
}
Phonon::State MMF::AbstractMediaPlayer::phononState(PrivateState state) const
diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.h b/src/3rdparty/phonon/mmf/abstractmediaplayer.h
index e795ecbf91..99fc101be4 100644
--- a/src/3rdparty/phonon/mmf/abstractmediaplayer.h
+++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.h
@@ -23,6 +23,7 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#include <QScopedPointer>
#include <e32std.h>
#include "abstractplayer.h"
+#include "download.h"
class RFile;
@@ -48,6 +49,7 @@ protected:
public:
virtual void open();
+ virtual void close();
// MediaObjectInterface
virtual void play();
@@ -55,6 +57,7 @@ public:
virtual void stop();
virtual void seek(qint64 milliseconds);
virtual bool isSeekable() const;
+ virtual qint64 currentTime() const;
virtual void volumeChanged(qreal volume);
protected:
@@ -68,12 +71,15 @@ protected:
virtual void doStop() = 0;
virtual void doSeek(qint64 pos) = 0;
virtual int setDeviceVolume(int mmfVolume) = 0;
+ virtual int openFile(const QString &fileName) = 0;
virtual int openFile(RFile& file) = 0;
virtual int openUrl(const QString& url) = 0;
virtual int openDescriptor(const TDesC8 &des) = 0;
virtual int bufferStatus() const = 0;
+ virtual void doClose() = 0;
void updateMetaData();
+ virtual qint64 getCurrentTime() const = 0;
virtual int numberOfMetaDataEntries() const = 0;
virtual QPair<QString, QString> metaDataEntry(int index) const = 0;
@@ -86,6 +92,9 @@ protected:
static qint64 toMilliSeconds(const TTimeIntervalMicroSeconds &);
+ bool isProgressiveDownload() const;
+ bool progressiveDownloadStalled() const;
+
private:
void startPositionTimer();
void stopPositionTimer();
@@ -96,6 +105,7 @@ private:
void emitMarksIfReached(qint64 position);
void resetMarksIfRewound();
void startPlayback();
+ void setProgressiveDownloadStalled();
enum Pending {
NothingPending,
@@ -108,6 +118,8 @@ private:
private Q_SLOTS:
void positionTick();
void bufferStatusTick();
+ void downloadLengthChanged(qint64);
+ void downloadStateChanged(Download::State);
private:
MediaObject *const m_parent;
@@ -115,6 +127,7 @@ private:
Pending m_pending;
QScopedPointer<QTimer> m_positionTimer;
+ qint64 m_position;
QScopedPointer<QTimer> m_bufferStatusTimer;
PrivateState m_stateBeforeBuffering;
@@ -127,6 +140,10 @@ private:
// Used for playback of resource files
TPtrC8 m_buffer;
+ // Used for progressive download
+ Download *m_download;
+ bool m_downloadStalled;
+
QMultiMap<QString, QString> m_metaData;
};
diff --git a/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp b/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp
index fb20bea018..1ab5baefcc 100644
--- a/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp
+++ b/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp
@@ -16,6 +16,7 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <QDir>
#include <QUrl>
#include <QTimer>
#include <QWidget>
@@ -132,6 +133,13 @@ int MMF::AbstractVideoPlayer::setDeviceVolume(int mmfVolume)
return err;
}
+int MMF::AbstractVideoPlayer::openFile(const QString &fileName)
+{
+ const QHBufC nativeFileName(QDir::toNativeSeparators(fileName));
+ TRAPD(err, m_player->OpenFileL(*nativeFileName));
+ return err;
+}
+
int MMF::AbstractVideoPlayer::openFile(RFile &file)
{
TRAPD(err, m_player->OpenFileL(file));
@@ -157,7 +165,7 @@ int MMF::AbstractVideoPlayer::bufferStatus() const
return result;
}
-void MMF::AbstractVideoPlayer::close()
+void MMF::AbstractVideoPlayer::doClose()
{
m_player->Close();
}
@@ -167,9 +175,9 @@ bool MMF::AbstractVideoPlayer::hasVideo() const
return true;
}
-qint64 MMF::AbstractVideoPlayer::currentTime() const
+qint64 MMF::AbstractVideoPlayer::getCurrentTime() const
{
- TRACE_CONTEXT(AbstractVideoPlayer::currentTime, EVideoApi);
+ TRACE_CONTEXT(AbstractVideoPlayer::getCurrentTime, EVideoApi);
TTimeIntervalMicroSeconds us;
TRAPD(err, us = m_player->PositionL())
@@ -246,7 +254,9 @@ void MMF::AbstractVideoPlayer::MvpuoOpenComplete(TInt aError)
TRACE_CONTEXT(AbstractVideoPlayer::MvpuoOpenComplete, EVideoApi);
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)
m_player->Prepare();
@@ -261,7 +271,9 @@ void MMF::AbstractVideoPlayer::MvpuoPrepareComplete(TInt aError)
TRACE_CONTEXT(AbstractVideoPlayer::MvpuoPrepareComplete, EVideoApi);
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));
TRAPD(err, getVideoClipParametersL(aError));
@@ -470,7 +482,7 @@ void MMF::AbstractVideoPlayer::updateScaleFactors(const QSize &windowSize, bool
void MMF::AbstractVideoPlayer::parametersChanged(VideoParameters parameters)
{
- if (state() == LoadingState)
+ if (state() == LoadingState || progressiveDownloadStalled() && BufferingState == state())
m_pendingChanges |= parameters;
else
handleParametersChanged(parameters);
diff --git a/src/3rdparty/phonon/mmf/abstractvideoplayer.h b/src/3rdparty/phonon/mmf/abstractvideoplayer.h
index 3ff3c75d7d..3bc5c7c27a 100644
--- a/src/3rdparty/phonon/mmf/abstractvideoplayer.h
+++ b/src/3rdparty/phonon/mmf/abstractvideoplayer.h
@@ -64,21 +64,22 @@ public:
virtual void doStop();
virtual void doSeek(qint64 milliseconds);
virtual int setDeviceVolume(int mmfVolume);
+ virtual int openFile(const QString &fileName);
virtual int openFile(RFile &file);
virtual int openUrl(const QString &url);
virtual int openDescriptor(const TDesC8 &des);
virtual int bufferStatus() const;
- virtual void close();
+ virtual void doClose();
// MediaObjectInterface
virtual bool hasVideo() const;
- virtual qint64 currentTime() const;
virtual qint64 totalTime() const;
// AbstractPlayer
virtual void videoOutputChanged();
// AbstractMediaPlayer
+ virtual qint64 getCurrentTime() const;
virtual int numberOfMetaDataEntries() const;
virtual QPair<QString, QString> metaDataEntry(int index) const;
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());
diff --git a/src/3rdparty/phonon/mmf/audioplayer.h b/src/3rdparty/phonon/mmf/audioplayer.h
index e43caddbf2..cf4f6d5ccd 100644
--- a/src/3rdparty/phonon/mmf/audioplayer.h
+++ b/src/3rdparty/phonon/mmf/audioplayer.h
@@ -65,18 +65,19 @@ typedef CMdaAudioPlayerUtility NativePlayer;
virtual void doStop();
virtual void doSeek(qint64 milliseconds);
virtual int setDeviceVolume(int mmfVolume);
+ virtual int openFile(const QString &fileName);
virtual int openFile(RFile& file);
virtual int openUrl(const QString& url);
virtual int openDescriptor(const TDesC8 &des);
virtual int bufferStatus() const;
- virtual void close();
+ virtual void doClose();
// MediaObjectInterface
virtual bool hasVideo() const;
- virtual qint64 currentTime() const;
virtual qint64 totalTime() const;
// AbstractMediaPlayer
+ virtual qint64 getCurrentTime() const;
virtual int numberOfMetaDataEntries() const;
virtual QPair<QString, QString> metaDataEntry(int index) const;
diff --git a/src/3rdparty/phonon/mmf/mediaobject.cpp b/src/3rdparty/phonon/mmf/mediaobject.cpp
index 98326b8d40..2c7a7efe83 100644
--- a/src/3rdparty/phonon/mmf/mediaobject.cpp
+++ b/src/3rdparty/phonon/mmf/mediaobject.cpp
@@ -61,6 +61,9 @@ MMF::MediaObject::MediaObject(QObject *parent) : MMF::MediaNode::MediaNode(paren
TRACE_CONTEXT(MediaObject::MediaObject, EAudioApi);
TRACE_ENTRY_0();
+ const int err = m_fileServer.Connect();
+ QT_TRAP_THROWING(User::LeaveIfError(err));
+
Q_UNUSED(parent);
TRACE_EXIT_0();
@@ -99,12 +102,6 @@ bool MMF::MediaObject::openRecognizer()
return false;
}
- err = m_fileServer.Connect();
- if (KErrNone != err) {
- TRACE("RFs::Connect error %d", err);
- return false;
- }
-
// This must be called in order to be able to share file handles with
// the recognizer server (see fileMediaType function).
err = m_fileServer.ShareProtected();
@@ -127,13 +124,8 @@ MMF::MediaType MMF::MediaObject::fileMediaType
MediaType result = MediaTypeUnknown;
if (openRecognizer()) {
-
- const QHBufC fileNameSymbian(QDir::toNativeSeparators(fileName));
-
- Q_ASSERT(!m_file);
- m_file = new RFile;
- TInt err = m_file->Open(m_fileServer, *fileNameSymbian, EFileRead | EFileShareReadersOnly);
-
+ TInt err = openFileHandle(fileName);
+ const QHBufC nativeFileName(QDir::toNativeSeparators(fileName));
if (KErrNone == err) {
TDataRecognitionResult recognizerResult;
err = m_recognizer.RecognizeData(*m_file, recognizerResult);
@@ -141,16 +133,30 @@ MMF::MediaType MMF::MediaObject::fileMediaType
const TPtrC mimeType = recognizerResult.iDataType.Des();
result = Utils::mimeTypeToMediaType(mimeType);
} else {
- TRACE("RApaLsSession::RecognizeData filename %S error %d", fileNameSymbian.data(), err);
+ TRACE("RApaLsSession::RecognizeData filename %S error %d", nativeFileName.data(), err);
}
} else {
- TRACE("RFile::Open filename %S error %d", fileNameSymbian.data(), err);
+ TRACE("RFile::Open filename %S error %d", nativeFileName.data(), err);
}
}
return result;
}
+int MMF::MediaObject::openFileHandle(const QString &fileName)
+{
+ TRACE_CONTEXT(MediaObject::openFileHandle, EAudioInternal);
+ const QHBufC nativeFileName(QDir::toNativeSeparators(fileName));
+ TRACE_ENTRY("filename %S", nativeFileName.data());
+ if (m_file)
+ m_file->Close();
+ delete m_file;
+ m_file = 0;
+ m_file = new RFile;
+ TInt err = m_file->Open(m_fileServer, *nativeFileName, EFileRead | EFileShareReadersOrWriters);
+ return err;
+}
+
MMF::MediaType MMF::MediaObject::bufferMediaType(const uchar *data, qint64 size)
{
TRACE_CONTEXT(MediaObject::bufferMediaType, EAudioInternal);
diff --git a/src/3rdparty/phonon/mmf/mediaobject.h b/src/3rdparty/phonon/mmf/mediaobject.h
index 5399e27216..5d785fb108 100644
--- a/src/3rdparty/phonon/mmf/mediaobject.h
+++ b/src/3rdparty/phonon/mmf/mediaobject.h
@@ -89,6 +89,7 @@ public:
void setVideoOutput(AbstractVideoOutput* videoOutput);
+ int openFileHandle(const QString &fileName);
RFile* file() const;
QResource* resource() const;