From fb43197f4e37c45b22630eed54ad79c03c56eb04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=92=8B=E4=B8=9C=E5=9B=BD?= <765067602@qq.com> Date: Tue, 5 Jun 2018 14:13:51 +0800 Subject: [PATCH 1/2] support yuv and mpeg support yuv and mpeg --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b0409a8..3e0db9c 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ allprojects { Step 2. Add the dependency ```java dependencies { - compile 'com.github.jiangdongguo:AndroidUSBCamera:2.1.0' + compile 'com.github.jiangdongguo:AndroidUSBCamera:2.1.1' } ``` ### 2. APIs Introduction @@ -30,6 +30,11 @@ dependencies { mUVCCameraView = (CameraViewInterface) mTextureView; mUVCCameraView.setCallback(mCallback); mCameraHelper = UVCCameraHelper.getInstance(); +// set default preview size + mCameraHelper.setDefaultPreviewSize(1280,720); +// set default frame format,defalut is UVCCameraHelper.Frame_FORMAT_MPEG +// if using mpeg can not record mp4,please try yuv +mCameraHelper.setDefaultFrameFormat(UVCCameraHelper.FRAME_FORMAT_YUYV); mCameraHelper.initUSBMonitor(this, mUVCCameraView, mDevConnectListener); ``` To be attention,mCallback is a object of interface CameraViewInterface.Callback,and it's used to be listenering surfaceView From f6dfe16101bd3c954d5a6772d7250ea63b6225a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=92=8B=E4=B8=9C=E5=9B=BD?= <765067602@qq.com> Date: Tue, 5 Jun 2018 14:16:45 +0800 Subject: [PATCH 2/2] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3e0db9c..af4f2aa 100644 --- a/README.md +++ b/README.md @@ -20,9 +20,9 @@ allprojects { ``` Step 2. Add the dependency ```java -dependencies { - compile 'com.github.jiangdongguo:AndroidUSBCamera:2.1.1' -} +dependencies { + implementation 'com.github.jiangdongguo:AndroidUSBCamera:2.1.1' +} ``` ### 2. APIs Introduction (1) In order to using it correctly,the following four steps must be achieved: