<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
*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></blockquote><div>This example seg faults on my machine at the sink->setProperty("glcontext"...) call. I have a Ubuntu 12.10, 32-bit pc with QtGstreamer compiled.<br></div><div>I've not used QtGstreamer this way, so can;t say anything immediately. This will need further investigation.<br>
<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<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></blockquote><div><br></div><div>If using QtGstreamer, you don't have to create the qtvideosink/qtglvideosink element explicitly. The docs mention that one will be created for you internally.<br><br></div><div>From the video surface class docs:<br>
<br>"<span style="color:rgb(0,0,0);font-family:'Lucida Grande',Verdana,Geneva,Arial,sans-serif;font-size:12.8px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:12.8px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);display:inline!important;float:none">This class internally creates and uses either a "qtglvideosink" or a "qtvideosink" element. This element is created the first time it is requested and a reference is kept internally."<br>
<br></span></div><div><span style="color:rgb(0,0,0);font-family:'Lucida Grande',Verdana,Geneva,Arial,sans-serif;font-size:12.8px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:12.8px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);display:inline!important;float:none">So in case using "with QtGstreamer", the previous example that worked seems to be the right approach.<br>
<br></span></div><div><span style="color:rgb(0,0,0);font-family:'Lucida Grande',Verdana,Geneva,Arial,sans-serif;font-size:12.8px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:12.8px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);display:inline!important;float:none">HTH,<br>
</span></div><div><span style="color:rgb(0,0,0);font-family:'Lucida Grande',Verdana,Geneva,Arial,sans-serif;font-size:12.8px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:12.8px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);display:inline!important;float:none">-mandeep<br>
<br></span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
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></div>