Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Have some problems with QML & gstreamer xvideosink usage with xoverlay
Forum Updated to NodeBB v4.3 + New Features

Have some problems with QML & gstreamer xvideosink usage with xoverlay

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 1.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nylundm
    wrote on last edited by
    #1

    Hi,

    I have tried to search the forums to solve my problems, but I could not find any topic that would help me.

    I have a video application that has a UI written in QML. When certain events happen the UI is put on the background
    and the QWidget that I have xoverlayed will be shown. Everything goes fine but the videosink is not always stretched to the full screen
    (which should be the case). Sometimes the video is just a 320x240 in the left top corner and when I click or somehow otherwise
    refresh the window, it re-sizes it self to full screen. Its a bit annoying behavior, it happens quite often but not always.

    I'm no Qt expert and therefore I might have understood things in wrong way and that's why I need your help.

    What I have:

    I have a class that has been inherited from 'QDeclarativeView' and I do the following (mainwidget is QWidget):

    @viewer.setViewport(mainWidget);
    viewer.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    viewer.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    viewer.setResizeMode(QDeclarativeView::SizeRootObjectToView);

    viewer.setFrameStyle(0);

    viewer.setAttribute(Qt::WA_OpaquePaintEvent);
    viewer.setAttribute(Qt::WA_NoSystemBackground);

    viewer.viewport()->setAttribute(Qt::WA_OpaquePaintEvent);
    viewer.viewport()->setAttribute(Qt::WA_NoSystemBackground);

    viewer.setViewportUpdateMode(QGraphicsView::FullViewportUpdate);

    viewer.setWindowFlags(Qt::FramelessWindowHint);

    viewer.setResizeMode(QDeclarativeView::SizeRootObjectToView);
    @

    Then I do later in the code:

    @
    GstElement* videosink = gst_element_factory_make("xvimagesink", NULL);

    QGraphicsScene *scene = viewer.scene();
    QGraphicsView *cview = scene->views()[0];
    gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(videosink),
    cview->viewport()->effectiveWinId());
    @

    Have I now understood something incorrectly or could the problem in the QML side? I previously used QtGstreamerVideosink
    that worked correctly every time, but I can't use it any more for various reasons. I'm using 'xvimagesink' only for development
    purposes before I get my hands on the chip set vendors videosink that has same properties as 'xvimagesink' when 'gst-inspect':ed

    Any help would be beneficial.

    Br,
    Mikael

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved