本文整理汇总了Java中javax.media.CaptureDeviceInfo.getFormats方法的典型用法代码示例。如果您正苦于以下问题:Java CaptureDeviceInfo.getFormats方法的具体用法?Java CaptureDeviceInfo.getFormats怎么用?Java CaptureDeviceInfo.getFormats使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.media.CaptureDeviceInfo
的用法示例。
在下文中一共展示了CaptureDeviceInfo.getFormats方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: listDevices
import javax.media.CaptureDeviceInfo; //导入方法依赖的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()));
}
}
}
}
示例2: isCaptureDevice
import javax.media.CaptureDeviceInfo; //导入方法依赖的package包/类
/**
* i_cdiがビデオキャプチャデバイスかを調べる。ようなことをする。
*
* @param i_cdi
* @return
*/
private static boolean isCaptureDevice(CaptureDeviceInfo i_cdi)
{
Format[] fms = i_cdi.getFormats();
for (int i = 0; i < fms.length; i++) {
Format f = fms[i];
if (f instanceof VideoFormat) {
return true;
}
}
return false;
}
示例3: printDeviceList
import javax.media.CaptureDeviceInfo; //导入方法依赖的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.CaptureDeviceInfo; //导入方法依赖的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);
}
}
}