diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-08-03 03:15:37 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-08-03 03:15:37 (GMT) |
commit | 3b043a6d5e839b2d90a2b4193e7768a23901308d (patch) | |
tree | cee2dd9827ab1357898f0ccc9fefb0c4abc9c554 /src/3rdparty/phonon/mmf/abstractmediaplayer.cpp | |
parent | 105704d626f293f0c8fc08ef6978c401402148c6 (diff) | |
parent | 1c7c6e2326b2f89bdf564cebe89ff6f95c3f17d7 (diff) | |
download | Qt-3b043a6d5e839b2d90a2b4193e7768a23901308d.zip Qt-3b043a6d5e839b2d90a2b4193e7768a23901308d.tar.gz Qt-3b043a6d5e839b2d90a2b4193e7768a23901308d.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public:
Fixed build break on Symbian versions earlier than S^3
Enabled tst_mediaobject::testPlayFromResource on Symbian
Added support to Phonon MMF backend for playback of Qt resource files
Updated tst_mediaobject resource playback test cases
Added support to Phonon MMF backend for playback of Qt resource files
Diffstat (limited to 'src/3rdparty/phonon/mmf/abstractmediaplayer.cpp')
-rw-r--r-- | src/3rdparty/phonon/mmf/abstractmediaplayer.cpp | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp index be2a568..3702560 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp @@ -16,6 +16,7 @@ along with this library. If not, see <http://www.gnu.org/licenses/>. */ +#include <QResource> #include <QUrl> #include "abstractmediaplayer.h" @@ -216,9 +217,10 @@ void MMF::AbstractMediaPlayer::doSetTickInterval(qint32 interval) TRACE_EXIT_0(); } -void MMF::AbstractMediaPlayer::open(const MediaSource &source, RFile& file) +void MMF::AbstractMediaPlayer::open() { - TRACE_CONTEXT(AbstractMediaPlayer::setFileSource, EAudioApi); + TRACE_CONTEXT(AbstractMediaPlayer::open, EAudioApi); + const MediaSource source = m_parent->source(); TRACE_ENTRY("state %d source.type %d", privateState(), source.type()); close(); @@ -229,7 +231,9 @@ void MMF::AbstractMediaPlayer::open(const MediaSource &source, RFile& file) switch (source.type()) { case MediaSource::LocalFile: { - symbianErr = openFile(file); + RFile *const file = m_parent->file(); + Q_ASSERT(file); + symbianErr = openFile(*file); if (KErrNone != symbianErr) errorMessage = tr("Error opening file"); break; @@ -237,9 +241,10 @@ void MMF::AbstractMediaPlayer::open(const MediaSource &source, RFile& file) case MediaSource::Url: { const QUrl url(source.url()); - if (url.scheme() == QLatin1String("file")) { - symbianErr = openFile(file); + RFile *const file = m_parent->file(); + Q_ASSERT(file); + symbianErr = openFile(*file); if (KErrNone != symbianErr) errorMessage = tr("Error opening file"); } else { @@ -251,6 +256,19 @@ void MMF::AbstractMediaPlayer::open(const MediaSource &source, RFile& file) break; } + case MediaSource::Stream: { + QResource *const resource = m_parent->resource(); + if (resource) { + m_buffer.Set(resource->data(), resource->size()); + symbianErr = openDescriptor(m_buffer); + if (KErrNone != symbianErr) + errorMessage = tr("Error opening resource"); + } else { + errorMessage = tr("Error opening source: resource not opened"); + } + break; + } + // Other source types are handled in MediaObject::createPlayer // Protection against adding new media types and forgetting to update this switch |