使用 Qt WebGL(如 VNC)进行屏幕共享

Screen Sharing with Qt WebGL (like VNC)

我刚刚试用了 Qt WebGL,很高兴看到我的应用 运行 在浏览器中 w/o 进行了任何更改(除了使用 -platform webgl 启动它)!

我想使用 WebGL 进行屏幕共享,这样它仍然可以在设备上使用,同时还可以通过浏览器与应用程序交互。这在当前平台插件中是否可能以某种方式实现,或者将来是否可以扩展平台插件以支持此功能?

Qt WebGL 流式处理是有意为每个应用程序的单个用户完成的。关于Qt WebGL streaming 提到的原因here in a presentation

Why single user?

  • Problem with user input
  • Problem with querying the GPU
  • We can improve security

不过,我发现一篇博客 post 提出了一个解决方案:启动 Qt 应用程序的多个并行进程,每次使用一个,然后使用 Qt Remote Objects 同步所有这些进程的状态。其中一个进程将是“主应用程序”,而其他进程将复制它显示的内容。应用程序的状态必须包括影响其呈现内容的所有内容,包括模型内容和 window 大小。

可以在 this article 中找到此技术的详细配方。

a Qt blog post 中也有此部分确认此方法可行:

By the way, there is an idea to complement streaming with an ability of mirroring as in some cases having the latter is more important.

Speaking about mirroring, I would like to mention our recent webinar [edit: link update by me] that we had together with Toradex. There you can see an interesting combination of WebGL streaming and Remote Objects, which allows you to implement mirroring functionality as of now already.

在上面链接的网络研讨会视频中,镜像/屏幕共享的演示开始 here。这种镜像甚至 two-way,允许同时从多个屏幕操作应用程序。

与“真实”屏幕共享不同,鼠标指针不会被共享。但是,您可以将鼠标指针位置作为主应用程序的状态 属性 进行跟踪,然后在客户端应用程序的该位置绘制一个“人工”鼠标指针。