qmlglsink from Python

Nicolas Dufresne nicolas at ndufresne.ca
Wed Sep 19 12:47:01 UTC 2018

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
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

More information about the gstreamer-devel mailing list