本文整理汇总了Java中javax.media.CaptureDeviceManager类的典型用法代码示例。如果您正苦于以下问题:Java CaptureDeviceManager类的具体用法?Java CaptureDeviceManager怎么用?Java CaptureDeviceManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CaptureDeviceManager类属于javax.media包,在下文中一共展示了CaptureDeviceManager类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: JmfCaptureDeviceList
import javax.media.CaptureDeviceManager; //导入依赖的package包/类
public JmfCaptureDeviceList() throws NyARRuntimeException
{
this._devices = (Vector<CaptureDeviceInfo>)(CaptureDeviceManager.getDeviceList(null).clone());
// ビデオソースのデバイスだけ残す
try {
for (int i = 0; i < this._devices.size();) {
CaptureDeviceInfo cdi =this._devices.elementAt(i);
// VideoFormatもってるかな?
if (!isCaptureDevice(cdi)) {
this._devices.remove(i);
continue;
}
i++;
}
} catch (Exception e) {
throw new NyARRuntimeException(e);
}
return;
}
示例2: listDevices
import javax.media.CaptureDeviceManager; //导入依赖的package包/类
void listDevices() {
Vector deviceInfos = CaptureDeviceManager.getDeviceList(null);
if (deviceInfos.isEmpty()) {
System.out.println("No capture devices found.");
} else {
for (Object o : deviceInfos) {
CaptureDeviceInfo info = (CaptureDeviceInfo) o;
System.out.println(info.getName() + " :");
for (Format format : info.getFormats()) {
System.out.println(String.format("\t%s", format.toString()));
}
}
}
}
示例3: printDeviceList
import javax.media.CaptureDeviceManager; //导入依赖的package包/类
public static void printDeviceList() {
System.out.println("List of capturing devices: ");
Vector devices = CaptureDeviceManager.getDeviceList(null);
Enumeration list = devices.elements();
while (list.hasMoreElements()) {
CaptureDeviceInfo deviceInfo =(CaptureDeviceInfo) list.nextElement();
String name = deviceInfo.getName();
Format[] fmts = deviceInfo.getFormats();
System.out.println("NAME: " +name);
for (int i = 0; i < fmts.length; i++) {
System.out.println("\t"+fmts[i]);
}
}
}
示例4: logAudioDevices
import javax.media.CaptureDeviceManager; //导入依赖的package包/类
/**
* Logs the audio devices
*/
public void logAudioDevices() {
@SuppressWarnings("unchecked")
final Vector<CaptureDeviceInfo> vectorDevices = CaptureDeviceManager.getDeviceList(null);
for (CaptureDeviceInfo infoCaptureDevice : vectorDevices) {
System.err.println(convertSysString(infoCaptureDevice.getName()));
for (Format format : infoCaptureDevice.getFormats()) {
System.err.println(" " + format);
}
}
}