Get screenshot of EGL DRM/KMS application
One way would be to get a screenshot from within your application, reading the contents of the back buffer with
glReadPixels()
. Or use QQuickWindow::grabWindow(), which internally usesglReadPixels()
in the correct way. This seems to be not an option for you, as you need to take a screenshot when the Qt app is frozen.The other way would be to use the DRM API to map the framebuffer and then
memcpy
the mapped pixels. This is implemented in Chromium OS with Python and can be translated to C easily, see https://chromium-review.googlesource.com/c/chromiumos/platform/factory/+/367611. The DRM API can also be used by another process than the Qt UI process that does the rendering.