GNOME Bugzilla – Bug 523397
Implement a cairo video sink
Last modified: 2011-05-19 07:03:14 UTC
Hi, it'd be nice to have a good cairo video sink for GStreamer. Currently one exists in WebKit but it has some issues still. http://trac.webkit.org/projects/webkit/browser/trunk/WebCore/platform/graphics/gtk/VideoSinkGStreamer.cpp - it doesn't support upstream negotiation - doesn't use GstVideoSink as base class - probably fails for BGR (see TODO in 110) - copies the data twice (see TODO in 113) Also it would be nice if it could support more formats and if possible a GstCairoBuffer would be nice to have so upstream elements can write their data directly into a cairo buffer. Not sure if cairo offers something for this.
Another problem that popped up after some more thoughts on this is, that cairo doesn't seem to be thread-safe. So we need a way to give surfaces to the app and tell the app to draw them in it's main loop. For this we could use signals and I don't see another solution yet as the drawing should happen ASAP. Also we probably have to do some more magic with the surfaces, maybe ask the app to set a surface and then we create "similar" ones to that surface and give them to the app and the app can blit it on it's surface and has to free it afterwards.
Cairo is thread-safe, just not reentrant on the same object. So just associate a lock with the surface. This is the same as an Xlib Display object.
So I can do stuff on a surface from different threads, even if it's a win32 surface for example?
I'll close this as obsolete now. To make real use of cairo the sink has to be integrated into the application, which was done by webkit and others already. And others are just using clutter now, which has it's own video sink ;) I don't plan to work on this and apparently nobody else