PDA

View Full Version : Interprocess video transfer from a non-Qt app: QSharedMemory, X11, something else?



artem.marchenko
27th February 2012, 16:21
We are building a linux-only skype video client and unfortunately on Linux Skypekit doesn't seem to provide an easy way for delivering video frames to the final app. What is possible is to get video rendered in a reference videohost's window. I'd like to transfer these frames to our app UI, put them to QML and e.g. draw some QML buttons on top. We have a working code for doing all UI from the array of pixels data (skypekit provides it on Windows and Mac, but not on Linux), but we have challenges with transferring the array of pixels from video host to our app.

*Options*
We figured out several options and it would be great to have an opinion from somebody with experience in interprocess communication and/or video-stuff on these:

1. Asking video host to draw to QPixmap in our app (to underlying X11 actually)
That is the approach we are trying now, but without much success so far (BadDrawable errors when trying to paint to our X11 pixmap from videohost). I am also not sure if there will be synchronization issues as once in a while we'll need to copy that pixmap to screen.

2. Using something like QSharedMemory so that videohost would write binary frames to it and our app would read from it
Could it be fast enough for video?
Since videohost is not a Qt app, we can't use QSharedMemory's lock and will have to synchronize on our own somehow (somehow making QMutex and videohost's mutex objects to refer to the same stuff system mutex?)

3. Making videohost a part of the main app
Biggest challenge here is that reference videohost is a non-Qt app built using a custom makefile that runs slightly differently for this and that CPU architecture etc. Migrating such a build to QMake could be beyond the edge of my Qt skills.

What do you think?