how to take a screenshot under weston-wayland programmatically C/C++?

1.1k Views Asked by At

I need to take a screenshot of the screen from my application that launches another process which will run chromium headless.

I used to perform that using XGetImage but that's X11 API and therefore not working under Weston (my Wayland compositor). I've had a look at https://github.com/krh/weston/blob/master/clients/screenshot.c but after managing to build that code being call from the main, I ended up having the same result than trying to call weston-screenshooter as a command line (Naively I was expecting to be able to get a screenshot by just calling the application). Is there a way to do it? (any code snippet welcomed). Wayland is new for me, I am more used to X11. I've seen the dbus proposition (How can I take a screenshot on Wayland?), I need to perform 30 screenshots per second.

Thank you.

0

There are 0 best solutions below