diff options
-rw-r--r-- | demos/embedded/fluidlauncher/config_s60/config.xml | 2 | ||||
-rw-r--r-- | demos/embedded/fluidlauncher/fluidlauncher.pro | 1 | ||||
-rw-r--r-- | demos/embedded/fluidlauncher/screenshots/mediaplayer.png | bin | 7217 -> 98092 bytes | |||
-rw-r--r-- | demos/mediaplayer/main.cpp | 36 | ||||
-rw-r--r-- | demos/mediaplayer/mediaplayer.cpp | 25 | ||||
-rw-r--r-- | demos/mediaplayer/mediaplayer.h | 4 | ||||
-rw-r--r-- | demos/mediaplayer/mediaplayer.pro | 8 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/TODO.txt | 29 |
8 files changed, 60 insertions, 45 deletions
diff --git a/demos/embedded/fluidlauncher/config_s60/config.xml b/demos/embedded/fluidlauncher/config_s60/config.xml index 68c3f2f..fefa3dd 100644 --- a/demos/embedded/fluidlauncher/config_s60/config.xml +++ b/demos/embedded/fluidlauncher/config_s60/config.xml @@ -20,7 +20,7 @@ <example filename="weatherinfo" name="Weather Info" image="screenshots/weatherinfo.png"/> <example filename="flickable" name="Kinetic Scrolling" image="screenshots/flickable.png"/> <example filename="digiflip" name="Flipping Clock" image="screenshots/digiflip.png"/> - <example filename="qmediaplayer" name="Media Player" image="screenshots/mediaplayer.png"/> + <example filename="qmediaplayer" name="Media Player" image="screenshots/mediaplayer.png" args="-small-screen"/> </demos> <slideshow timeout="60000" interval="10000"> <imagedir dir="slides"/> diff --git a/demos/embedded/fluidlauncher/fluidlauncher.pro b/demos/embedded/fluidlauncher/fluidlauncher.pro index 5d3fc18..d677e9d 100644 --- a/demos/embedded/fluidlauncher/fluidlauncher.pro +++ b/demos/embedded/fluidlauncher/fluidlauncher.pro @@ -193,6 +193,7 @@ symbian { viewerimages.sources = $$PWD/../embeddedsvgviewer/shapes.svg viewerimages.path = /data/images/qt/demos/embeddedsvgviewer + # demos/mediaplayer make also use of these files. desktopservices_music.sources = \ $$PWD/../desktopservices/data/*.mp3 \ $$PWD/../desktopservices/data/*.wav diff --git a/demos/embedded/fluidlauncher/screenshots/mediaplayer.png b/demos/embedded/fluidlauncher/screenshots/mediaplayer.png Binary files differindex 1304a19..2d8a637 100644 --- a/demos/embedded/fluidlauncher/screenshots/mediaplayer.png +++ b/demos/embedded/fluidlauncher/screenshots/mediaplayer.png diff --git a/demos/mediaplayer/main.cpp b/demos/mediaplayer/main.cpp index fd1431d..66aa445 100644 --- a/demos/mediaplayer/main.cpp +++ b/demos/mediaplayer/main.cpp @@ -50,9 +50,39 @@ int main (int argc, char *argv[]) app.setOrganizationName("Qt"); app.setQuitOnLastWindowClosed(true); - QString fileString = app.arguments().value(1); - MediaPlayer player(fileString); - player.show(); + bool hasSmallScreen = +#ifdef Q_OS_SYMBIAN + /* On Symbian, we always want fullscreen. One reason is that it's not + * possible to launch any demos from the fluidlauncher due to a + * limitation in the emulator. */ + true +#else + false +#endif + ; + + QString fileString; + const QStringList args(app.arguments()); + /* We have a minor problem here, we accept two arguments, both are + * optional: + * - A file name + * - the option "-small-screen", so let's try to cope with that. + */ + for (int i = 0; i < args.count(); ++i) { + const QString &at = args.at(i); + + if (at == QLatin1String("-small-screen")) + hasSmallScreen = true; + else if (i > 0) // We don't want the app name. + fileString = at; + } + + MediaPlayer player(fileString, hasSmallScreen); + + if (hasSmallScreen) + player.showMaximized(); + else + player.show(); return app.exec(); } diff --git a/demos/mediaplayer/mediaplayer.cpp b/demos/mediaplayer/mediaplayer.cpp index 8dd0609..baac236 100644 --- a/demos/mediaplayer/mediaplayer.cpp +++ b/demos/mediaplayer/mediaplayer.cpp @@ -147,10 +147,12 @@ private: }; -MediaPlayer::MediaPlayer(const QString &filePath) : +MediaPlayer::MediaPlayer(const QString &filePath, + const bool hasSmallScreen) : playButton(0), nextEffect(0), settingsDialog(0), ui(0), m_AudioOutput(Phonon::VideoCategory), - m_videoWidget(new MediaVideoWidget(this)) + m_videoWidget(new MediaVideoWidget(this)), + m_hasSmallScreen(hasSmallScreen) { setWindowTitle(tr("Media Player")); setContextMenuPolicy(Qt::CustomContextMenu); @@ -341,13 +343,15 @@ void MediaPlayer::stateChanged(Phonon::State newstate, Phonon::State oldstate) info->setVisible(!m_MediaObject.hasVideo()); QRect videoHintRect = QRect(QPoint(0, 0), m_videoWindow.sizeHint()); QRect newVideoRect = QApplication::desktop()->screenGeometry().intersected(videoHintRect); - if (m_MediaObject.hasVideo()){ - // Flush event que so that sizeHint takes the - // recently shown/hidden m_videoWindow into account: - qApp->processEvents(); - resize(sizeHint()); - } else - resize(minimumSize()); + if (!m_hasSmallScreen) { + if (m_MediaObject.hasVideo()) { + // Flush event que so that sizeHint takes the + // recently shown/hidden m_videoWindow into account: + qApp->processEvents(); + resize(sizeHint()); + } else + resize(minimumSize()); + } } switch (newstate) { @@ -648,7 +652,8 @@ void MediaPlayer::setFile(const QString &fileName) void MediaPlayer::openFile() { - QStringList fileNames = QFileDialog::getOpenFileNames(this); + QStringList fileNames = QFileDialog::getOpenFileNames(this, QString(), + QDesktopServices::storageLocation(QDesktopServices::MusicLocation)); m_MediaObject.clearQueue(); if (fileNames.size() > 0) { QString fileName = fileNames[0]; diff --git a/demos/mediaplayer/mediaplayer.h b/demos/mediaplayer/mediaplayer.h index 38ace26..40ffa40 100644 --- a/demos/mediaplayer/mediaplayer.h +++ b/demos/mediaplayer/mediaplayer.h @@ -72,7 +72,8 @@ class MediaPlayer : { Q_OBJECT public: - MediaPlayer(const QString &); + MediaPlayer(const QString &, + const bool hasSmallScreen); void dragEnterEvent(QDragEnterEvent *e); void dragMoveEvent(QDragMoveEvent *e); @@ -132,6 +133,7 @@ private: Phonon::AudioOutput m_AudioOutput; Phonon::VideoWidget *m_videoWidget; Phonon::Path m_audioOutputPath; + const bool m_hasSmallScreen; }; #endif //MEDIAPLAYER_H diff --git a/demos/mediaplayer/mediaplayer.pro b/demos/mediaplayer/mediaplayer.pro index d8d8301..84293f2 100644 --- a/demos/mediaplayer/mediaplayer.pro +++ b/demos/mediaplayer/mediaplayer.pro @@ -16,7 +16,7 @@ RESOURCES += mediaplayer.qrc SOURCES += main.cpp mediaplayer.cpp HEADERS += mediaplayer.h -target.path = $$[QT_INSTALL_DEMOS]/mediaplayer +target.path = $$[QT_INSTALL_DEMOS]/qmediaplayer sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.html *.doc images sources.path = $$[QT_INSTALL_DEMOS]/mediaplayer INSTALLS += target sources @@ -27,5 +27,11 @@ DEPLOYMENT_PLUGIN += phonon_ds9 phonon_waveout symbian { TARGET.UID3 = 0xA000C613 + + addFiles.sources = ../../tests/auto/mediaobject/media/sax.mp3 + + addFiles.path = /data/sounds/ + DEPLOYMENT += addFiles + include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) } diff --git a/src/3rdparty/phonon/mmf/TODO.txt b/src/3rdparty/phonon/mmf/TODO.txt deleted file mode 100644 index a2b1865..0000000 --- a/src/3rdparty/phonon/mmf/TODO.txt +++ /dev/null @@ -1,29 +0,0 @@ -TODO list for MMF Phonon backend --------------------------------- - -The following items are in rough order of priority. - -* Activating full-screen video playback in qmediaplayer causes the app to crash -This may be symptomatic of more general problems with re-sizing / re-positioning video while playing. - -* Implement audio effects - -* Support for playing "file:" URLs - -* Support for network streaming playback -The main question here is how best to implement the MIME type detection for streams. The OpenUrlL functions only take a URL, whereas the corresponding OpenFileL functions have overloads for filenames and for open RFile handles. This is because files support random access whereas streams do not. A naieve approach to MIME type detection for streams is as follows; is there a more efficient approach? - 1. Open network connection - 2. Download header - 3. Detect MIME type and create AbstractMediaPlayer instance - 4. Close network connection - 5. Pass URL to MMF client utility, which will then re-open the stream -An alternative approach is to always create a VideoPlayer when passed an RTSP URL, and then modify VideoPlayer::hasVideo to check CVideoPlayerUtility::VideoMimeTypeL before returning. This way, we would always use CVideoPlayerUtility for RTSP streaming, whether the source is audio or video. Well-behaved client apps, however, should check MediaObject::hasVideo before creating the UI - and therefore the VideoWidget would only be connected if the source is actually a video stream. - -* Performance analysis -Compare video frame rate obtained using default S60 media player and Qt demo apps - -* Implement MMF::Backend::disconnectNodes -This should probably be left for now, particularly until audio effects have been implemented. This is because the node connection mechanism may need to be refactored slightly once we start building up longer graphs (e.g. MediaObject -> Effect -> Effect -> AudioOutput). - -* Metadata is not implemented. - |