Problems with Qt + GStreamer -> no current context (NULL)

Hi all,

I’m currently struggling with getting a GStreamer stream displayed in an Qt application on the Jetson.

The app is pretty basic and my pipeline is like:
videotestsrc ! glupload ! qmlglsink

The problem occurs as soon as I’m trying to load the qml file.


int main(int argc, char *argv[]) 
    int ret; 

    // Init gstreamer + debug level. 
    gst_init (&argc, &argv); 

    // Preload qmlglsink to have it properly available as module in qml. 
    GstElement *sink = gst_element_factory_make ("qmlglsink", nullptr); 

    QGuiApplication app(argc, argv); 

    QQmlApplicationEngine engine; 
    engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); // -> this creates an error that the current context could not be retrieved

The error:

WARN glcontext gstglcontext.c:495:gst_gl_context_get_current_gl_context: Could not retrieve current context
ERROR qtglutility cannot wrap qt OpenGL context (NULL)

Did anyone encounter such problems?

The code is running fine on a x86 (with NV card) based LUbunutu 19.xx, but not on the Jetson.

As EGL is playing a role here, I’m pretty sure this is a cause of the problem but I cannot figure out what exactly.

Any help is appreciated.


Does the gst-launch-1.0 pipeline working?
Have try export DISPLAY=:0/1

I can’t test my ‘code’ pipeline directly from the commandline as it requires a qt videoitem.

My DISPLAY is set to :0

FYI, this is working:
videotestsrc ! nveglglessink