I am developing Qt application for a embedded linux/MIPS device. So far managed to execute my Qt application on the device. Now I need to create overlays on top of video. Hardware provides four overlays windows and does not support OpenGL.

Tried so far:

  1. Tried creating QStackedLayout and QGraphicsView for creating overlays on top of video. But overlay appears black, though widgets on overlay responds to user click.
  2. Tried to access multiple framebuffers directly. I am able to access /dev/fb0 but not /dev/fb1, 2, 3.
  3. Tried creating a simple Qt application with a dialog and a push button on it. I tried executing it on embedded device using this command ./<appname> -display directfb:/dev/fb1:2. But it fails to open /dev/fb1.

Questions:

  • How can I use the overlay windows provided by the LCD controller?
  • Is it possible to use directfb plugin provided by QT and take advantage of its OpenGL support?
  • Do I have to explicitly map /dev/fb1 to user space to be able to use it?

Need urgent help regarding this.

有帮助吗?

解决方案

Finally got this working. I could find the interface using which I could access the framebuffers.

  • Then using -display switch I directed output of Qt app to framebuffer meant for overlay window. The exact command used was ./app-name -display Linuxfb:/dev/fb2:enable=1.
  • Also enabled the alpha mode of the framebuffer /dev/fb2 which showed through the video playing below.

其他提示

Before trying to use Qt, you have to understand how the hardware overlays are supported by the Linux kernel, and what userspace interface the kernel provides to use those overlays. In general, only one overlay is accessible as a framebuffer, the other overlays for video are accessible as Video4Linux output devices. But it really depends on what the hardware is and how the Linux support has been done on this hardware.

My answer actually is not about qt but about hw layer. If your hardware supports overlays so this should mean that the directfb supports multiple hardware layers. Your tries to use fb1,fb2... fails because there is only one fb driver and it's used by directfb and you should use directfb instead of fb directly. First of all I suggest you to check whether hw really supports additional hw layers(surfaces) and not only primary, for that you can for instance write simple directfb app which sets this callback, and after initialization of directfb interface the core will call your callback for every presented hw layer(surface) with it's capabilities as argument. Anyway I don't remember but I guess that Qt always uses primary surface.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top