Trouble with qml6glsink

I have trouble using qml6glsink

I keep getting this error: module “org.freedesktop.gstreamer.GLVideoItem” is not installed
import org.freedesktop.gstreamer.GLVideoItem 1.0

My code is super simple (also ran as root user, same issue, I am using Ubuntu 25.10):

playbin = gst_element_factory_make (“playbin”, “playbin”);
gtksink = gst_element_factory_make(“qml6glsink”, NULL); //this works fine (I call this first, then I load the QML)

assert(gtksink!=nullptr);

QQuickWidget *view = new QQuickWidget(y);
view->setSource(QUrl(QStringLiteral("/home/asif/Desktop/project/QT6_gstreamer/main.qml")));
view->show();
QQuickItem *root       = view->rootObject();  //I get root = 0
QObject    *targetItem = root->findChild<QObject*>("videoItem");  //it crashes since root is 0

g_object_set(targetItem,"widget",gtksink);

g_object_set (playbin, "video-sink", gtksink, NULL);
g_object_set (playbin, "uri", "https://gstreamer.freedesktop.org/data/media/sintel_trailer-480p.webm", NULL);
gst_element_set_state (playbin, GST_STATE_PLAYING);

My QML file:

import QtQuick 2.4
import QtQuick.Controls
import QtQuick.Dialogs
import QtQuick.Window 2.1

import org.freedesktop.gstreamer.GLVideoItem 1.0

Item {
GstGLVideoItem {
id: video
objectName: “videoItem”
width: 400; height: 400
}
}

You must call gst_element_factory_make(“qml6glsink”, NULL) before doing anything with Qml.

The example at subprojects/gst-plugins-good/tests/examples/qt6/qmlsink/main.cpp · main · GStreamer / gstreamer · GitLab contains a fully working example.