Screen capture in GTK+ application

David Woodhouse dwmw2 at infradead.org
Tue Apr 17 10:44:56 UTC 2018


I tried using ximagesrc as a video source in Pidgin (which is still
using GTK2+, FWIW). It fell over:
 [xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
 [xcb] Aborting, sorry about that.

Is ximagesrc just not expected to work in threaded GTK programs? That
might be worth mentioning in its documentation...

What's the sanest way to resolve it? Once upon a time, perhaps
ximagesrc could have had an option to use gdk_threads_enter() around
its XLib calls instead of just using its own mutex, perhaps? That
doesn't seem like a viable option now though, if it ever was.

Should I create a 'gdkwindowsrc' element which works directly through
GTK/GDK to do the captures from a given GdkWindow instead?

That might work nicely since from the application's point of view it
would abstract away the X/Wayland/Windows/OSX differences. It could
also be a home for a generic UI widget which allows the user to choose
*what* to capture (one app, one monitor, or the entire display).

Better ideas?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5213 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20180417/9724c434/attachment.bin>


More information about the gstreamer-devel mailing list