Вопрос

I'm running a qt embedded application and mplayer, both of them on framebuffer.

When I start video playing through mplayer, I get a lot of flickers around the movie.

See the following movie:

http://youtu.be/kbKpfjLHzTY

How to fix it?

Это было полезно?

Решение

For Qt 4 with QWS,the embedded linux graphics sub-system for writing directly to a frame buffer you can run the following in a the -qws server's GUI thread before invoking mplayer,

QWSServer *server = QWSServer::instance(); 
if(server) 
   server->enablePainting(false); // Suspend Qt's drawing. 

You can use a SIGCHLD or something to figure out when mplayer is finished and re-anble painting. Another way would be to position mplayer's output window and use a QWSEmbedWidget to tell Qt not to draw there.

Both QWS and mplayer open the frame buffer and draw to it directly. There is nothing to marshal access to the display device. The QWS sub-system allows multiple Qt application to draw to the screen at the same time. However, it has no control over other processes accessing the frame buffer. For this reason, X11 or other display managers like Wayland, etc can be used. This is generally the method use in Qt5.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top