Qt and X
-
Hello,
Due to not being a proper solution to video capture (at least not in previous versions) our software uses X directly to paint on a widget.
We use XvShmPutImage directly on the winId obtained by the widget and this works mostly ok.
The thing is that sometimes it is necessary to explicitly capture a frame and display it on a widget.
I can confirm that capturing the frame works andXvShmPutImage is invoked but I can't see anything displayed on the widget.
My guess is that it has to do with Qt not knowing that the widget was painted on and needs to be notified or something like that
but it's just a guess.
If anyone has any thought on why this might happen it would be greatly appreciated.Thanks.
-
Are you using the Qt::WA_PaintOnScreen attribute to prevent Qt from also flushing its backing store contents to the same widget?
-
Yes I am.
-
How do you do the frame capture?
-
We are using V4L2 to capture the video, the copying the data to an XvImage and eventually drawing it using XvShmPutImage.
-
But you said:
bq. We use XvShmPutImage directly on the winId obtained by the widget and this works mostly ok.
and then:
bq. The thing is that sometimes it is necessary to explicitly capture a frame and display it on a widget.
I can confirm that capturing the frame works and XvShmPutImage is invoked but I can’t see anything displayed on the widget.What do you do differently in these two cases such that the first works mostly ok and the second fails, if you use XvShmPutImage in both?
-
I think this has been solved. Not sure but I think a call to XSync was neccesary.
THanks.