From 183e388fa026d6cd5ff95c1a131a76ea3da9e6e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=92=8B=E4=B8=9C=E5=9B=BD?= <765067602@qq.com> Date: Mon, 23 Oct 2017 17:51:42 +0800 Subject: [PATCH] Update README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 支持多分辨率切换 --- README.md | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 530640c..29a72cc 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Step 2. Add the dependency ``` dependencies { - compile 'com.github.jiangdongguo:AndroidUSBCamera:v1.1.0' + compile 'com.github.jiangdongguo:AndroidUSBCamera:v1.2.0' } ``` @@ -53,7 +53,7 @@ mUSBManager.init(this, mUVCCameraView, new USBCameraManager.OnMyDevConnectListen } } } - + // 拔出USB设备 @Override public void onDettachDev(UsbDevice device) { @@ -67,16 +67,18 @@ mUSBManager.init(this, mUVCCameraView, new USBCameraManager.OnMyDevConnectListen // 连接USB设备成功 @Override - public void onConnectDev(UsbDevice device) { - + public void onConnectDev(UsbDevice device,boolean isConnected) { + if(! isConnected) { + showShortMsg("连接失败,请检查分辨率参数是否正确"); + } } // 与USB设备断开连接 @Override public void onDisConnectDev(UsbDevice device) { - + } - }); + }; ``` ### 3. 注册USB设备广播事件监听器,开始Camera预览 @@ -135,7 +137,23 @@ mUSBManager.startRecording(videoPath, new AbstractUVCCameraHandler.OnEncodeResul mUSBManager.stopRecording(); ``` -### 7. 释放引擎资源 +### 7. 切换分辨率 + update Resulotion   + +``` +mUSBManager.updateResolution(this, mUVCCameraView, 320, 240, new USBCameraManager.OnPreviewListener() { + @Override + public void onPreviewResult(boolean isSuccess) { + if(! isSuccess) { + showShortMsg("预览失败,不支持该分辨率"); + }else { + showShortMsg("以切换到分辨率为320x240"); + } + } + }); +``` + +### 8. 释放引擎资源 release resource ```