0

As far as i understand X11 does not support double\triple buffer mechanism to avoid screen tearing. so I tried to use the openGL widgets, then i understood there no support what so ever for openGL+raspberry pi +qt4.

All i am asking is a very basic thing, catch frames from video camera, process them, and show on screen, and I am getting very! bad screen tearing.

I know QT5+WAYLAND+PI does has some sort(?) of support for openGL, will this help me solve this problem?(reasonably easy, and i mean not big changes in my application!!) is there is anything else i can do? (besides changing the source code of X11...) :)

Alex
  • 159
  • 1
  • 9

1 Answers1

0

If you are targeting Raspberry Pi I suggest you use the eglfs Qt 5 plugin, which means OpenGL through EGL without X11. Tearing is prevented by EGL and performance is very good.

Luca Carlon
  • 9,546
  • 13
  • 59
  • 91
  • I have no experience with openGL, and i cannot find examples for openGL+raspberry. basically i have an app which has few buttons and a QLabel(to show the camera capture), my app is at full mode screen all time(witch is good, as it is one of the restrictions of this QT5 EGFL plugin..), can you help me with an example? (i could not find any), and how complex is it to transform my app to openGL? (it has a very basic gui) – Alex Sep 28 '15 at 15:10
  • No OpenGL code. You use Qt code just as you were on X11. Use the QLabel to set the QPixmap with the properly converted data coming from the device. OpenGL is used transparently by Qt. Or better move data to QML and implement the UI in QML: again no OpenGL code. – Luca Carlon Sep 28 '15 at 15:58
  • so i am just taking my qt4 app + little changes(headers changes), and it all should work? how do i use this "qt5 egfl plugin"? sorry for the dumb questions.. – Alex Sep 28 '15 at 16:15
  • There are further restrictions for OpenGL-based windows. As of Qt 5.3, eglfs supports a single, fullscreen GL window (for example, an OpenGL-based QWindow, a QQuickView or a QGLWidget). Opening additional OpenGL windows or mixing such windows with QWidget-based content is not supported and will terminate the application with an error message. (from the docs), so how adding qlabel is going to work? father more how do i integrate buttons? – Alex Sep 28 '15 at 16:26
  • Adding a QLabel works if you simply create it and do not mix with other types of surfaces. Please refer to the documentation: http://doc.qt.io/qt-5/embedded-linux.html. Qt Quick is the best way to go, but your use case is pretty simple. A button can be used by instantiating the proper class, like QPushButton. – Luca Carlon Sep 28 '15 at 17:24
  • I all ready have a qt4 project, it uses simple qpush buttons, and qlabel + setpixmap, so you basically saying all i have to to is compile this projects with qt5+small changes (qt4-->qt5), and if i run this this app using qt5 eflgs plugin mode, all should just work?.. ok so i will try this, and post my findings. – Alex Sep 28 '15 at 17:48
  • ok thanks. but how do i mark the answer as accepted? if you mean to vote for for it, i cannot do so(low reppo thing). – Alex Oct 10 '15 at 08:16