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 1/9] 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 ``` From 2e7f4b241bd6488327e29d6caa8cdce264e51f07 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 22:16:02 +0800 Subject: [PATCH 2/9] Update README.md --- README.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 29a72cc..b9d9e36 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,16 @@ # AndroidUSBCamera开源项目 -### AndroidUSBCamera基于[saki4510t/UVCCamera](https://github.com/saki4510t/UVCCamera)开发,该项目对USB Camera(UVC设备)的使用和视频数据采集进行了高度封装,能够帮助开发者通过几个简单的API实现USB Camera设备的检测、连接、预览和视频数据采集。主要功能包括:USB Camera实时预览;本地录制mp4格式视频;png格式图片抓拍;实时获取编码后的音视频数据流。 -> AndroidUSBCamera is developed based on the saki4510t/UVCCamera, the project of USB Camera (UVC equipment) and the use of video data acquisition are highly packaged, and it can help developers using USB Camera devices to connect, preview and video data collection by a few simple API. The main functions include: USB Camera real-time preview; local recording MP4 format video; PNG format photo capture; real-time access to encoded audio and video data stream. +### AndroidUSBCamera基于[saki4510t/UVCCamera](https://github.com/saki4510t/UVCCamera)开发,该项目对USB Camera(UVC设备)的使用和视频数据采集进行了高度封装,能够帮助开发者通过几个简单的API实现USB Camera设备的检测、连接、预览和音视频数据采集。主要功能包括: +  ### (1) 支持USB Camera设备检测,画面实时预览; +  ### (2) 支持本地录制mp4格式视频,支持实时获取音视频数据流; +  ### (3) 支持jpg格式图片抓拍;   +  ### (4) 支持多种分辨率切换; +  ### (5) 支持屏蔽声音; +> AndroidUSBCamera is developed based on the saki4510t/UVCCamera, the project of USB Camera (UVC equipment) and the use of video data acquisition are highly packaged, and it can help developers using USB Camera devices to connect, preview and video data collection by a few simple API. The main functions include: +   (1)supports detecting USB Camera equipment, and previewing; + (2)supports recording MP4 format video, and acquiring real-time audio and video data; + (3)supports capturing JPG format image; + (4)supports switching resolution; + (5)support shielding sound; ## 如何使用AndroidUSBCamera项目 ### 1.添加依赖到本地工程 From 31e6e3bede0026156827232dbc71f0050c06f1b9 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 22:16:43 +0800 Subject: [PATCH 3/9] Update README.md --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index b9d9e36..6fd2b83 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,16 @@ # AndroidUSBCamera开源项目 ### AndroidUSBCamera基于[saki4510t/UVCCamera](https://github.com/saki4510t/UVCCamera)开发,该项目对USB Camera(UVC设备)的使用和视频数据采集进行了高度封装,能够帮助开发者通过几个简单的API实现USB Camera设备的检测、连接、预览和音视频数据采集。主要功能包括: -  ### (1) 支持USB Camera设备检测,画面实时预览; -  ### (2) 支持本地录制mp4格式视频,支持实时获取音视频数据流; -  ### (3) 支持jpg格式图片抓拍;   -  ### (4) 支持多种分辨率切换; -  ### (5) 支持屏蔽声音; +  ### (1) 支持USB Camera设备检测,画面实时预览; +  ### (2) 支持本地录制mp4格式视频,支持实时获取音视频数据流; +  ### (3) 支持jpg格式图片抓拍;   +  ### (4) 支持多种分辨率切换; +  ### (5) 支持屏蔽声音; > AndroidUSBCamera is developed based on the saki4510t/UVCCamera, the project of USB Camera (UVC equipment) and the use of video data acquisition are highly packaged, and it can help developers using USB Camera devices to connect, preview and video data collection by a few simple API. The main functions include: -   (1)supports detecting USB Camera equipment, and previewing; - (2)supports recording MP4 format video, and acquiring real-time audio and video data; - (3)supports capturing JPG format image; - (4)supports switching resolution; - (5)support shielding sound; +   (1)supports detecting USB Camera equipment, and previewing; + (2)supports recording MP4 format video, and acquiring real-time audio and video data; + (3)supports capturing JPG format image; + (4)supports switching resolution; + (5)support shielding sound; ## 如何使用AndroidUSBCamera项目 ### 1.添加依赖到本地工程 From e50bd96955656a1411a5f5c6c07202bdfc4fa25f 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 22:17:38 +0800 Subject: [PATCH 4/9] Update README.md --- README.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 6fd2b83..9e64a55 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,13 @@ # AndroidUSBCamera开源项目 -### AndroidUSBCamera基于[saki4510t/UVCCamera](https://github.com/saki4510t/UVCCamera)开发,该项目对USB Camera(UVC设备)的使用和视频数据采集进行了高度封装,能够帮助开发者通过几个简单的API实现USB Camera设备的检测、连接、预览和音视频数据采集。主要功能包括: -  ### (1) 支持USB Camera设备检测,画面实时预览; -  ### (2) 支持本地录制mp4格式视频,支持实时获取音视频数据流; -  ### (3) 支持jpg格式图片抓拍;   -  ### (4) 支持多种分辨率切换; -  ### (5) 支持屏蔽声音; -> AndroidUSBCamera is developed based on the saki4510t/UVCCamera, the project of USB Camera (UVC equipment) and the use of video data acquisition are highly packaged, and it can help developers using USB Camera devices to connect, preview and video data collection by a few simple API. The main functions include: +### AndroidUSBCamera基于[saki4510t/UVCCamera](https://github.com/saki4510t/UVCCamera)开发,该项目对USB Camera(UVC设备)的使用和视频数据采集进行了高度封装,能够帮助开发者通过几个简单的API实现USB Camera设备的检测、连接、预览和音视频数据采集。主要功能包括: + +  ### (1)支持USB Camera设备检测,画面实时预览; +  ### (2)支持本地录制mp4格式视频,支持实时获取音视频数据流; +  ### (3)支持jpg格式图片抓拍;   +  ### (4)支持多种分辨率切换; +  ### (5)支持屏蔽声音; + +> AndroidUSBCamera is developed based on the saki4510t/UVCCamera, the project of USB Camera (UVC equipment) and the use of video data acquisition are highly packaged, and it can help developers using USB Camera devices to connect, preview and video data collection by a few simple API. The main functions include:   (1)supports detecting USB Camera equipment, and previewing; (2)supports recording MP4 format video, and acquiring real-time audio and video data; (3)supports capturing JPG format image; From 3162573c1f89bc044a9d9d2d47682b52a7490622 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 22:18:38 +0800 Subject: [PATCH 5/9] Update README.md --- README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 9e64a55..c5bf9a7 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,10 @@ # AndroidUSBCamera开源项目 ### AndroidUSBCamera基于[saki4510t/UVCCamera](https://github.com/saki4510t/UVCCamera)开发,该项目对USB Camera(UVC设备)的使用和视频数据采集进行了高度封装,能够帮助开发者通过几个简单的API实现USB Camera设备的检测、连接、预览和音视频数据采集。主要功能包括: - -  ### (1)支持USB Camera设备检测,画面实时预览; -  ### (2)支持本地录制mp4格式视频,支持实时获取音视频数据流; -  ### (3)支持jpg格式图片抓拍;   -  ### (4)支持多种分辨率切换; -  ### (5)支持屏蔽声音; +  ### (1)支持USB Camera设备检测,画面实时预览; +  ### (2)支持本地录制mp4格式视频,支持实时获取音视频数据流; +  ### (3)支持jpg格式图片抓拍; +  ### (4)支持多种分辨率切换; +  ### (5)支持屏蔽声音; > AndroidUSBCamera is developed based on the saki4510t/UVCCamera, the project of USB Camera (UVC equipment) and the use of video data acquisition are highly packaged, and it can help developers using USB Camera devices to connect, preview and video data collection by a few simple API. The main functions include:   (1)supports detecting USB Camera equipment, and previewing; From 49a8493380775d6425120b5df46e232634afa89a 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 22:19:06 +0800 Subject: [PATCH 6/9] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c5bf9a7..bcb2dc5 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # AndroidUSBCamera开源项目 ### AndroidUSBCamera基于[saki4510t/UVCCamera](https://github.com/saki4510t/UVCCamera)开发,该项目对USB Camera(UVC设备)的使用和视频数据采集进行了高度封装,能够帮助开发者通过几个简单的API实现USB Camera设备的检测、连接、预览和音视频数据采集。主要功能包括: -  ### (1)支持USB Camera设备检测,画面实时预览; -  ### (2)支持本地录制mp4格式视频,支持实时获取音视频数据流; -  ### (3)支持jpg格式图片抓拍; -  ### (4)支持多种分辨率切换; -  ### (5)支持屏蔽声音; +### (1)支持USB Camera设备检测,画面实时预览; +### (2)支持本地录制mp4格式视频,支持实时获取音视频数据流; +### (3)支持jpg格式图片抓拍; +### (4)支持多种分辨率切换; +### (5)支持屏蔽声音; > AndroidUSBCamera is developed based on the saki4510t/UVCCamera, the project of USB Camera (UVC equipment) and the use of video data acquisition are highly packaged, and it can help developers using USB Camera devices to connect, preview and video data collection by a few simple API. The main functions include:   (1)supports detecting USB Camera equipment, and previewing; From 89e094962a762c6e466b6293cb9a253b52f20c4c 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 22:19:28 +0800 Subject: [PATCH 7/9] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index bcb2dc5..1608c6c 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # AndroidUSBCamera开源项目 ### AndroidUSBCamera基于[saki4510t/UVCCamera](https://github.com/saki4510t/UVCCamera)开发,该项目对USB Camera(UVC设备)的使用和视频数据采集进行了高度封装,能够帮助开发者通过几个简单的API实现USB Camera设备的检测、连接、预览和音视频数据采集。主要功能包括: -### (1)支持USB Camera设备检测,画面实时预览; -### (2)支持本地录制mp4格式视频,支持实时获取音视频数据流; -### (3)支持jpg格式图片抓拍; -### (4)支持多种分辨率切换; -### (5)支持屏蔽声音; + ### (1)支持USB Camera设备检测,画面实时预览; + ### (2)支持本地录制mp4格式视频,支持实时获取音视频数据流; + ### (3)支持jpg格式图片抓拍; + ### (4)支持多种分辨率切换; + ### (5)支持屏蔽声音; > AndroidUSBCamera is developed based on the saki4510t/UVCCamera, the project of USB Camera (UVC equipment) and the use of video data acquisition are highly packaged, and it can help developers using USB Camera devices to connect, preview and video data collection by a few simple API. The main functions include:   (1)supports detecting USB Camera equipment, and previewing; From 88ce70889e7d8258b742e262fa655d0b536bd879 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 22:34:19 +0800 Subject: [PATCH 8/9] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1608c6c..2330a47 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # AndroidUSBCamera开源项目 ### AndroidUSBCamera基于[saki4510t/UVCCamera](https://github.com/saki4510t/UVCCamera)开发,该项目对USB Camera(UVC设备)的使用和视频数据采集进行了高度封装,能够帮助开发者通过几个简单的API实现USB Camera设备的检测、连接、预览和音视频数据采集。主要功能包括: - ### (1)支持USB Camera设备检测,画面实时预览; - ### (2)支持本地录制mp4格式视频,支持实时获取音视频数据流; - ### (3)支持jpg格式图片抓拍; - ### (4)支持多种分辨率切换; - ### (5)支持屏蔽声音; +(1)支持USB Camera设备检测,画面实时预览; +(2)支持本地录制mp4格式视频,支持实时获取音视频数据流; +(3)支持jpg格式图片抓拍; +(4)支持多种分辨率切换; +(5)支持屏蔽声音; > AndroidUSBCamera is developed based on the saki4510t/UVCCamera, the project of USB Camera (UVC equipment) and the use of video data acquisition are highly packaged, and it can help developers using USB Camera devices to connect, preview and video data collection by a few simple API. The main functions include:   (1)supports detecting USB Camera equipment, and previewing; From 7997af039b9692d511c54307a7897288192b8107 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, 24 Oct 2017 09:15:01 +0800 Subject: [PATCH 9/9] Update README.md --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2330a47..ab89e4a 100644 --- a/README.md +++ b/README.md @@ -173,7 +173,13 @@ if(mUSBManager != null){ mUSBManager.release(); } ``` - +### 9. 添加权限 +  add permissions   + +``` + + +``` ### USBCameraManager API (Other) ``` (1) void requestPermission(int index):请求授予开启USB摄像头权限;