读书人

在指定的窗口播发Mplayer

发布时间: 2012-09-06 10:37:01 作者: rapoo

在指定的窗口播放Mplayer

在指定的窗口播放Mplayer
MPlayer是默认全屏播放,但在GUI中一般都是指定区域或者控制来播放.这样显得美观,MPlayer支持在指定的X窗口播放的功能.用-wid参数告诉窗口ID即可.
mplayer test.mpg -wid 0x00029 #0x0029是X ID

在对于正在运行图形界面窗口,可以用Linux 命令xwininfo来取到其ID,方法是运行这个程序后.屏幕鼠标变成+,将其拖到指定窗口即可看到其结果。

xwininfo 是X-Windows工具,用来查看已经打开窗口的X-Windows信息。
这是在我机器上运行结果

[root@sowhy hxy]# xwininfo

xwininfo: Please select the window about which you
would like information by clicking the
mouse in that window.

xwininfo: Window id: 0x320001f

Absolute upper-left X: 177
Absolute upper-left Y: 49
Relative upper-left X: 5
Relative upper-left Y: 24
Width: 784
Height: 469
Depth: 24
Visual Class: TrueColor
Border width: 0
Class: InputOutput
Colormap: 0x20 (installed)
Bit Gravity State: NorthWestGravity
Window Gravity State: NorthWestGravity
Backing Store State: NotUseful
Save Under State: no
Map State: IsViewable
Override Redirect State: no
Corners: +177+49 --161+49 --161-82 +177-82
-geometry 59x17+172+25


读书人网 >编程

热点推荐