Android调用外置USB摄像头

环境

某Android系统的POS机

AndroidSDK: 22 Android: 5.1.1

USB摄像头

intelRealSense

AliFacePayCamera

解决思路

根据网上的教程,先验证设备是否支持UVC。

将Android设备与开发机相连,并启用USB调试

adb shell

shell@xxxx:/ $ ls -l /dev/v*
crw-rw-rw- system   system    81,   9 2017-12-20 14:18 v4l-subdev0
crw-rw-rw- system   system    81,  10 2017-12-20 14:18 v4l-subdev1
crw-rw-rw- system   system    81,  19 2017-12-20 14:18 v4l-subdev10
crw-rw-rw- system   system    81,  20 2017-12-20 14:18 v4l-subdev11
crw-rw-rw- system   system    81,  11 2017-12-20 14:18 v4l-subdev2
crw-rw-rw- system   system    81,  12 2017-12-20 14:18 v4l-subdev3
crw-rw-rw- system   system    81,  13 2017-12-20 14:18 v4l-subdev4
crw-rw-rw- system   system    81,  14 2017-12-20 14:18 v4l-subdev5
crw-rw-rw- system   system    81,  15 2017-12-20 14:18 v4l-subdev6
crw-rw-rw- system   system    81,  16 2017-12-20 14:18 v4l-subdev7
crw-rw-rw- system   system    81,  17 2017-12-20 14:18 v4l-subdev8
crw-rw-rw- system   system    81,  18 2017-12-20 14:18 v4l-subdev9
crw-rw-rw- system   system    81,   0 2017-12-20 14:18 video0
crw-rw-rw- system   system    81,   1 2017-12-20 14:18 video1
crw-rw-rw- system   system    81,   2 2017-12-20 14:18 video2
crw-rw-rw- system   system    81,   3 2017-12-20 14:18 video3
crw-rw-rw- system   system    81,   4 2017-12-20 14:18 video4
crw-rw-rw- system   system    81,   5 2017-12-20 14:18 video5
crw-rw-rw- system   system    81,   6 2017-12-20 14:18 video6
crw-rw-rw- system   system    81,   7 2017-12-20 14:18 video7
crw-rw-rw- system   system    81,   8 2017-12-20 14:18 video8
crw-rw-rw- system   system    10,  42 2017-12-20 14:18 vr

插拔USB设备,再来一次

shell@xxxx:/ $ ls -l /dev/v*
crw-rw-rw- system   system    81,   9 2017-12-20 14:18 v4l-subdev0
crw-rw-rw- system   system    81,  10 2017-12-20 14:18 v4l-subdev1
crw-rw-rw- system   system    81,  19 2017-12-20 14:18 v4l-subdev10
crw-rw-rw- system   system    81,  20 2017-12-20 14:18 v4l-subdev11
crw-rw-rw- system   system    81,  11 2017-12-20 14:18 v4l-subdev2
crw-rw-rw- system   system    81,  12 2017-12-20 14:18 v4l-subdev3
crw-rw-rw- system   system    81,  13 2017-12-20 14:18 v4l-subdev4
crw-rw-rw- system   system    81,  14 2017-12-20 14:18 v4l-subdev5
crw-rw-rw- system   system    81,  15 2017-12-20 14:18 v4l-subdev6
crw-rw-rw- system   system    81,  16 2017-12-20 14:18 v4l-subdev7
crw-rw-rw- system   system    81,  17 2017-12-20 14:18 v4l-subdev8
crw-rw-rw- system   system    81,  18 2017-12-20 14:18 v4l-subdev9
crw-rw-rw- system   system    81,   0 2017-12-20 14:18 video0
crw-rw-rw- system   system    81,   1 2017-12-20 14:18 video1
crw-rw-rw- system   system    81,   2 2017-12-20 14:18 video2
crw-rw-rw- system   system    81,   3 2017-12-20 14:18 video3
crw-rw-rw- system   system    81,   4 2017-12-20 14:18 video4
crw-rw-rw- system   system    81,   5 2017-12-20 14:18 video5
crw-rw-rw- system   system    81,   6 2017-12-20 14:18 video6
crw-rw-rw- system   system    81,   7 2017-12-20 14:18 video7
crw-rw-rw- system   system    81,   8 2017-12-20 14:18 video8
crw-rw-rw- system   system    10,  42 2017-12-20 14:18 vr

没有任何变化,看来要不摄像头不支持UVC,要不就是没发现设备。

判断一个设备是否支持UVC协议

adb shell
cd sys/bus/usb/drivers
ls

如果存在uvcvedio文件夹则是支持协议

后来研究了下设备,目前排除AliFacePay摄像头,它采用的调用方式是OpenNI2,下面转入OpenNI2的研究。

android设备带宽不够

[11019*stream.c:1589: uvc_stream_start_bandwidth]:fail

未完待续……

转载于:https://my.oschina.net/daxian1110/blog/1855192

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值