<div dir="ltr"><div><div><div><div><div>Hi Robert,<br><br></div>I think you should read-up a little about Qt graphics-view a little before attempting to use the QtGstreamer OpenGL widget. As I mentioned in previous mail you will need to create a graphics scene, add a view to to it and then add the video widget to the scene to make it work.<br>
<br></div>I thought it worked for you after you made those changes (according to your last mail thread - "<font><span style="font-weight:normal"><span id=":159" class="" tabindex="-1">QtGStreamer: How to get run a QGst::Ui::GraphicsVideoWidget")?<br>
<br></span></span></font></div><font><span style="font-weight:normal"><span id=":159" class="" tabindex="-1">Here's your example with the required modifications done:<br><br><font>int main(int argc, char *argv[])<br>{<br>
QApplication app(argc, argv);<br> QGst::init(&argc, &argv);<br><br> QGraphicsScene* scene = new QGraphicsScene;<br> QGraphicsView* view = new QGraphicsView(scene);<br> view->setViewport(new QGLWidget);<br>
<br> QGst::Ui::GraphicsVideoSurface* surface = new <br> QGst::Ui::GraphicsVideoSurface(view);<br> QGst::Ui::GraphicsVideoWidget* widget = new <br> QGst::Ui::GraphicsVideoWidget();<br>
<br> widget->setSurface(surface);<br> scene->addItem(widget);<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>}</font><br><br></span></span></font></div><font><span style="font-weight:normal"><span id=":159" class="" tabindex="-1"><font>HTH,<br></font></span></span></font></div>
<font><span style="font-weight:normal"><span id=":159" class="" tabindex="-1"><font><font>-mandeep<br><br></font></font></span></span></font><div><div><div><font><span style="font-weight:normal"><span id=":159" class="" tabindex="-1"><br>
</span></span></font></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Mar 24, 2013 at 7:53 PM, 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Sorry for bothering you again about an Qt related topic. But I am not able to<br>
get the qtglvideosink running.<br>
I tried the two ways mentioned in<br>
<a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/qt-gstreamer/html/qtvideosink_overview.html" target="_blank">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/qt-gstreamer/html/qtvideosink_overview.html</a><br>
<<a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/qt-gstreamer/html/qtvideosink_overview.html" target="_blank">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/qt-gstreamer/html/qtvideosink_overview.html</a><br>
> :<br>
1) Usage without QtGStreamer<br>
2) Usage with QtGStreamer<br>
<br>
<br>
*For 1 i tried this:*<br>
<br>
#include <QGst/Init><br>
#include <QGst/Pipeline><br>
#include <QGst/ElementFactory><br>
#include <QGst/Ui/VideoWidget><br>
#include <QGlib/Connect><br>
<br>
#include <QApplication><br>
#include <QGLWidget><br>
#include <QDebug><br>
<br>
int main(int argc, char *argv[])<br>
{<br>
QApplication app(argc, argv);<br>
QGst::init(&argc, &argv);<br>
<br>
QGst::ElementPtr source = QGst::ElementFactory::make("videotestsrc");<br>
QGst::ElementPtr sink = QGst::ElementFactory::make("qtglvideosink");<br>
<br>
QGLWidget* glWidget = new QGLWidget();<br>
<br>
glWidget->makeCurrent();<br>
sink->setProperty("glcontext", (void*)QGLContext::currentContext());<br>
glWidget->doneCurrent();<br>
<br>
if(sink->setState(QGst::StateReady) != QGst::StateChangeSuccess)<br>
{<br>
qWarning("Gl not available. Closing app.");<br>
app.exit();<br>
}<br>
<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>
// QGlib::connect(sink, "update", glWidget, &QGLWidget::update());<br>
<br>
glWidget->show();<br>
pipeline->setState(QGst::StatePlaying);<br>
<br>
return app.exec();<br>
}<br>
<br>
I am not able to connect the update signal to the slot QGLWidget::update().<br>
How can i do this? Or: do I have to do it? It also seems not enough to<br>
solely set the QLContext to the qtglvideosink; what esle I have to do?<br>
<br>
<br>
<br>
*And for 2 I tried this:*<br>
<br>
int main(int argc, char *argv[])<br>
{<br>
QApplication app(argc, argv);<br>
QGst::init(&argc, &argv);<br>
<br>
QGst::ElementPtr source = QGst::ElementFactory::make("videotestsrc");<br>
QGst::ElementPtr sink = QGst::ElementFactory::make("qtglvideosink");<br>
<br>
QGst::Ui::VideoWidget* widget = new QGst::Ui::VideoWidget();<br>
// QGLWidget* glWidget = new QGLWidget(widget);<br>
<br>
// glWidget->makeCurrent();<br>
// sink->setProperty("glcontext", (void*)QGLContext::currentContext());<br>
// glWidget->doneCurrent();<br>
// if(sink->setState(QGst::StateReady) != QGst::StateChangeSuccess)<br>
// {<br>
// qWarning("Closing app. Probably Gl not available.");<br>
// app.exit();<br>
// }<br>
<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>
widget->setVideoSink(sink);<br>
<br>
pipeline->setState(QGst::StatePlaying);<br>
widget->show();<br>
<br>
return app.exec();<br>
}<br>
<br>
Here I don't know how to make the QGst::Ui::VideoWidget() openGL aware. I<br>
also can't inherit both the QGLWidget and the QGst::Ui::VideoWidget in one<br>
class since this is forbidden by Qt. How can I GL acceleration with a<br>
QGst::Ui::VideoWidget()?<br>
<br>
In the two cases above nothing happens, except that an empty widget pop's<br>
up.<br>
<br>
Thanks for any help,<br>
Robert.<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/Usage-of-the-qtglvideosink-tp4659243.html" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/Usage-of-the-qtglvideosink-tp4659243.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>