简体   繁体   English

Android模拟器-/ dev / video丢失

[英]Android Emulator - /dev/video missing

I am creating an application that connects to the phone camera from native code. 我正在创建一个从本机代码连接到手机摄像头的应用程序。 This works great on my phone. 这在我的手机上效果很好。 The problem is that when i try to do the same thing with android emulator, there is no "/dev/video" to connect to (i know the camera is connected because i am able to open it using the camera app). 问题是,当我尝试使用android模拟器执行相同的操作时,没有要连接的“ / dev / video”(我知道相机已连接,因为我能够使用相机应用程序将其打开)。 Does anyone know if there is another way i can connect to the camera from native code? 有人知道我是否可以通过其他方式从本机代码连接到相机?

/dev/video0 is, in terms of Android, an implementation detail , and not guaranteed to be present on any device or emulator. 就Android而言, / dev / video0实现细节 ,不能保证在任何设备或仿真器上都存在。

Emulator support for camera is very limited, see for example Android webcam enable in emulator 相机对模拟器的支持非常有限,例如参见模拟器中的Android网络摄像头启用

There is no official native camera API on Android, so there's no guaranteed to work way of doing this. Android上没有官方的本机摄像头API,因此无法保证可以做到这一点。

For maximum compatibility, use the Java API and send the image data to native code for processing, if necessary. 为了获得最大的兼容性,请使用Java API,然后将图像数据发送到本机代码进行处理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM