简体   繁体   中英

Screen Sharing with Qt WebGL (like VNC)

I just tried out Qt WebGL and was thrilled to see my app running in the browser w/o making any changes (other then starting it with -platform webgl)!

I would like to use WebGL for screen sharing so that it would still usable on the device while also being able to interact with the app through the browser. Is this somehow possible with the current platform plugin or would it be possible to extend the platform plugin to support this in the future?

Qt WebGL streaming is intentionally only done for a single user per application. The reasons are mentioned here in a presentation about Qt WebGL streaming:

Why single user?

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

However, I found a blog post presenting a solution: start multiple parallel processes of the Qt application, one per use, and then sync the state of all these processes using Qt Remote Objects . One of the processes would be the "master application", and the others would duplicate what it shows. The application's state has to include everything that influences its rendered content, including model content and window size.

A detailed recipe for this technique can be found in this article .

There is also this section in a Qt blog post that confirms that this approach is possible:

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.

Within the webinar video linked above, the demonstration of mirroring / screen sharing starts here . This type of mirroring is even two-way, allowing to operate the application from multiple screens simultaneously.

Unlike in "real" screen sharing, the mouse pointer would not be shared. You might however be able to track the mouse pointer position as a state property of the master application and then paint an "artificial" mouse pointer at that position in the client applications.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM