gpt4 book ai didi

c# - Unity android Native Camera 作为 WebcamTexture

转载 作者:太空宇宙 更新时间:2023-11-03 14:53:01 32 4
gpt4 key购买 nike

有人可以帮助我像使用 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/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com