This is an interesting one. QVideoFrame::map
is giving me these:
OpenGL context is not current, cannot map memory.
And when I try to use the QOpenGLContext::currentContext()
is doesn't work either. What is more QOpenGLContext::functions()
is killing my app (looks like bad memory access?) and that has probably something to do with the fact the context is not defined? I wish I knew more :(, but I also tried creating that context and it didn't have any impact.
This is the minimalistic example just added to the Clickable C++ template that crashes for me:
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QOpenGLContext>
#include <QOpenGLFunctions>
int main(int argc, char* argv[])
{
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine(QUrl("qrc:///Main.qml"));
QOpenGLContext *ctx = QOpenGLContext::currentContext();
QOpenGLFunctions *f = ctx->functions();
return app.exec();
}
Any ideas what could be causing that? My attempts were so far quite futile too
Thanks a mil!
EDIT:
I later found out where the QVideoFrame::map
error is coming from:
https://gitlab.com/ubports/development/core/qtubuntu-camera/-/blob/main/src/aalvideorenderercontrol.cpp
As well as how to initialize the OpenGLContext - see per post bellow.