在native中实现相机预览并在flutter中使用

发布于 2025-01-12 15:25:02 字数 334 浏览 2 评论 0原文

我想实现一个原生 android 相机预览(使用 c++)并在 flutter 应用程序上显示此预览。

我找不到任何直接可能的方法来做到这一点 - 到目前为止,我能找到的唯一解决方案(我仍然不确定它是否会起作用并且认为它可能太复杂)如下:

实现本机流使用ACameraCaptureSession_setRepeatingRequest和ACameraDevice_createCaptureRequest,将其传递给Java,并将其转换为android视图,然后使用Flutter的PlatformView。

正如我所提到的,我不确定它是否会起作用,即使它起作用,我想知道是否有一些更简单的方法可以做到这一点。

I want to implement a native android camera preview (using c++) and display this preview on a flutter application.

I couldn't find any direct possible way to do so - up to this point the only solution I could find (which I still am not sure if it will work and think it might be too complex) is the following:

Implement a native stream using ACameraCaptureSession_setRepeatingRequest and ACameraDevice_createCaptureRequest, pass it to Java, and convert it to an android view, and then using Flutter's PlatformView.

As I mentioned, I'm not sure it will work, and even if it does, I wonder if there is some simpler way to do it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文