我上网找了相关的代码,关键部分是这样的。public static Player player = null;
private CaptureDeviceInfo di = null;
private MediaLocator ml = null;//文档中提供的驱动写法,为何这么写我也不知:)String str1 = "vfw:Logitech USB Video Camera:0";
String str2 = "vfw:Microsoft WDM Image Capture (Win32):0";
di = CaptureDeviceManager.getDevice(str2);
ml = di.getLocator();
try
{
player = Manager.createRealizedPlayer(ml);
player.start();
Component comp;
if ((comp = player.getVisualComponent()) != null)
{
add(comp, BorderLayout.NORTH);
}
}
catch (Exception e)
{
e.printStackTrace();
}但是使用的时候经常是过几秒钟(不一定是几秒)就自己卡了。有些机器就不是。
不同测试机器我安装的运行时环境和jmf都是一样的。希望有高手帮我解答解答,感激不尽!
private CaptureDeviceInfo di = null;
private MediaLocator ml = null;//文档中提供的驱动写法,为何这么写我也不知:)String str1 = "vfw:Logitech USB Video Camera:0";
String str2 = "vfw:Microsoft WDM Image Capture (Win32):0";
di = CaptureDeviceManager.getDevice(str2);
ml = di.getLocator();
try
{
player = Manager.createRealizedPlayer(ml);
player.start();
Component comp;
if ((comp = player.getVisualComponent()) != null)
{
add(comp, BorderLayout.NORTH);
}
}
catch (Exception e)
{
e.printStackTrace();
}但是使用的时候经常是过几秒钟(不一定是几秒)就自己卡了。有些机器就不是。
不同测试机器我安装的运行时环境和jmf都是一样的。希望有高手帮我解答解答,感激不尽!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货