How to show video in video, using gstreamer on wayland (weston)?



  • Hi Sirs,
    I want show video in video, using gstreamer on wayland(weston).
    the following is the part of my code, let gstwaylandsink render on qt widget,

    QPlatformNativeInterface *native =
                QGuiApplication::platformNativeInterface();
    struct wl_surface *surface = static_cast<struct wl_surface *>(
    native->nativeResourceForWindow("surface", m_topWidget->windowHandle()));
    gst_video_overlay_set_window_handle(
                GST_VIDEO_OVERLAY (GST_MESSAGE_SRC (msg)),
                (guintptr) surface
            );
    gst_video_overlay_set_render_rectangle(
                GST_VIDEO_OVERLAY (GST_MESSAGE_SRC (msg)),
                rect.x(), rect.y(),
                rect.width(), rect.height()
            );
    

    I use QGridLayout, trying to overlap the video,

          m_layout->addWidget(m_videoWidgetArr[iMain], 0, 0, 3, 3);
          m_layout->addWidget(m_videoWidgetArr[iMain+1], 2, 2, 1, 1);
    

    But , it is no use, what do i miss?
    Thank you for reading.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    What result are you getting currently ?

    One way would also be to place them by hand in your container widget.



  • @SGaist The result looks like randomly, sometimes only show the bigger video, sometimes the bigger video covers the smaller one.
    Thanks for your reply.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.