From 4566a85e6143dba378c6987f3f0f3292d2c08b89 Mon Sep 17 00:00:00 2001 From: jiangdongguo <765067602@qq.com> Date: Sun, 12 Nov 2017 18:00:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AF=B9=E6=AF=94=E5=BA=A6?= =?UTF-8?q?=E3=80=81=E4=BA=AE=E5=BA=A6=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jiangdg/usbcamera/USBCameraManager.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/libusbcamera/src/main/java/com/jiangdg/usbcamera/USBCameraManager.java b/libusbcamera/src/main/java/com/jiangdg/usbcamera/USBCameraManager.java index 68ac30f..d2aaa0f 100644 --- a/libusbcamera/src/main/java/com/jiangdg/usbcamera/USBCameraManager.java +++ b/libusbcamera/src/main/java/com/jiangdg/usbcamera/USBCameraManager.java @@ -10,6 +10,7 @@ import com.jiangdg.libusbcamera.R; import com.serenegiant.usb.DeviceFilter; import com.serenegiant.usb.Size; import com.serenegiant.usb.USBMonitor; +import com.serenegiant.usb.UVCCamera; import com.serenegiant.usb.common.AbstractUVCCameraHandler; import com.serenegiant.usb.common.UVCCameraHandler; import com.serenegiant.usb.encoder.RecordParams; @@ -31,6 +32,8 @@ public class USBCameraManager{ private static final String TAG = "USBCameraManager"; private int previewWidth = 640; private int previewHeight = 480; + public static int MODE_BRIGHTNESS = UVCCamera.PU_BRIGHTNESS; + public static int MODE_CONTRAST = UVCCamera.PU_CONTRAST; // 使用MediaVideoBufferEncoder private static final int ENCODER_TYPE = 2; //0为YUYV,1为MJPEG @@ -172,6 +175,8 @@ public class USBCameraManager{ } public void restartUSBCamera(CameraViewInterface cameraView,final OnPreviewListener mPreviewListener){ + if(mCtrlBlock == null || cameraView == null) + new Throwable("mCtrlBlock or cameraView is null---jiangdongguo"); // 创建Camera管理线程 createUVCCamera(cameraView); // 创建Camera @@ -206,6 +211,22 @@ public class USBCameraManager{ } } + public boolean checkSupportFlag(final int flag) { + return mCameraHandler != null && mCameraHandler.checkSupportFlag(flag); + } + + public int getModelValue(final int flag) { + return mCameraHandler != null ? mCameraHandler.getValue(flag) : 0; + } + + public int setModelValue(final int flag, final int value) { + return mCameraHandler != null ? mCameraHandler.setValue(flag, value) : 0; + } + + public int resetModelValue(final int flag) { + return mCameraHandler != null ? mCameraHandler.resetValue(flag) : 0; + } + /** * 请求开启第index USB摄像头 */