0

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?

artless noise
  • 21,212
  • 6
  • 68
  • 105
aldo85ita
  • 496
  • 2
  • 8
  • 19
  • Sorry, I'm using Qt4.7.4 qwith QWS. Your instruction doesn't fix the issue. Probably the source of the problem is related to other thing. – aldo85ita Jun 26 '13 at 08:14
  • I think you might not have understood my comment, so I left an answer. I am pretty sure that this is your issue; I had the same issue and I have viewed your video. You can also just loop `fbv` or something else and see the same thing happen. I think some *QWidget* in you screen is periodically re-drawing. As `mplayer` is drawing at approx 30x/sec you get a flash as it and Qt redraw. You might give *video size* parameters to `mplayer` and it may also solve your issue. You can use `fbdump` to capture screen shots, or something like `dd if=/dev/fb0 of=test.scr bs=480 count=320` – artless noise Jun 26 '13 at 17:44

1 Answers1

1

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.

artless noise
  • 21,212
  • 6
  • 68
  • 105