c++ - 我可以使用 Flutter FFI 获得 Flutter 表面纹理吗?
问题描述
这是 Flutter 插件代码的一部分,该插件使用 Flutter 纹理通过 OpenGL 渲染某些东西
private FlutterVideoPlugin(Registrar registrar, MethodChannel channel) {
this.registrar = registrar;
this.channel = channel;
this.textures = registrar.textures();
}
@Override
public void onMethodCall(MethodCall call, Result notSafeResult) {
final AnyThreadResult result = new AnyThreadResult(notSafeResult);
if (call.method.equals("createVideoRenderer")) {
TextureRegistry.SurfaceTextureEntry entry = textures.createSurfaceTexture();
//do anything with the texture
如您所见,它使用了 Flutter 方法调用。
是否可以在 C++ 中使用 FFI 做同样的事情?我不想依赖onMethodCall
,它必须是 FFI 或 Flutter 方法调用,因为我认为 FFI 以不同的方式做所有事情,就像那样。
但是,由于 Flutter 引擎,特别是 Texture 部分是用 Java 编写的,看起来我需要一些 Java 代码。问题是 FFI 和 java 不能混用。看起来我要么必须使用onMethodCall
我的应用程序中的所有内容,要么使用 FFI,但 FFI 似乎不支持获取纹理
解决方案
推荐阅读
- python - ValueError:检查输入时出错:预期 time_distributed_1_input 有 5 个维度,但得到了形状为 (148584, 1) 的数组
- reactjs - 如何在 ReactJS 中更改状态下的项目数组的值?
- javascript - 如何在graphQl中制作具有确定值的自定义类型
- ignite - 如何在正则表达式中给出键时从 Ignite Cache 中获取值?
- node.js - 使用 Angular 作为前端框架的 nodejs 应用程序的 Firebase 部署
- c# - SignalR:如何使用 IHubContext
ASP.NET MVC 中的接口? - javascript - 链接仅适用于桌面,但不适用于移动设备
- hadoop - HortonWorks HDP 2.6.5 或 2.5.0:显示“我的用户 Web 根”而不是 AMBARI
- c# - 如何用 \" 修复 JSON?
- c++ - 将逻辑 OR 与 cout 运算符一起使用