I am developing an application for Raspberry Pi 5 that needs to render video from a camera on the screen while also displaying real-time graphics.
I can achieve this in two ways:
- creating a QGlPicamera2 and rendering the graphics with a QWidget using QPainter.
- creating a QPicamera2 and rendering the graphics with a QOpenGLWidget using paintGL.
However, I have not been able to enable hardware acceleration in both cases simultaneously. If I create the graphics with QOpenGLWidget and then try to create a QGlPicamera2, I encounter an EGL_BAD_ACCESS error.
I thought about creating a shared context and sharing it:But it seems that QGlPicamera2 creates its own context and does not accept an external one.
Is there any way to achieve what I want?
I can achieve this in two ways:
- creating a QGlPicamera2 and rendering the graphics with a QWidget using QPainter.
- creating a QPicamera2 and rendering the graphics with a QOpenGLWidget using paintGL.
However, I have not been able to enable hardware acceleration in both cases simultaneously. If I create the graphics with QOpenGLWidget and then try to create a QGlPicamera2, I encounter an EGL_BAD_ACCESS error.
I thought about creating a shared context and sharing it:
Code:
shared_context = QOpenGLContext()
Is there any way to achieve what I want?
Statistics: Posted by marinraf — Wed Dec 04, 2024 12:07 pm