62,621
社区成员
发帖
与我相关
我的任务
分享Vector device = CaptureDeviceManager.getDeviceList(new VideoFormat(VideoFormat.YUV));// new
// VideoFormat(VideoFormat.RGB)
if (device != null && device.size() > 0) {
int deviceCount = device.size();
videoDevice = new ArrayList<CaptureDeviceInfo>();
audioDevice = new ArrayList<CaptureDeviceInfo>();
Format[] format;
for (int i = 0; i < deviceCount; i++) {
cpInof = (CaptureDeviceInfo) device.elementAt(i);
format = cpInof.getFormats();
for (int j = 0; j < format.length; j++) {
if (format[j] instanceof VideoFormat) {
videoDevice.add(cpInof);
break;
} else if (format[j] instanceof AudioFormat) {
audioDevice.add(cpInof);
break;
}
}
}
}