Webcams used to be simple; a GStreamer source, an X11 sink, and maybe a GtkWindow if you wanted to get fancy. Multiple cameras per device are now common, Wayland is everywhere, and GtkWindow is a bit more fancy. Webcams themselves also got a lot more complicated, with some gaining the ability to sense into the infrared, making facial recognition a possibility, not to mention completely messing up trying to figure out the best webcam to use for video calls. As users probably do not want their applications to be able to build up a facial profile of them, it is a good thing that modern applications have to request access to webcams through portals - maybe all that added complexity is worthwhile after all!
Let’s look at best practices for a GTK 4 application using a webcam, with Cheese as an example.
David has been contributing to GNOME for a decade, and works for Red Hat on the desktop team. He maintains Cheese, the GNOME webcam application, as well as Logs, and spends quite a bit of time packaging too. In his spare time, he enjoys beekeeping, motorcycling and brewing modern beer.