2 different qmlsink structures

Hello, I have a qmlsink structure, I connect it to an rtsp link and GstGLVideoItem in the qml section and give it as a parameter to the qmlsink structure in the cpp file. While the first structure works properly, there is no problem while transferring the image in the incoming broadcast link, but I create another qmlsink structure from this qmlsink structure, the class names and qmlsink name will be different, I connect the qml section to the second structure in the same way, but the image does not come to the second structure. Can you help me with how to show 2 different broadcast addresses in 2 different frames with a multiple qmlsink structure?

QString pipelineDescription = QString(
                                      "rtspsrc location=rtsp://127.0.0.1:8554/stream ! 
                                      "rtph264depay ! "
                                      "h264parse ! "
                                      "decodebin ! "
                                      "videoconvert ! "
                                      "queue ! "
                                      "glupload ! "
                                      "glcolorconvert ! "
                                      "qmlglsink name=video_sink sync=false"
                                      ).arg(url);

GstElement *videoSink = gst_bin_get_by_name(GST_BIN(pipeline), "video_sink");
    if (!videoSink) {
        qCritical() << "Failed to find qmlglsink in pipeline.";
        gst_object_unref(pipeline);
        pipeline = nullptr;
        return;
    }
-----2. Qmlsink structures-----
"rtspsrc location=rtsp://192.168.12.87:8554/stream ! "
                                      "rtph264depay ! "
                                      "h264parse ! "
                                      "decodebin ! "
                                      "videoconvert ! "
                                      "queue ! "
                                      "glupload ! "
                                      "glcolorconvert ! "
                                      "qmlglsink name=termal_sink sync=false"
                                      ).arg(url);
 GstElement *videoSink = gst_bin_get_by_name(GST_BIN(pipeline), "termal_sink");
    if (!videoSink) {
        qCritical() << "Failed to find qmlglsink in pipeline.";
        gst_object_unref(pipeline);
        pipeline = nullptr;
        return;
    }

How can I send images from 2 different addresses to 2 different qmlsink structures at the same time? Why does the image come to the first structure but not to the second structure?
@Joe

You lay out two qml sink items in GUI(widgets or qml) and link these sink items with the pipelines. Adding qmlglsink to the pipeline will not work.

The example(a bit old) is here.

 GstGLVideoItem {
        id: videoItem
        anchors.centerIn: parent
        width: parent.width
        height: parent.height
        visible: true
    }
GStreamerQmlSink { // this is qml register type for gstreamer qmlsink cpp file 
        id: gstreamer
    }
Component.onCompleted: gstreamer.startStream("rtsp://127.0.0.1:8554/stream",videoItem)

I am doing the qml side like this for the first qmlsink. There is a similar one for the second one, but the image does not go to it. Each of the two structures will show a different link.

Download the example and run it to undestand how it works.
you need two GstGLVideoItem. I have 4.

Hello, I am already using GstGLVideoItem elements in 2 separate qml files for each of my qmlsink cpp files, but unfortunately they do not work at the same time. I saw that a few more people are still getting this error. Can you help me with this?

Write a C++ class and call it Pipeline. Create two instances of Pipeline and assign two different sources and sinks. Define two video items in QML code with different ids and get them in your main.cpp to create two sinks for the two instances of Pipeline. qml code does not need any source like the following( “rtsp://127.0.0.1:8554/stream” ).

gstreamer.startStream("rtsp://127.0.0.1:8554/stream",videoItem)
GstElement *videoSink1 = gst_bin_get_by_name(GST_BIN(pipeline), "termal_sink");
g_object_set( videoSink1, "widget",            quickItemSink1, NULL );

GstElement *videoSink2 = gst_bin_get_by_name(GST_BIN(pipeline), "termal_sink");
g_object_set( videoSink2, "widget",            quickItemSink2, NULL );
quickItemSink1 and videoSink2====>videoItem    

// find QML video sink videoItem
use QQmlApplicationEngine to get root window
auto  quickItemSink1 = root_window->findChild< QQuickItem * >( "videoItem1" );
auto  quickItemSink2 = root_window->findChild< QQuickItem * >( "videoItem2" );

This means you add QML video items as widgets to qmlglsink.

I understand, when I do as you said, yes, I can get the images from 2 different sources. Is the important point here that the qmlsink names are the same? Would it change if I gave them differently? What is the point that makes the difference here? Thank you for your help.

How can you get them to add to your pipelines if their ids are same? This costs nothing, right?

I added their IDs differently, yes you are right, thank you.