[Interest] how to repaint QOpenGLWidget directly?
刘斐君
hustlfj at 163.com
Fri Jan 9 09:37:12 CET 2015
Hi everyone,
I'm trying to write a program, which runs on Mac OSX, to play several videos at the same time.
The video data is in YUV format. It's convenient on Windows to use Qt to manage widgets and use SDL to handle the playing while this two lib doesn't fit well on Mac. So I tried QOpenGLWidget to do the playing work. The way I do this is reimplementing initializeGL() and paintGL() of QOpenGLWidget,and call update() every time I got a decoded frame in play thread.
The problem is too much paintEvents(25 frames per second per video) blocked other events, inputs from mouse and keyboard are responsed rather slowly. So is there any solution to do the repaint work directly in the play thread, instead of sending a event to the gui thread? I have tried to use swapbuffer() of QOpenGLContext in paintGL(), but it doesn't work as QWindow do, the frame never changed unless I call update().
Any advices would be appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150109/574c0112/attachment.html>
More information about the Interest
mailing list