Try a QVideoWidget? http://doc.qt.io/qt-5/qvideowidget.html

I'm in a similar situation, but there's a few differences. As far as I can 
speak to what you want:
I have a QAbstractVideoFilter that gets sent frames continuously, but only 
captures some of them. Which ones are controlled by a function that unsets the 
captured flag, so it will capture the next frame to come in, sets a flag as 
captured and does dot capture any more frames.

These frames might be mappable, they might GL textures... I don't know what 
that means in terms of being able to set a textureId on a QLabel, but I'm sure 
it can be done, but I'd image it can be used immediately elsewhere in Qt, like 
as a pixmap in a QLabel. 

There might be a few frames of lag across the pipeline. Qt update() calls can 
be batched together, so that's not as direct as calling paint(), but paints can 
only happen in the GUI thread. However if you leverage Qt's GL capability 
(beyond me) it should be fast and simple. 

> Sent: Monday, June 25, 2018 at 8:30 AM
> From: "Lodron, Gerald" <[email protected]>
> To: "[email protected]" <[email protected]>
> Subject: [Interest] Rendering timing of qt
>
> Hi
> 
> 
> I am using a display as a projector for a camera/projector setup. Here i want 
> to display an Image using qt, trigger my cameras (so cameras do NOT 
> coninously grab) and view the reflection of the display on a mirror like 
> surface.
> 
> 
> I am using a QLabel with a setPixmap call from an qimage. in sum i have 12 
> different qimages in memory. To control my display i programmed a seperate 
> thread which polls over an external signal (IP port). when i get those signal 
> (in different thread as the GUI main thread) the thread calls the setPixmap 
> function and then returns. After that my cameras get triggered (from the 
> program wich sends the extern signal) and the images from the cameras are 
> stored/processed somehow.
> 
> 
> The problem is that my cameras sometimes record the old pixmap, so for me it 
> seems that the setPixmap do not immideately performs a repaint action of the 
> qwidget. I think that the repaint event must be triggered from the main gui 
> thread at some time because when i put a sleep of several hundret 
> milliseconds after setPixmap and before trigger cameras it works. I also 
> tested using a update call, without effect. And it seems that i am not 
> allowed to call repaint from my seperate thread because then the qlabel looks 
> really strange.... I dont like to sleep so long because my cameras can make 
> 30 frames per second which i want to use, so i twould be great if i could 
> force a qlabel update with 30Hz somehow....
> 
> 
> So my question:
> 
> -> is it possible to perform a fast repaint action? Do i need to swich my 
> command polling thread to main thread for this?
> 
> -> can i get a kind of response/signal when the repaint is finished so that i 
> can immedialtely trigger the cameras?
> 
> -> can someone explain me the timing and order/process of repaint(ing)
> 
> 
> Or shouldn't i use qt for this, which also would be an answer....
> 
> 
> thanks,
> 
> Gerald Lodron
> 
> 
> _______________________________________________
> Interest mailing list
> [email protected]
> http://lists.qt-project.org/mailman/listinfo/interest
> 
_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to