summaryrefslogtreecommitdiff
path: root/src/3rdparty
diff options
context:
space:
mode:
authorGareth Stockwell <ext-gareth.stockwell@nokia.com>2009-11-05 18:13:47 +0000
committerGareth Stockwell <ext-gareth.stockwell@nokia.com>2009-12-08 11:14:19 +0000
commit3117e3a6a9c1bf95fc30ebee4d8d11b646cb7125 (patch)
tree09e6a0dbdb98aaf87555cec558d523d57050cbd0 /src/3rdparty
parentf27198ec92dbe49a5af17af27835c74a3970e4d1 (diff)
downloadqt4-tools-3117e3a6a9c1bf95fc30ebee4d8d11b646cb7125.tar.gz
Added support for streaming playback to Phonon MMF backend
Because the MIME type of the stream cannot always be deduced from the URL, we assume that it is a video stream. This is based on the assumption that the video controllers will be capable of parsing the container formats for audio-only, as well as video clips. Note that this assumption may not hold on all devices. Note that most implementations of the MMF client APIs do not support HTTP streaming (a.k.a. progressive download). The backend has therefore only been tested with RTSP streams - see the JIRA entry for further details. Task-number: QTBUG-4660 Reviewed-by: Frans Englich
Diffstat (limited to 'src/3rdparty')
-rw-r--r--src/3rdparty/phonon/mmf/abstractmediaplayer.cpp8
-rw-r--r--src/3rdparty/phonon/mmf/abstractmediaplayer.h1
-rw-r--r--src/3rdparty/phonon/mmf/audioplayer.cpp11
-rw-r--r--src/3rdparty/phonon/mmf/audioplayer.h1
-rw-r--r--src/3rdparty/phonon/mmf/mediaobject.cpp5
-rw-r--r--src/3rdparty/phonon/mmf/mmf_videoplayer.cpp6
-rw-r--r--src/3rdparty/phonon/mmf/mmf_videoplayer.h1
-rw-r--r--src/3rdparty/phonon/mmf/utils.h3
8 files changed, 30 insertions, 6 deletions
diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
index adade9cb34..260d8e6919 100644
--- a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
+++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
@@ -243,12 +243,12 @@ void MMF::AbstractMediaPlayer::setFileSource(const MediaSource &source, RFile& f
if (url.scheme() == QLatin1String("file")) {
symbianErr = openFile(file);
if (KErrNone != symbianErr)
+ errorMessage = tr("Error opening file");
+ } else {
+ symbianErr = openUrl(url.toString());
+ if (KErrNone != symbianErr)
errorMessage = tr("Error opening URL");
}
- else {
- TRACE_0("Error opening URL: protocol not supported");
- errorMessage = tr("Error opening URL: protocol not supported");
- }
break;
}
diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.h b/src/3rdparty/phonon/mmf/abstractmediaplayer.h
index cb6e437801..0432b07c1f 100644
--- a/src/3rdparty/phonon/mmf/abstractmediaplayer.h
+++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.h
@@ -68,6 +68,7 @@ protected:
virtual void doSeek(qint64 pos) = 0;
virtual int setDeviceVolume(int mmfVolume) = 0;
virtual int openFile(RFile& file) = 0;
+ virtual int openUrl(const QString& url) = 0;
virtual void close() = 0;
virtual void changeState(PrivateState newState);
diff --git a/src/3rdparty/phonon/mmf/audioplayer.cpp b/src/3rdparty/phonon/mmf/audioplayer.cpp
index 2ce10db02d..2d618b8f09 100644
--- a/src/3rdparty/phonon/mmf/audioplayer.cpp
+++ b/src/3rdparty/phonon/mmf/audioplayer.cpp
@@ -124,6 +124,17 @@ int MMF::AudioPlayer::openFile(RFile& file)
return err;
}
+int MMF::AudioPlayer::openUrl(const QString& /*url*/)
+{
+ // Streaming playback is generally not supported by the implementation
+ // of the audio player API, so we use CVideoPlayerUtility for both
+ // audio and video streaming.
+ Utils::panic(AudioUtilityUrlNotSupported);
+
+ // Silence warning
+ return 0;
+}
+
void MMF::AudioPlayer::close()
{
m_player->Close();
diff --git a/src/3rdparty/phonon/mmf/audioplayer.h b/src/3rdparty/phonon/mmf/audioplayer.h
index bc600764a7..4674afc3df 100644
--- a/src/3rdparty/phonon/mmf/audioplayer.h
+++ b/src/3rdparty/phonon/mmf/audioplayer.h
@@ -63,6 +63,7 @@ public:
virtual void doSeek(qint64 milliseconds);
virtual int setDeviceVolume(int mmfVolume);
virtual int openFile(RFile& file);
+ virtual int openUrl(const QString& url);
virtual void close();
// MediaObjectInterface
diff --git a/src/3rdparty/phonon/mmf/mediaobject.cpp b/src/3rdparty/phonon/mmf/mediaobject.cpp
index 6158ca1248..ca3e837bc6 100644
--- a/src/3rdparty/phonon/mmf/mediaobject.cpp
+++ b/src/3rdparty/phonon/mmf/mediaobject.cpp
@@ -253,7 +253,10 @@ void MMF::MediaObject::createPlayer(const MediaSource &source)
mediaType = fileMediaType(url.toLocalFile());
}
else {
- errorMessage = QLatin1String("Network streaming not supported yet");
+ // Streaming playback is generally not supported by the implementation
+ // of the audio player API, so we use CVideoPlayerUtility for both
+ // audio and video streaming.
+ mediaType = MediaTypeVideo;
}
}
break;
diff --git a/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp b/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp
index 0a1c78fde0..62bbdef361 100644
--- a/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp
+++ b/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp
@@ -172,6 +172,12 @@ int MMF::VideoPlayer::openFile(RFile& file)
return err;
}
+int MMF::VideoPlayer::openUrl(const QString& url)
+{
+ TRAPD(err, m_player->OpenUrlL(qt_QString2TPtrC(url)));
+ return err;
+}
+
void MMF::VideoPlayer::close()
{
m_player->Close();
diff --git a/src/3rdparty/phonon/mmf/mmf_videoplayer.h b/src/3rdparty/phonon/mmf/mmf_videoplayer.h
index abb1da874d..7c429919d0 100644
--- a/src/3rdparty/phonon/mmf/mmf_videoplayer.h
+++ b/src/3rdparty/phonon/mmf/mmf_videoplayer.h
@@ -54,6 +54,7 @@ public:
virtual void doSeek(qint64 milliseconds);
virtual int setDeviceVolume(int mmfVolume);
virtual int openFile(RFile& file);
+ virtual int openUrl(const QString& url);
virtual void close();
// MediaObjectInterface
diff --git a/src/3rdparty/phonon/mmf/utils.h b/src/3rdparty/phonon/mmf/utils.h
index 60c03a55ad..56ccafc0c9 100644
--- a/src/3rdparty/phonon/mmf/utils.h
+++ b/src/3rdparty/phonon/mmf/utils.h
@@ -38,7 +38,8 @@ namespace MMF
enum PanicCode {
InvalidStatePanic = 1,
InvalidMediaTypePanic = 2,
- InvalidBackendInterfaceClass = 3
+ InvalidBackendInterfaceClass = 3,
+ AudioUtilityUrlNotSupported = 4
};
class Utils