View Full Version : Capture frames from camera and simultaniously displaying it

7th August 2009, 20:21

It is the first time I develop a software with the Qt Library.

I would like to hear some advices from experienced developers about the software design.

Here is the problem:

I have another library which provides a function to capture a frame, which blocks until the next frame is available.
Further I would like to display each captured frame in a QGraphicsScene.

My first idea was to use an seperate thread (QThread) to capture one image afther the other and replace a QImage with the current frame.
I inserted the QImage via a QGraphicsPixmapItem into my QGraphicsScene.

Is this the best solution, or are ther any better ways to achieve this?
Dou you have any tipps regarding the race conditions?

Another idea I have is to use a signal, so that whenever a new frame is available the signal gets fired.
But I don't know how this can be done in Qt with the blocking function call of capture_frame(img*).