Phonon是QT提供的一套多媒体框架,提供多媒体播放图形界面和回放的功能,QT也是通过phonon来实现跨平台的多媒体播放。应用程序不需要关心多媒体播放到底是由什么实现的(如gstreamer、xine、mplayer),其应用框架实质上可以分为三部分:phonon、phonon_backend和播放后端,后端才是真正读取媒体、解码和播放的部分。QT中自带的phonon_backend是phonon_gstreamer,本文为了实现mplayer为播放后端,phonon_backend用的是phonon_mplayer。
移植到ARM下步骤:
1 Qt基本库移植,默认选项,./configure的时候不要把-phonon加上……。否则编译通不过。。
2 Qt phonon库移植
进入源代码的phonon目录,如"/usr/src/qt-everywhere-opensource-src-4.6.0/src/phonon",实 际代码并不在里面,从phonon.pro文件可知源代码在“/src/3rdparty/phonon/phonon”,但并不影响编译。在终端输入 “make;make install”即可,如果安装时出错,也可手动将lib、include下相关文件拷贝到安装目录。
3. 后端插件安装 :
(1)下载phonon-mplayer。
进入QT下的plugins/phonon_backend/
cp phonon_backend/libphonon_mplayer.so /opt/PDA/plugins/phonon_backend/
4 错误
QP_LOGGER ../mplayer/Backend.cpp 180 Phonon-MPlayer objectDescriptionIndexes
QP_LOGGER ../mplayer/Backend.cpp 212 Phonon-MPlayer objectDescriptionProperties
QP_LOGGER ../mplayer/Backend.cpp 180 Phonon-MPlayer objectDescriptionIndexes
QP_LOGGER ../mplayer/Backend.cpp 212 Phonon-MPlayer objectDescriptionProperties
QP_LOGGER ../mplayer/MediaController.cpp 356 Phonon-MPlayer subtitleAdded
QP_LOGGER ../mplayer/MediaController.cpp 396 Phonon-MPlayer subtitleChanged New current subtitle: "None"
QP_LOGGER ../mplayer/Backend.cpp 256 Phonon-MPlayer startConnectionChange
QP_LOGGER ../mplayer/Backend.cpp 258 Phonon-MPlayer startConnectionChange Node: Phonon::MPlayer::MediaObject
QP_LOGGER ../mplayer/Backend.cpp 258 Phonon-MPlayer startConnectionChange Node: Phonon::MPlayer::AudioOutput
QP_LOGGER ../mplayer/Backend.cpp 268 Phonon-MPlayer connectNodes Phonon::MPlayer::MediaObject Phonon::MPlayer::AudioOutput
QP_LOGGER ../mplayer/Backend.cpp 329 Phonon-MPlayer endConnectionChange
QP_LOGGER ../mplayer/Backend.cpp 331 Phonon-MPlayer endConnectionChange Node: Phonon::MPlayer::MediaObject
QP_LOGGER ../mplayer/Backend.cpp 331 Phonon-MPlayer endConnectionChange Node: Phonon::MPlayer::AudioOutput
QP_LOGGER ../mplayer/MediaObject.cpp 344 Phonon-MPlayer setSource Source: "/home/dlw/Music/mxshf.mp3"
QP_LOGGER ../mplayer/MediaObject.cpp 184 Phonon-MPlayer loadMedia "/home/dlw/Music/mxshf.mp3"
QP_LOGGER ../mplayer/libmplayer/MPlayerConfig.cpp 40 LibMPlayer MPlayerConfig Config file: "/home/lvhuat/.config/phonon-mplayer/phonon-mplayer.conf"
QP_LOGGER ../mplayer/libmplayer/MyProcess.cpp 69 LibMPlayer start Process started: "mplayer" "quarkplayerfakename"
QP_LOGGER ../mplayer/libmplayer/MyProcess.cpp 155 LibMPlayer error QProcess::FailedToStart
QP_LOGGER ../mplayer/libmplayer/MPlayerLoader.cpp 108 LibMPlayer startMPlayerVersion MPlayer process couldn't start
QP_LOGGER ../mplayer/MediaObject.cpp 105 Phonon-MPlayer play
QP_LOGGER ../mplayer/MediaController.cpp 356 Phonon-MPlayer subtitleAdded
QP_LOGGER ../mplayer/MediaController.cpp 396 Phonon-MPlayer subtitleChanged New current subtitle: "None"
QP_LOGGER ../mplayer/libmplayer/MPlayerLoader.cpp 143 LibMPlayer readMediaSettings
QP_LOGGER ../mplayer/libmplayer/MPlayerLoader.cpp 238 LibMPlayer readMediaSettings Could not use MPlayer volume command line, your MPlayer version is too old: -1
QP_LOGGER ../mplayer/libmplayer/MPlayerLoader.cpp 304 LibMPlayer readMediaSettings Could not disable MPlayer key bindings (shortcuts), your MPlayer version is too old: -1
QP_LOGGER ../mplayer/libmplayer/MyProcess.cpp 63 LibMPlayer start
QP_LOGGER ../mplayer/libmplayer/MyProcess.cpp 64 LibMPlayer start
QP_LOGGER ../mplayer/libmplayer/MyProcess.cpp 65 LibMPlayer start
QP_LOGGER ../mplayer/libmplayer/MyProcess.cpp 69 LibMPlayer start Process started: "mplayer" "-noquiet -slave -identify -msglevel demux=6 -framedrop -nokeepaspect -zoom -colorkey 0x020202 -monitorpixelaspect 1 -contrast 0 -brightness 0 -hue 0 -saturation 0 -prefer-ipv4 -ass -embeddedfonts -nomouseinput -sub-fuzziness 1 -include ~/.mplayer/config /home/dlw/Music/mxshf.mp3"
QP_LOGGER ../mplayer/libmplayer/MyProcess.cpp 155 LibMPlayer error QProcess::FailedToStart
QP_LOGGER ../mplayer/MediaObject.cpp 492 Phonon-MPlayer stateChangedInternal ErrorState