c# - Unity android Native Camera 作为 WebcamTexture

标签 c# android unity3d camera

有人可以帮助我像使用 WebcamTexture 一样在 Unity 中使用 Android 的 Native Camera 吗?我想要 Unity 中的“相机预览图像”作为 texture2d 或纹理。

提前致谢。

最佳答案

我用 https://bitbucket.org/Unity-Technologies/graphicsdemos 做过一次作为起点。您会对 RenderingPlugin.cpp 感兴趣。

过去,我不得不使用 Java 代码作为连接到 Android NDK 的桥梁,因为出于安全原因,无法在 C 级的相机源中插入 ImageReader。

看起来事情已经更新了,可以通过使用 https://github.com/googlesamples/android-ndk/tree/master/camera 来简化架构。 .

希望这对您有所帮助。

ps-> 如果您想进行代码演练,我在这里整理了一个端到端的演示 https://github.com/robsondepaula/unity-android-native-camera

关于c# - Unity android Native Camera 作为 WebcamTexture,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51001412/

相关文章:

c# - 使用 P/Invoke 时存储非托管代码的数据

unity3d - 如何将球扔到飞机上的特定点?

c# - 命名空间的数量会影响性能吗?

c# - 什么内存用于方法中定义的常量?

java - Android dex 问题 : nested class + final boolean : com. android.dex.util.ExceptionWithContext

android - 从服务运行中收集加速度计数据

unity3d - 在 Unity 中更改场景或具有不同的 ui 屏幕更有效吗?

C# 泛型 - 返回派生类的对象?

c# - 用逻辑计算列id

android - 列出可用 avdname 的命令是什么