qmlglsink from Python

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

qmlglsink from Python

Eric Johnson - hardware
I am trying to use qmlglsink from python (PyQt5) so that I can display video content in a qml QQuickItem.

As a first step I was trying to port the example in
    gst-plugins-good-1.14.3/tests/examples/qt/qmlsink

The problem I am having is that I don't know how to get a pointer to the QQuickItem which is needed by the widget property of qmlglsink.

The following code
        videoItem = root.findChild(QtQuick.QQuickItem, "videoItem")
        sink.set_property("widget", videoItem)
gives me the error:
       TypeError: could not convert <PyQt5.QtQuick.QQuickItem object at 0x7f177ea3b048> to type 'gpointer' when setting property 'GstQtSink.widget'

If anyone can suggest how to resolve this it would be appreciated.

Thanks

Eric



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

Re: qmlglsink from Python

Nicolas Dufresne-5
Le mercredi 19 septembre 2018 à 01:06 -0400, Eric Johnson - hardware a
écrit :

> I am trying to use qmlglsink from python (PyQt5) so that I can
> display video content in a qml QQuickItem.
>
> As a first step I was trying to port the example in
>     gst-plugins-good-1.14.3/tests/examples/qt/qmlsink
>
> The problem I am having is that I don't know how to get a pointer to
> the QQuickItem which is needed by the widget property of qmlglsink.
>
> The following code
>         videoItem = root.findChild(QtQuick.QQuickItem, "videoItem")
>         sink.set_property("widget", videoItem)
> gives me the error:
>        TypeError: could not convert <PyQt5.QtQuick.QQuickItem object
> at 0x7f177ea3b048> to type 'gpointer' when setting property
> 'GstQtSink.widget'
>
> If anyone can suggest how to resolve this it would be appreciated.

Unfortunatly, this will require a hand written binding. The GObject
introspection knows about GObject, which makes passing GtkWidget easy,
but does not know about QT object (same goes for GObject property). So
short term it seams the easiest is to implement a binding that
implement the cast.

>
> Thanks
>
> Eric
>
>
> _______________________________________________
> 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