<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Mar 21, 2013 at 2:47 AM, pfarmer <span dir="ltr"><<a href="mailto:flacone@gmx.de" target="_blank">flacone@gmx.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I am trying to run a simple test video with QtGtreamer. The examples provided<br>
with the QtGStreamer API documentation run successfully. The Voip example (<br>
<a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/qt-gstreamer/html/examples_2voip_2main_8cpp-example.html" target="_blank">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/qt-gstreamer/html/examples_2voip_2main_8cpp-example.html</a><br>

<<a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/qt-gstreamer/html/examples_2voip_2main_8cpp-example.html" target="_blank">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/qt-gstreamer/html/examples_2voip_2main_8cpp-example.html</a>><br>

) also includes a videotestsrc which is properly displayed.<br>
Nevertheless a QGst::Ui::VideoWidget in conjunction with watchPipeline() is<br>
used there. I rather wanted to get it work with the help of a<br>
QGst::Ui::GraphicsVideoWidget. Therefore I tried following code:<br>
<br>
#include <QGst/Init><br>
#include <QGst/Pipeline><br>
#include <QGst/Element><br>
#include <QGst/ElementFactory><br>
#include <QGst/Ui/GraphicsVideoSurface><br>
#include <QGst/Ui/GraphicsVideoWidget><br>
<br>
#include <QApplication><br>
#include <QGLWidget><br>
#include <QGraphicsView><br>
#include <QDebug><br>
<br>
int main(int argc, char *argv[])<br>
{<br>
        QApplication app(argc, argv);<br>
        QGst::init(&argc, &argv);<br>
<br>
        QGraphicsView* view = new QGraphicsView;<br>
        view->setViewport(new QGLWidget);<br>
        QGst::Ui::GraphicsVideoSurface* surface = new<br>
QGst::Ui::GraphicsVideoSurface(view);<br>
        QGst::Ui::GraphicsVideoWidget* widget = new<br>
QGst::Ui::GraphicsVideoWidget();<br>
        widget->setSurface(surface);<br>
<br>
        QGst::ElementPtr source = QGst::ElementFactory::make("videotestsrc");<br>
        QGst::ElementPtr sink = surface->videoSink();<br>
        QGst::PipelinePtr pipeline = QGst::Pipeline::create();<br>
        pipeline->add(source);<br>
        pipeline->add(sink);<br>
        if(source->link(sink) == false)<br>
                qDebug("Link failed");<br>
<br>
        view->show();<br>
        pipeline->setState(QGst::StatePlaying);<br>
<br>
        return app.exec();<br>
}<br>
<br>
<br>
This code is running, but the widget stays empty. What is the mistake I<br>
made?<br>
Hopefully this is the right place to ask questions about QtGStreamer.<br></blockquote><div><br></div><div>I don't think there's any 'gstreamer' issue in your code. I haven't done much of Qt graphicsview programming, but a cusrory glance on the docs showed that you seemed to have missed creating a scene.<br>
<br></div><div>Something like:<br><br>QGraphicsScene* scene =  new QGraphicsScene;<br>QGraphicsView* view = new QGraphicsView(scene);<br><br></div><div>Later you will have to add your GL widget to the scene:<br><br>scene->addItem(widget);<br>
<br></div><div>The gstreamer part of your code looks ok.<br><br></div><div>HTH,<br></div><div>-mandeep<br><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/QtGStreamer-How-to-get-run-a-QGst-Ui-GraphicsVideoWidget-tp4659202.html" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/QtGStreamer-How-to-get-run-a-QGst-Ui-GraphicsVideoWidget-tp4659202.html</a><br>

Sent from the GStreamer-devel mailing list archive at Nabble.com.<br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div><br></div></div>