欢迎来到天天文库
浏览记录
ID:11101680
大小:37.00 KB
页数:6页
时间:2018-07-10
《mplayer做界面并实现基本的暂停播放功能》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、Mplayer做界面并实现基本的暂停播放功能实现原理先来考虑考虑如何为mplayer编写前端界面的问题。有两种思路,一种是把mplayer解剖,直接修改他里面的代码,这样我们做得界面就能够和mplayer一体了(当然也能够通过linkmplayer用到的任何的库和.o文档,把他无缝的集成在程式里面);第二种方法就是mplayer所谓的slave模式。mplayer'/home/linux/1.mp3'-quiet-slave现在来探讨一下slave模式:所谓的slave模式,就是mplayer在运行过
2、程中能够接收用户的输入命令行,具体支持哪些命令行,能够通过mplayer-inputcmdlist这条命令来得到,在Mplayer源码的slave.txt中也有对这些命令有详细的讲解。Slave模式下工作的Mplayer可以和系统的标准输入、输出进行信息交互。我们可以用linuxC编程来完成对slave模式工作的Mplayer进行控制和信息获取。下面是Mplayer-slave模式的官方文档:Mplayer/doc/tech/slave.txt---------------(部分原文)********
3、*************************************************************LAVEMODEPROTOCOL-------------------The-slaveoptionswitchesonslavemode,inwhichMPlayerworksasabackendforotherprograms.Insteadofinterceptingkeyboardevents,MPlayerwillreadcommandsseparatedbyanewli
4、ne()fromstdin.Totryslavemodeoutbyhand,runmplayer-slave-quietandtypeslavecommandsintotheconsolewindow.Mostslavemodecommandsareequivalenttocommandlineoptions,thoughnotnecessarilyunderthesamename.Detaileddescriptionscanbefoundinthemanpage.Allcomma
5、ndscanbeprefixedwithoneof"pausing","pausing_keep",or"pausing_toggle"."pausing"tellsMPlayertopauseassoonaspossibleafterprocessingthecommand."pausing_keep"tellsMPlayertodosoonlyifitwasalreadyinpausedmode."pausing_toggle"tellsMPlayertodosoonlyifitwasnotalr
6、eadyinpausedmode.Pleasenotethat"assoonaspossible"canbebeforethecommandisfullyexecuted.Availablecommands('mplayer-inputcmdlist'willprintalist):alt_src_step(ASXplaylistonly)Whenmorethanonesourceisavailableitselectsthenext/previousone.audio_delay7、lue>[abs]Set/adjusttheaudiodelay.If[abs]isnotgivenoriszero,adjustthedelaybyseconds.If[abs]isnonzero,setthedelaytoseconds.[brightness8、contrast9、gamma10、hue11、saturation][abs]Set/adjustvideoparameters.If[abs]isnotgivenoriszero,modifiespara12、meterby.If[abs]isnon-zero,parameterissetto.isintherange[-100,100].change_rectangleChangethepositionoftherectanglefilterrectangle.Mustbeoneofthefollowing:0=width1=height2=xposition3=yposition
7、lue>[abs]Set/adjusttheaudiodelay.If[abs]isnotgivenoriszero,adjustthedelaybyseconds.If[abs]isnonzero,setthedelaytoseconds.[brightness
8、contrast
9、gamma
10、hue
11、saturation][abs]Set/adjustvideoparameters.If[abs]isnotgivenoriszero,modifiespara
12、meterby.If[abs]isnon-zero,parameterissetto.isintherange[-100,100].change_rectangleChangethepositionoftherectanglefilterrectangle.Mustbeoneofthefollowing:0=width1=height2=xposition3=yposition
此文档下载收益归作者所有