2009年2月19日星期四

Qt-extended 中如何用Gstreamer支持流媒体

分析版本:qt-extended-4.4.2
默认情况下是不支持的。

调试步骤:
1.在网上找了一个实时电台的网址http://scfire-dtc-aa01.stream.aol.com:80/stream/1074
2. 用Linux自带的totem去播放能成功,这样确保了gstreamer的codec没有问题
3.上面的步骤成功的话,可以用qcop向qpe server发Service 请求,播放流文件,linux命令为
$ ./image/bin/qcop service send PlayMedia "openURL(QString)" "http://scfire-dtc-aa01.stream.aol.com:80/stream/1074"
4. 上面命令,Qtopia会提示出错,因为Mediaplayer代码中将 "http://xxxxx"变成了"file://http//xxxxx",所以没法播放
该代码在./src/libraries/qtopiamedia/qmediaplaylist.cpp文件中大概666行的地方
663 else
664 return content.fileName();
665 case QMediaPlaylist::Url:
666 return QUrl(QLatin1String("file://")+content.fileName());
667 case QMediaPlaylist::Artist:
668 return content.property( QContent::Artist );
669 case QMediaPlaylist::Album:
670 return content.property( QContent::Album );
因为只有真正的本地文件地址才需要前面的“file://”,而网络地址则
不用改变。

注意:步骤3是测试用的,你也可以写代码去openurl

没有评论:

发表评论