Browse Source

添加检测USB设备列表

main 1.3.4
jiangdongguo 7 years ago
parent
commit
90cc8a62e0
  1. 4
      libusbcamera/src/main/java/com/jiangdg/usbcamera/USBCameraManager.java

4
libusbcamera/src/main/java/com/jiangdg/usbcamera/USBCameraManager.java

@ -176,7 +176,7 @@ public class USBCameraManager{
public void restartUSBCamera(CameraViewInterface cameraView,final OnPreviewListener mPreviewListener){ public void restartUSBCamera(CameraViewInterface cameraView,final OnPreviewListener mPreviewListener){
if(mCtrlBlock == null || cameraView == null) if(mCtrlBlock == null || cameraView == null)
new Throwable("mCtrlBlock or cameraView is null---jiangdongguo"); throw new NullPointerException("mCtrlBlock or cameraView is null,please connected to camera");
// 创建Camera管理线程 // 创建Camera管理线程
createUVCCamera(cameraView); createUVCCamera(cameraView);
// 创建Camera // 创建Camera
@ -253,7 +253,7 @@ public class USBCameraManager{
} }
// 返回USB设备列表 // 返回USB设备列表
private List<UsbDevice> getUsbDeviceList(){ public List<UsbDevice> getUsbDeviceList(){
List<DeviceFilter> deviceFilters = DeviceFilter.getDeviceFilters(mActivity.getApplicationContext(), R.xml.device_filter); List<DeviceFilter> deviceFilters = DeviceFilter.getDeviceFilters(mActivity.getApplicationContext(), R.xml.device_filter);
if(mUSBMonitor == null || deviceFilters == null) if(mUSBMonitor == null || deviceFilters == null)
return null; return null;

Loading…
Cancel
Save