qmlglsink Problem on ARM based NV Jetson TX1 - Cannot retrieve current context (NULL)

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

qmlglsink Problem on ARM based NV Jetson TX1 - Cannot retrieve current context (NULL)

realBohd2
Hi all,
 
currently I'm trying to display a simple gstreamer stream within a QT Application.
 
The stream basically does:
videotestsrc ! glupload ! qmlglsink
 
This is working fine on a x86 host machine but does not work on the target ARM machine.
 
When running the binary there we get:
WARN glcontext gstglcontext.c:495:gst_gl_context_get_current_gl_context: Could not retrieve current context
ERROR qtglutility gstqtglutility.cc:158:gst_qt_get_gl_wrapcontext: cannot wrap qt OpenGL context (NULL)
 
This is caused when loading the qml file:
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
 
The main.qml features a GstGLVideoItem based on:
import org.freedesktop.gstreamer.GLVideoItem 1.0
 
May it be that the context simply isn't initialized at this moment?
Or can this be some kind of a version mismatch?
 
QMake version 3.1
Using Qt version 5.12.3
GStreamer 1.8.3
 
Remark: the qmlglsink is self-build from the 1.8.3 branch of the gst-plugins-bad.
 
Any help is appreciated.
 
Thanks,
Bodo

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: qmlglsink Problem on ARM based NV Jetson TX1 - Cannot retrieve current context (NULL)

realBohd2
Just to make sure, I'm replying myself here, as the mailing wrapped the email
in a HTML attachment...

Original message:

Hi all,
 
currently I'm trying to display a simple gstreamer stream within a QT
Application.
 
The stream basically does:
videotestsrc ! glupload ! qmlglsink
 
This is working fine on a x86 host machine but does not work on the target
ARM machine.
 
When running the binary there we get:
WARN glcontext gstglcontext.c:495:gst_gl_context_get_current_gl_context:
Could not retrieve current context
ERROR qtglutility gstqtglutility.cc:158:gst_qt_get_gl_wrapcontext: cannot
wrap qt OpenGL context (NULL)
 
This is caused when loading the qml file:
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
 
The main.qml features a GstGLVideoItem based on:
import org.freedesktop.gstreamer.GLVideoItem 1.0
 
May it be that the context simply isn't initialized at this moment?
Or can this be some kind of a version mismatch?
 
QMake version 3.1
Using Qt version 5.12.3
GStreamer 1.8.3
 
Remark: the qmlglsink is self-build from the 1.8.3 branch of the
gst-plugins-bad.
 
Any help is appreciated.
 
Thanks,
Bodo



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: qmlglsink Problem on ARM based NV Jetson TX1 - Cannot retrieve current context (NULL)

Ilya Aleshkov
Hi Bodo,

How do you start your pipeline?

Thanks,
Ilya

On Thu, Aug 1, 2019 at 3:10 PM realBohd2 <[hidden email]> wrote:
Just to make sure, I'm replying myself here, as the mailing wrapped the email
in a HTML attachment...

Original message:

Hi all,

currently I'm trying to display a simple gstreamer stream within a QT
Application.

The stream basically does:
videotestsrc ! glupload ! qmlglsink

This is working fine on a x86 host machine but does not work on the target
ARM machine.

When running the binary there we get:
WARN glcontext gstglcontext.c:495:gst_gl_context_get_current_gl_context:
Could not retrieve current context
ERROR qtglutility gstqtglutility.cc:158:gst_qt_get_gl_wrapcontext: cannot
wrap qt OpenGL context (NULL)

This is caused when loading the qml file:
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));

The main.qml features a GstGLVideoItem based on:
import org.freedesktop.gstreamer.GLVideoItem 1.0

May it be that the context simply isn't initialized at this moment?
Or can this be some kind of a version mismatch?

QMake version 3.1
Using Qt version 5.12.3
GStreamer 1.8.3

Remark: the qmlglsink is self-build from the 1.8.3 branch of the
gst-plugins-bad.

Any help is appreciated.

Thanks,
Bodo



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: qmlglsink Problem on ARM based NV Jetson TX1 - Cannot retrieve current context (NULL)

realBohd2

> How do you start your pipeline?

Thanks for your feedback.

The startup is pretty basic I think.
Please see here the startup snippet:

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

    // Init gstreamer + debug level.
    gst_init (&argc, &argv);
    gst_debug_set_active(TRUE);
    gst_debug_set_default_threshold(GST_LEVEL_DEBUG);

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

    QGuiApplication app(argc, argv);

    QQmlApplicationEngine engine;
    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));

.....

As I wrote, when loading the qml, the error with the NULL context occurs.





--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: qmlglsink Problem on ARM based NV Jetson TX1 - Cannot retrieve current context (NULL)

Ilya Aleshkov
Hi Bodo,

Ok ) But how exactly do you start your pipeline? I mean do you use the trick with scheduleRenderJob(): 

 /* find and set the videoItem on the sink */
    rootObject = static_cast<QQuickWindow *> (engine.rootObjects().first());
    videoItem = rootObject->findChild<QQuickItem *> ("videoItem");
    g_assert (videoItem);
    g_object_set(sink, "widget", videoItem, NULL);

    rootObject->scheduleRenderJob (new SetPlaying (pipeline),
        QQuickWindow::BeforeSynchronizingStage);
I should note as well that everything started to working for me only since GStreamer 1.14.4 (Windows).

Thanks,
Ilya


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: qmlglsink Problem on ARM based NV Jetson TX1 - Cannot retrieve current context (NULL)

realBohd2
Hi Ilya,

yes, pretty similar to yours:


> void connectAndStartPipeline(QQuickWindow* root, QString itemName,
> Pipeline* pL)
> {
>     QQuickItem* videoItem = root->findChild
> <QQuickItem *>
>  (itemName);
>     g_assert (videoItem);
>     pL->AttachSinkToItem(videoItem);
>     root->scheduleRenderJob (pL, QQuickWindow::BeforeSynchronizingStage);
> }

I have little pipeline helper class.
The AttachSinkToItem does:


> void Pipeline::AttachSinkToItem(QQuickItem* item)
> {
>     g_assert (item && sinkQml);
>     g_object_set(sinkQml, "widget", item, nullptr);
> }

This is working fine on an x86 based LUbuntu 19.xx, but not on the Ubuntu
16.04 on the ARM/EGL Jetson :/
Nonetheless .. without an GL context in the first place - nothing will be
rendered..

Best,
Bodo



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel