Have some problems with QML & gstreamer xvideosink usage with xoverlay
-
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':edAny help would be beneficial.
Br,
Mikael