Android怎么实现外接USB摄像头

发布时间:2022-04-07 17:00:26 作者:iii
来源:亿速云 阅读:3485

这篇文章主要讲解了“Android怎么实现外接USB摄像头”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“Android怎么实现外接USB摄像头”吧!

实现

系统必须支持 android.hardware.usb.host

/system/etc/permissions下需要添加host的声明
<feature name=“android.hardware.usb.host” />

此外&#xff0c;还必须启用Kernel的 UVC 设备内核。

+CONFIG_USB_VIDEO_CLASS=y
+CONFIG_MEDIA_USB_SUPPORT=y

要在相应的设备细分版本中启用外接摄像头提供程序&#xff0c;以便添加必要的 SELinux 权限、外接摄像头配置以及外接摄像头提供程序依赖项&#xff0c;请完成以下步骤&#xff1a;

external_camera_config.xml的示例

<ExternalCamera>
   <Provider>   <ignore> <!-- Internal video devices to be ignored by external camera HAL -->   <id>0</id>           <!-- No leading/trailing spaces -->   <id>1</id> 
       </ignore>
   </Provider>
   <!-- See ExternalCameraUtils.cpp for default values of Device configurations below-->
   <Device>   <!-- Max JPEG buffer size in bytes-->   <MaxJpegBufferSize  bytes="8388608"/>  <!-- 8MB (> 2594x1944 YUV420) -->   <!-- Size of v4l2 buffer queue when streaming >= 30fps -->   <!-- Larger value: more request can be cached pipeline (less janky) -->   <!-- Smaller value: use less memory -->   <NumVideoBuffers  count="4"/>   <!-- Size of v4l2 buffer queue when streaming < 30fps -->   <NumStillBuffers  count="2"/>   <!-- List of maximum fps for various output sizes -->   <!-- Any image size smaller than the size listed in Limit row will report
       fps (as minimum frame duration) up to the fpsBound value. -->   <FpsList>   <!-- width/height must be increasing, fpsBound must be decreasing-->   <Limit  width="640" height="480" fpsBound="30.0" />   <Limit  width="1280" height="720" fpsBound="30.0" />   <Limit  width="1920" height="1080" fpsBound="30.0" />   <!-- image size larger than the last entry will not be supported-->   </FpsList>
   </Device></ExternalCamera>

您可以通过修改 external_camera_config.xml 文件来自定义外接摄像头提供程序。具体而言&#xff0c;客户可以自定义以下参数&#xff1a;

除了这些参数之外&#xff0c;您还可以添加自己的参数或开发自己的配置。

感谢各位的阅读,以上就是“Android怎么实现外接USB摄像头”的内容了,经过本文的学习后,相信大家对Android怎么实现外接USB摄像头这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是亿速云,小编将为大家推送更多相关知识点的文章,欢迎关注!

推荐阅读:
  1. 使用Opencv怎么实现最小外接矩形和圆
  2. Opencv如何绘制最小外接矩形、最小外接圆

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

android usb

上一篇:Android怎么读写eeprom

下一篇:linux如何查看jdk是32位还是64位的

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》