Qt 4.8 screen updates with QPA (eglfs, OpenGL) and camera

We have a Qt application that uses a video plugin I developed for i.MX53. This plugin allows "CSI0Video" and "CSI1Video" objects to be created in QML, e.g.

CSI0Video { id: csi0 displayRect: "30, 0, 320x480" channel: 1 rotationMode: base.rotate_90_RIGHT_HFLIP }

We further support both being active on the screen at the same time. CSI0 operates via the "overlay" method (in i.MX53 terms) and CSI1 operates via the "tvin" method. They must operate this way in order to get two distinct IPU paths. They're basically two different ways for the IPU driver to "blend" them into the framebuffer.

CSI1 works fine.

When we were using QWS, everything was also fine with CSI0, though we had to make sure that any screen elements underneath CSI0 were turned to alpha 0 or else whenever Qt updated the screen, CSI0 would flicker. As long as we weren't drawing anything under there, it was fine.

We have now shifted to using QPA for screen presentation so that we can use the EGLFS platform plugin and get OpenGL acceleration. We did this for performance reasons [this meant no changes were made to the application, just the underlying method of screen presentation, we don't use any QGLWidgets or anything].

Now however, the CSI0 camera feed flickers whenever there is a change on the Qt screen. I suspect this is because OpenGL with Qt only operates on a full-screen basis.

I have played with the ViewPortUpdateMode of our QmlApplicationViewer class (a descendant of QGraphicsView) and no settings make a difference in the screen refresh, other than QGraphicsView::NoViewportUpdate, where of course, the camera feed stops flickering but I don't get any screen updates at all.

I have also modified the same video plugin to work with Crank. Crank allows you to specify that a region of the screen has an external rendering and there I'm able to achieve flicker-free GUI updates with camera running on CSI0. So I know it's possible within the hardware.

Is there any way to tell Qt/QML 4.8 to ignore a portion of the screen completely when using the EGLFS platform? Anyone have any suggestions as to things we can try?

If I use the QGraphicsView::NoViewportUpdate mode for the whole screen, what do I need to do to get the rest of the screen updating ? Create my own paint methods for everything? Will this work or once I do that will it just trigger more full screen updates?

I have tried a number of things in the video class changing the way we present it but just about anything you change in CSI0 will mean stomping over IPU paths or framebuffers that the CSI1 feed needs to use.

ADDENDUM: I have also specified "Qt::WA_NoSystemBackground" and "Qt::WA_OpaquePaintEvent" in my main.cpp file on my QmlApplicationViewer.

Category:c# Views:1 Time:2018-12-03
Tags: opengl

Related post

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.086 (s). 11 q(s)